source: buchla-68k/orig/GP/GPMAIN.C@ 4b63bf3

Last change on this file since 4b63bf3 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 2.2 KB
Line 
1/*
2 =============================================================================
3 gpmain.c -- general purpose main program
4 Version 1 -- 1987-10-14 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9
10extern int gp_init(); /* application initialization */
11
12int (*gp_clin)(), /* command line processor */
13 (*gp_btch)(), /* batch processor */
14 (*gp_intr)(), /* interactive processor */
15 (*gp_exit)(); /* exit processor */
16
17/*
18
19*/
20
21/*
22 =============================================================================
23 gp_null() -- null SUCCESS function
24 =============================================================================
25*/
26
27int
28gp_null()
29{
30 return(SUCCESS); /* return a SUCCESS response */
31}
32
33/*
34 =============================================================================
35 gp_fail() -- null FAILURE function
36 =============================================================================
37*/
38
39int
40gp_fail()
41{
42 return(FAILURE); /* return a FAILURE response */
43}
44
45/*
46 =============================================================================
47 gp_pass() -- null argument pass function
48 =============================================================================
49*/
50
51int
52gp_pass(arg)
53int arg;
54{
55 return(arg); /* just pass along the input argument */
56}
57
58/*
59
60*/
61
62/*
63 =============================================================================
64 gp_main() -- general purpose main program driver
65 =============================================================================
66*/
67
68gp_main(argc, argv)
69int argc;
70char *argv[];
71{
72 register int rc; /* return code */
73
74 gp_clin = gp_null; /* initialize pointers to functions */
75 gp_btch = gp_null;
76 gp_intr = gp_null;
77 gp_exit = gp_pass;
78
79 if (rc = gp_init(argc, argv)) /* application initialization */
80 exit(rc);
81
82 if ((*gp_clin)(argc, argv)) /* command line processing */
83 rc = (*gp_btch)(argc, argv); /* batch processing */
84 else
85 rc = (*gp_intr)(argc, argv); /* interactive processing */
86
87 rc = (*gp_exit)(rc); /* exit processing */
88
89 exit(rc); /* exit back to system */
90}
Note: See TracBrowser for help on using the repository browser.