File: main.c

package info (click to toggle)
vis5d 4.3-5
  • links: PTS
  • area: main
  • in suites: slink
  • size: 16,856 kB
  • ctags: 6,127
  • sloc: ansic: 66,158; fortran: 4,470; makefile: 1,683; tcl: 414; sh: 69
file content (69 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* main.c */



#include <stdio.h>
#include <string.h>
#include "analyze.h"
#include "file.h"
#include "grid.h"
#include "gui.h"
#include "select.h"
#include "ui.h"
#include "../src/v5d.h"


int Debug;           /* -debug */
char *path = NULL;   /* -path */


main( int argc, char *argv[] )
{
   struct grid_db *db;
   v5dstruct *v5dout;
   int i;
   int text_ui = 0;

   db = alloc_grid_db();
   v5dout = v5dNewStruct();

   Debug = 0;

   /* Read initial input files */
   if (argc>1) {
      for (i=1;i<argc;i++) {
         if (strcmp(argv[i],"-t")==0) {
            text_ui = 1;
         }
         else if (strcmp(argv[i],"-debug")==0) {
            Debug = 1;
         }
         else if (strcmp(argv[i],"-path")==0) {
            path = argv[i+1];
            i++;
         }
         else {
            get_file_info( argv[i], db );
         }
      }
   }


   analyze_grids( db );
   select_all( db, ALL_BITS, 1 );

   setup_defaults( db, v5dout, 1, 1, 1 );

   if (text_ui) {
      /* Text-based user interface */
      ui_loop( db, v5dout );
   }
   else {
      /* Graphical user interface */
      make_gui();
      gui_loop( db, v5dout );
   }

   return 0;
}