|
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 | |
| static void | print_version (void) |
| static void | print_usage (void) |
| 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() );
}

| static void print_usage | ( | void | ) | [static] |
| static void print_version | ( | void | ) | [static] |
Definition at line 29 of file cobcrun.c.
{
int year;
int day;
char buff[64];
char month[64];
memset (buff, 0, sizeof(buff));
memset (month, 0, sizeof(month));
day = 0;
year = 0;
sscanf (__DATE__, "%s %d %d", month, &day, &year);
if (day && year) {
sprintf (buff, "%s %2.2d %4.4d %s", month, day, year, __TIME__);
} else {
sprintf (buff, "%s %s", __DATE__, __TIME__);
}
printf ("cobcrun (%s) %s.%d\n",
PACKAGE_NAME, PACKAGE_VERSION, PATCH_LEVEL);
puts ("Copyright (C) 2004-2009 Roger While");
printf ("Built %s\nPackaged %s\n", buff, octardate);
}

1.7.4