74 lines
No EOL
2.2 KiB
C
74 lines
No EOL
2.2 KiB
C
#ifndef OS_DRIVER
|
|
#define OS_DRIVER
|
|
|
|
// header files
|
|
#include <stdio.h>
|
|
#include "StringUtils.h"
|
|
#include "configops.h"
|
|
#include "metadataops.h"
|
|
#include "simulator.h"
|
|
// ??? #include "datatypes.h"
|
|
|
|
// program constants
|
|
typedef enum {SUBSTRING_NOT_FOUND = 0, MIN_NUM_ARGS = 3, LAST_FOUR_LETTERS = 4} PRG_CONSTANTS;
|
|
|
|
typedef struct CmdLineDataStruct
|
|
{
|
|
bool programRunFlag;
|
|
bool configDisplayFlag;
|
|
bool mdDisplayFlag;
|
|
bool runSimFlag;
|
|
char fileName[STD_STR_LEN];
|
|
} CmdLineData;
|
|
|
|
|
|
// function prototypes
|
|
|
|
/*
|
|
Name: clearCmdLineStruct
|
|
Process: sets command line structure data to defaults
|
|
Booleans to false, fileName to empty string
|
|
Function Input/Parameters: pointer to command line structure (CmdLineData *)
|
|
Function Output/Parameters: pointer to command line structure (CmdLineData *)
|
|
with updated members
|
|
Function Output/Returned: none
|
|
Device Input/Device: none
|
|
Device Output/Device: none
|
|
Dependencies: none
|
|
*/
|
|
void clearCmdLineStruct(CmdLineData *clDataPtr);
|
|
|
|
/*
|
|
Name: processCmdLine
|
|
Process: checks for at least two arguments,
|
|
then sets Booleans depending on command line switches
|
|
which can be in any order,
|
|
also captures config file name which must be last arugment
|
|
Function Input/Parameters: number of arguments (int),
|
|
vector of arguments (char **)
|
|
Function Output/Parameters: pointer to command line structure (CmdLineData *)
|
|
with updated members,
|
|
set to default values if failure
|
|
to capture arguments
|
|
Function Output/Returned: Boolean result of argument capture
|
|
true if at least one switch and config file name,
|
|
false otherwise
|
|
Device Input/Device: none
|
|
Device Output/Device: none
|
|
Dependencies: ???
|
|
*/
|
|
bool processCmdLine(int numArgs, char **strVector, CmdLineData *clDataPtr);
|
|
|
|
/*
|
|
Name: showCommandLineFormat
|
|
Process: displays command line format as assistance to user
|
|
Function Input/Parameters: none
|
|
Function Output/Parameters: none
|
|
Function Output/Returned: none
|
|
Device Input/Device: none
|
|
Device Output/Monitor: data displayed as spec'd
|
|
Dependencies: printf
|
|
*/
|
|
void showCommandLineFormat();
|
|
|
|
#endif //OS_DRIVER
|