This routine fetches the value of a logical argument. There are several possibilties.
The value is first treated as an integer, the selection of technique 1 or 2 is based on a flag. If this conversion fails and the strings argument is provided, then technique three is tried.
If there is any error in getting the value, the actual value is set to that specified by "defVal" and status will be reset to OK, (see flags arguments to changes the effect on status).
> | id | SdsIdType | Id of the argument system. |
---|---|---|---|
> | name | Char * | Name of the argument to get |
> | position | int | The position of the argument. This is used if "name" is a null pointer, an empty string or if we can't find an SDS structure item of that name. |
> | strings | GitLogStrType {[]} | If nonzero, then this is an
array describing the possible values for TRUE
and FALSE. "strings[n].true" is a pointer to a character
string value representing TRUE, while "strings[n].false"
is a pointer character string represeting FALSE.
The maximum length is GIT_ARG_LMAX characters (20).
An entry containing two null pointers indicates the end of the array. If zero, the argument should be able to be converted to an integer value.
|
> | defVal | Int | The Default value. |
> | flags | Int | A bit-mask of flags. Possible values are
|
GIT_M_ARG_UPPER | Convert value to upper case. |
---|---|
GIT_M_ARG_LOWER | Convert value to lower case. |
GIT_M_ARG_LASTBIT | If set, we only consider the LSB of integer values. If not set, only a value of 0 is false. |
GIT_M_ARG_KEEPERR | If we use the default value, return the error which caused it to be tasken. |
GIT_M_ARG_ABBREV | Allow abbreviations. The minimum abbreviation is 2 characters. The first value in the "strings" array which is correct to length of the supplied value is used. |
GIT_M_ARG_KEEPVALERR | Only retain the error if we found the item (and its value was in error). If we did not find the item, then return status ok and the default. |
< | actValue | int * | The actual value is written here. Set to 1 for true and 0 for false. |
---|---|---|---|
! | status | StatusType * | Modified status. If we have an
error and GIT_M_ARG_KEEPERR is true then a message
is reported using {\tt ErsRep} and status is set.
In addition to error codes from the underlying
Arg and Sds routines, one of the following may be
returned
|
GIT__NOARG | The argument id is zero or no item was found. Will not be returned if GIT_M_ARG_KEEPVALERR flag is set, in that case, just return the default with status ok. |
---|---|
GIT__ARGVAL |
Invalid argument value, not one
of those specified in the
strings array.
|
SdsFreeId | Sds | Free an sds id |
---|---|---|
GitArgNamePos | Git | Get an argument Id by name or position |
ArgCvt | Arg | Convert an id to a specified type. |
ErsRep | Ers | Report an error message |
ErsPush | Ers | Increase error context |
ErsPop | Ers | Decreate error context |
ErsAnnul | Ers | Annul error messages |
islower | CRTL | Determines if a character is lower case. |
isupper | CRTL | Determines if a character is upper case. |
toupper | CRTL | Convert a character to upper case. |
tolower | CRTL | Convert a character to lower case. |
strcmp | CRTL | Compare one string to anoterh |
strncpy | CRTL | Copy one string to another. |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au