ARB
WETC_main.cxx
Go to the documentation of this file.
1 // ================================================================ //
2 // //
3 // File : WETC_main.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // ================================================================ //
10 
11 #include <arbdb.h>
12 #include <awt.hxx>
13 #include <aw_window.hxx>
14 #include <aw_root.hxx>
15 
17 
18 
19 int ARB_main(int argc, char *argv[]) {
20  GB_shell shell;
21  AW_root *aw_root = AWT_create_root("ntree.arb", "ARB_WETC", new NullTracker); // no macro recording here
22 
24 
25  if (argc != 3) {
26  error = "Missing arguments";
27  }
28  else {
29  const char *com = argv[1];
30  const char *file = argv[2];
31 
32  if (strcmp(com, "-fileedit") != 0) {
33  error = GBS_global_string("Unexpected parameter '%s'", com);
34  }
35  else {
36  AWT_show_file(aw_root, file);
37  aw_root->window_hide(NULp);
39  aw_root->main_loop();
40  }
41  }
42 
43  if (error) {
44  fprintf(stderr,
45  "Syntax: arb_wetc -fileedit filename\n"
46  "Error: %s\n",
47  error);
48  return EXIT_FAILURE;
49  }
50  return EXIT_SUCCESS;
51 }
52 
const char * GB_ERROR
Definition: arb_core.h:25
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:204
#define EXIT_SUCCESS
Definition: arb_a2ps.c:154
T_PT_MAIN com
static void error(const char *msg)
Definition: mkptypes.cxx:96
#define EXIT_FAILURE
Definition: arb_a2ps.c:157
#define AW_HEADER_MAIN
Definition: aw_window.hxx:36
void main_loop()
Definition: AW_root.cxx:625
AW_root * AWT_create_root(const char *properties, const char *program, UserActionTracker *user_tracker)
#define NULp
Definition: cxxforward.h:97
void AWT_install_cb_guards()
AW_HEADER_MAIN int ARB_main(int argc, char *argv[])
Definition: WETC_main.cxx:19
void window_hide(AW_window *aww)
Definition: AW_root.cxx:477
void AWT_show_file(AW_root *awr, const char *filename)