ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/cookbook/smpl_01.c
Revision: 1.3
Committed: Mon Jul 27 23:42:22 2009 UTC (14 years, 2 months ago) by rick
Content type: text/plain
Branch: MAIN
CVS Tags: NetDRMS_Ver_2-7, NetDRMS_Ver_2-4, NetDRMS_Ver_2-5, Ver_5-10, Ver_5-14, Ver_5-13, Ver_5-12, Ver_5-11, Ver_5-2, NetDRMS_Ver_9-9, NetDRMS_Ver_2-2, Ver_5-6, NetDRMS_Ver_2-1, Ver_5-5, NetDRMS_Ver_2-6, NetDRMS_Ver_2-3, Ver_5-8, Ver_5-7, Ver_5-9, NetDRMS_Ver_2-0b1, Ver_5-3, NetDRMS_Ver_2-0b, NetDRMS_Ver_2-0
Changes since 1.2: +25 -61 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 /*
2 * smpl_01.c $DRMS/proj/cookbook/
3 *
4 * An extremely simple module that does (almost) nothing at all.
5 * It illustrates the structure of a DRMS module and exhibits
6 * return status behavior with use of the module verbose flags
7 *
8 * Usage:
9 * smpl_01 [-avVH]
10 *
11 * Bugs:
12 * The module is of no particular use, and exists merely for heuristic
13 * and testing purposes.
14 *
15 * Revision history is at end of file.
16 */
17 /* required .h inclusion */
18 #include <jsoc_main.h>
19 /* required module identifier */
20 char *module_name = "CookbookRecipe:01";
21 /* optional version identifier
22 (recommended, and required for this particular module */
23 char *version_id = "1.0";
24 /* required module arguments declaration */
25 ModuleArgs_t module_args[] = {
26 /* module-specific argument declarators */
27 {ARG_FLAG, "a", "", "force an abort"},
28 {ARG_FLAG, "v", "", "run in verbose mode"},
29 {ARG_STRING, "print", "done", "message to print on successful completion"},
30 /* required end (or blank) argument */
31 {ARG_END}
32 };
33 /* required module declaration */
34 int DoIt (void) {
35 int status;
36
37 char *msg = cmdparams_get_str (&cmdparams, "print", &status);
38
39 if (params_isflagset (&cmdparams, "v"))
40 printf ("running module %s version %s\n", module_name, version_id);
41 if (params_isflagset (&cmdparams, "a")) {
42 printf ("aborting\n");
43 return 1;
44 }
45
46 printf ("%s\n", msg);
47 /* required status return to jsoc_main */
48 return 0;
49 }
50
51 /*
52 * Revision History
53 *
54 * 09.04.13 file created by R Bogart
55 */