Beispiel #1
0
int
main (int argc, char **argv)
{
	int pcl_return;
	
	union {
		int	(*func)();
		void	*func_void;
	} unifunc;
	
#ifdef	HAVE_SETLOCALE
	setlocale (LC_ALL, "");
#endif

	pcl_return = process_command_line (argc, argv);

	if (pcl_return != 99) {
		return pcl_return;
	}

	if (strlen (argv[1]) > 31) {
		fprintf (stderr, "Invalid PROGRAM name\n");
		return 1;
	}
	cob_init (argc - 1, &argv[1]);
	unifunc.func_void = cob_resolve (argv[1]);
	if (unifunc.func_void == NULL) {
		cob_call_error ();
	}
	cob_stop_run ( unifunc.func() );
}
Beispiel #2
0
void
cob_module_enter (struct cob_module *module)
{
	if (unlikely(!cob_initialized)) {
		fputs ("Warning: cob_init expected in the main program\n", stderr);
		cob_init (0, NULL);
	}

	module->next = cob_current_module;
	cob_current_module = module;
}
Beispiel #3
0
static void _ReadyExecute(MessageHandler *handler, char *loadpath) {

  if (LibPath == NULL) {
    if ((ModuleLoadPath = getenv("COB_LIBRARY_PATH")) == NULL) {
      if (loadpath != NULL) {
        ModuleLoadPath = loadpath;
      } else {
        ModuleLoadPath = MONTSUQI_LOAD_PATH;
      }
    }
  } else {
    ModuleLoadPath = LibPath;
  }
  if (handler->loadpath == NULL) {
    handler->loadpath = ModuleLoadPath;
  }
  cob_init(0, NULL);
}
Beispiel #4
0
int
cobinit (void)
{
	cob_init (0, NULL);
	return 0;
}
Beispiel #5
0
/* Main function */
int
main (int argc, char **argv)
{
  cob_init (argc, argv);
  cob_stop_run (ORBITS ());
}
Beispiel #6
0
int
main (int argc, char **argv)
{
  cob_init (argc, argv);
  cob_stop_run (fizzbuzz ());
}