SDDSlib
|
Command-line argument parsing utilities for handling options and arguments. More...
Go to the source code of this file.
Macros | |
#define | DEBUG 0 |
#define | COMMAS_SEPARATE_FILENAMES 0 |
#define | ITEMS_BUFSIZE 10 |
Functions | |
int | parseList (char ***list, char *string) |
long | add_file_arguments (int argc, char **argv, char ***argvNew) |
int | parse_string (char ***list, char *string) |
int | scanargs (SCANNED_ARG **scanned, int argc, char **argv) |
int | scanargsg (SCANNED_ARG **scanned, int argc, char **argv) |
void | prompt_for_arguments (int *argc, char ***argv) |
long | processPipeOption (char **item, long items, unsigned long *flags) |
void | processFilenames (char *programName, char **input, char **output, unsigned long pipeFlags, long noWarnings, long *tmpOutputUsed) |
void | free_scanargs (SCANNED_ARG **scanned, int argc) |
Command-line argument parsing utilities for handling options and arguments.
Definition in file scanargs.c.
#define COMMAS_SEPARATE_FILENAMES 0 |
Definition at line 14 of file scanargs.c.
#define DEBUG 0 |
Definition at line 13 of file scanargs.c.
#define ITEMS_BUFSIZE 10 |
Definition at line 220 of file scanargs.c.
long add_file_arguments | ( | int | argc, |
char ** | argv, | ||
char *** | argvNew ) |
Definition at line 455 of file scanargs.c.
void free_scanargs | ( | SCANNED_ARG ** | scanned, |
int | argc ) |
Frees the memory allocated by scanargs or scanargsg functions.
[in,out] | scanned | Pointer to the array of scanned arguments to free; set to NULL on return. |
[in] | argc | The number of arguments in the scanned array. |
Definition at line 584 of file scanargs.c.
int parse_string | ( | char *** | list, |
char * | string ) |
Definition at line 605 of file scanargs.c.
int parseList | ( | char *** | list, |
char * | string ) |
Definition at line 222 of file scanargs.c.
void processFilenames | ( | char * | programName, |
char ** | input, | ||
char ** | output, | ||
unsigned long | pipeFlags, | ||
long | noWarnings, | ||
long * | tmpOutputUsed ) |
Processes input and output filenames, handling defaults and temporary files if necessary.
[in] | programName | Name of the program, used in error messages. |
[in,out] | input | Pointer to the input filename; may be modified. |
[in,out] | output | Pointer to the output filename; may be modified. |
[in] | pipeFlags | Flags indicating input/output redirection options. |
[in] | noWarnings | Non-zero to suppress warning messages. |
[out] | tmpOutputUsed | Pointer to a flag that indicates whether a temporary output file is used. |
Definition at line 390 of file scanargs.c.
long processPipeOption | ( | char ** | item, |
long | items, | ||
unsigned long * | flags ) |
Processes the pipe option for input/output redirection.
[in] | item | Array of option items to process. |
[in] | items | Number of items in the array. |
[out] | flags | Pointer to an unsigned long where the pipe flags will be stored. |
Definition at line 356 of file scanargs.c.
void prompt_for_arguments | ( | int * | argc, |
char *** | argv ) |
Definition at line 306 of file scanargs.c.
int scanargs | ( | SCANNED_ARG ** | scanned, |
int | argc, | ||
char ** | argv ) |
Scans and parses command-line arguments into options and argument lists.
[out] | scanned | Pointer to an array where the parsed arguments will be stored. |
[in] | argc | The number of command-line arguments. |
[in] | argv | The array of command-line arguments. |
Definition at line 36 of file scanargs.c.
int scanargsg | ( | SCANNED_ARG ** | scanned, |
int | argc, | ||
char ** | argv ) |
Scans and parses command-line arguments, expanding any wildcard or list arguments.
[out] | scanned | Pointer to an array where the parsed arguments will be stored. |
[in] | argc | The number of command-line arguments. |
[in] | argv | The array of command-line arguments. |
Definition at line 163 of file scanargs.c.