SemysOptGetInt32

01 Returns the integer interpretation of an option value.
02

int32 SemysOptGetInt32(SemysOptions const *pOptions, int32 entryIndex, int32 defaultValue);

03 Parameters:
  • pOptions: Pointing to a SemysOptions structure.
  • entryIndex: The OptionEntry within pOptions to interpret.
  • defaultValue: The default value to use in case of error.
04 Return Values:
The integer presentation of the specified OptionEntry value or defaultValue (See below).
05 If either entryIndex specifies an invalid index or the specified OptionEntry contains no value reference, the passed defaultValue is returned.
It is thus possible to pass the return value of SemysOptFind() without verification of the return value.
06 The interpretation of the value will stop if either the whole value has been interpreted or a non decimal character was found.
07 Examples:
uint16 port = (uint16)SemysOptGetInt32(pOptions, SemysOptFind(pOptions, "port"), 80);

"test" -- port == 80
"test?port=" -- port == 80
"test?port=8080" -- port == 8080
"test?port=1234test" -- port == 1234
08 Reference: SemysOptions.h
Implementation: Semys Library
See Also: Options Sub-System, SemysOptions, SemysOptFind()

Goto: Main Page; This page is part of the Semys software documentation. See About: Documentation for details.