home *** CD-ROM | disk | FTP | other *** search
- /* --------------------------------------------------------------------------
- * Copyright 1992 by Forschungszentrum Informatik (FZI)
- *
- * You can use and distribute this software under the terms of the licence
- * you should have received along with this program.
- * If not or if you want additional information, write to
- * Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
- * D-7500 Karlsruhe 1, Germany.
- * --------------------------------------------------------------------------
- */
- // **************************************************************************
- // Module genCC_main Juergen Uhl (ju)
- //
- // **************************************************************************
- // SOS interface generator for C++
- // **************************************************************************
-
- #include <stdio.h>
- #include <osfcn.h>
- #include "sys.h"
- #include "smg.h"
- #include "sos.h"
- #include "genCC_err.h"
- #include "trc_genCC.h"
- #include "mta_use.h"
-
- #include "genCC.h"
-
- #ifdef PROFILE
- extern "C" void monitor(...);
- #endif
-
- int main (int argc, char *argv[])
- { int status = 0;
-
- T_INIT ("gen.out");
- sos_init (argc, argv);
-
- int i = 1;
- if (argc >= 2 AND streql (argv[1], "-I"))
- { gen_inline = TRUE;
- i++;
- }
- else
- gen_inline = FALSE;
-
- if (argc != i+1)
- { err_raise (err_USE, err_GEN_USAGE, NULL, FALSE);
- status = 1;
- }
- else
- { sos_String str = smg_String (argv[i]).make_String (TEMP_CONTAINER);
- sos_Schema_module sch = sos_Schema_module::lookup (str);
- if (sch == NO_OBJECT)
- err_raise (err_USE, err_GEN_INVALID_SCHEMA, NULL, FALSE);
- else
- { sch.container().open(READING, WAITING);
- sch.open_imports ();
- gen_module_out (sch);
- sch.close_imports ();
- sch.container().close();
- }
- }
- if (err_occurred (err_SYS) + err_occurred (err_USE) != 0)
- status = -1;
-
- #ifdef PROFILE
- monitor (0);
- #endif
-
- T_EXIT ();
- exit (status);
- }
-