1 rick 1.1 /*
2 * smpl_00.c $DRMS/proj/cookbook/
3 *
|
4 rick 1.4 * An extremely simple program that does (almost) nothing at all.
5 * It illustrates the use of the
|
6 rick 1.1 *
7 * Usage:
|
8 rick 1.3 * smpl_00 [-avVH]
|
9 rick 1.1 *
10 * Bugs:
|
11 rick 1.4 * The program is of no particular use, and exists merely for heuristic
|
12 rick 1.1 * and testing purposes.
13 *
14 * Revision history is at end of file.
15 */
|
16 rick 1.4 #include <cmdparams.h>
17 #include <timeio.h>
18 /* sample module arguments declaration */
|
19 rick 1.1 ModuleArgs_t module_args[] = {
20 /* module-specific argument declarators */
21 {ARG_STRING, "print", "done", "message to print on successful completion"},
22 /* required end (or blank) argument */
23 {ARG_END}
24 };
|
25 rick 1.4 /* required global declaration (normally included in module driver) */
26 CmdParams_t cmdparams;
27
|
28 rick 1.1 int DoIt (void) {
29 int status;
30 char *msg = cmdparams_get_str (&cmdparams, "print", &status);
31 printf ("%s\n", msg);
32 return 0;
33 }
34
|
35 rick 1.4 int main (int argc, char **argv) {
36 int status = cmdparams_parse (&cmdparams, argc, argv);
37 if (status >= 0) return DoIt ();
38 }
39
|
40 rick 1.1 /*
41 * Revision History
42 *
|
43 rick 1.4 * 09.07.27 file created by R Bogart
|
44 rick 1.1 */
|