Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

Argument Utilities

Arguments parser/generator. More...


Files

file  Args.c
 Argument utilities code.

file  Args.h
 Argument utilities declarations.


Functions

void MakeArgumentString (int argc, char **argv, char *outArgs, int argsSize)
 Makes a string from main-style argc and argv. More...

int GetArgument (char *inString, char *inArg, char *outVal, int valSize)
 Gets a specified argument from an argument string. More...


Detailed Description

Arguments parser/generator.

Here are the argument utilities. They help parse/generate argument lists in the style of command-line arguments.


Function Documentation

int GetArgument char *    inString,
char *    inArg,
char *    outVal,
int    valSize
 

Gets a specified argument from an argument string.

This function tries to find the argument and, if possible, its value. One-letter arguments can be grouped together as in "-xzf" but in this case all these arguments cannot have a value. Otherwise, values can be assigned with "--argument value" or "-a value".

Parameters:
inString  The argument string to parse.
inArg  The argument to get. Must be a proper NULL-terminated string, even if it is a single letter.
outVal  The value of the argument. Memory must already be allocated.
valSize  The size, in bytes, of the pre-allocated outVal.
Returns:
1 if and only if the argument is in the string.

Definition at line 62 of file Args.c.

void MakeArgumentString int    argc,
char **    argv,
char *    outArgs,
int    argsSize
 

Makes a string from main-style argc and argv.

Parameters:
argc  The number of arguments.
argv  Array to a list of argument strings of size argc.
outArgs  The generated string. Memory must already be allocated.
argsSize  The size, in bytes, of the pre-allocated outArgs.

Definition at line 36 of file Args.c.


Generated on Sun Dec 23 15:21:00 2001 for ANet by doxygen 1.2.12 written by Dimitri van Heesch, © 1997-2001

SourceForge
Logo