OpenCOBOL 1.1pre-rel
|
#include "config.h"
#include "defaults.h"
#include <stdio.h>
#include <string.h>
#include <libcob.h>
#include <tarstamp.h>
Go to the source code of this file.
Functions | |
int | main (int argc, char **argv) |
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 63 of file cobcrun.c.
{ union { int (*func)(); void *func_void; } unifunc; if (argc <= 1) { print_usage (); return 1; } /* Quick check without getopt */ if (!strncmp (argv[1], "--version", 10) || !strncmp (argv[1], "-V", 4)) { print_version (); return 0; } if (!strncmp (argv[1], "--help", 10) || !strncmp (argv[1], "-h", 4)) { print_usage (); return 0; } 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() ); }