![]() ![]() |
![]() |
File: [Development] / JSOC / proj / cookbook / smpl_00.c
(download)
Revision: 1.3, Mon Apr 20 20:45:50 2009 UTC (14 years, 1 month ago) by rick Branch: MAIN CVS Tags: Ver_5-1, NetDRMS_Ver_2-0a2 Changes since 1.2: +1 -1 lines fixed comment |
/* * smpl_00.c $DRMS/proj/cookbook/ * * An extremely simple module that does (almost) nothing at all. * It illustrates the structure of a DRMS module and exhibits * return status behavior with use of the module verbose flags * * Usage: * smpl_00 [-avVH] * * Bugs: * The module is of no particular use, and exists merely for heuristic * and testing purposes. * * Revision history is at end of file. */ /* required .h inclusion */ #include <jsoc_main.h> /* required module identifier */ char *module_name = "CookbookRecipe:00"; /* optional version identifier (recommended, and required for this particular module */ char *version_id = "1.0"; /* required module arguments declaration */ ModuleArgs_t module_args[] = { /* module-specific argument declarators */ {ARG_FLAG, "a", "", "force an abort"}, {ARG_FLAG, "v", "", "run in verbose mode"}, {ARG_STRING, "print", "done", "message to print on successful completion"}, /* required end (or blank) argument */ {ARG_END} }; /* required module declaration */ int DoIt (void) { int status; char *msg = cmdparams_get_str (&cmdparams, "print", &status); if (params_isflagset (&cmdparams, "v")) printf ("running module %s version %s\n", module_name, version_id); if (params_isflagset (&cmdparams, "a")) { printf ("aborting\n"); return 1; } printf ("%s\n", msg); /* required status return to jsoc_main */ return 0; } /* * Revision History * * 09.04.13 file created by R Bogart */
Karen Tian |
Powered by ViewCVS 0.9.4 |