/* ***************************************************************************** * * Copyright Nicholas DeClario 2010 * Nicholas DeClario * June 2009 * $Id: template.c,v 1.1 2011/02/24 15:05:27 nick Exp $ * * ****************************************************************************/ #include #include #include #include #include #include /* * Static Defines */ #define VERSION "$Id: template.c,v 1.1 2011/02/24 15:05:27 nick Exp $" /* * Structures */ typedef struct { int help; } optsObj; /* * Function prototypes */ optsObj fetchOptions( int argc, char **argv ); void dispHelp( void ); /* * Variable declarations */ optsObj opts; /* **************************************************************************** * * opts = fetchOptions( argc, argv ); * * Grab our command line arguments and toss them in to optsObj struct * * ***************************************************************************/ optsObj fetchOptions( int argc, char **argv ) { optsObj obj; int c; while( ( c = getopt ( argc, argv, "h:" ) ) != -1 ) switch( c ) { case 'h': opts.help = 1; dispHelp( ); break; default: dispHelp( ); } return obj; } /* **************************************************************************** * * Display the default help screen * * ***************************************************************************/ void dispHelp( void ) { fprintf( stderr, "Usage ...\n" ); exit( 2 ); } /* **************************************************************************** * * Our main program starts here * * ***************************************************************************/ int main( int argc, char **argv ) { opts = fetchOptions( argc, argv ); return EXIT_SUCCESS; }