Arguments

The user interface functions handle argument processing from the command line. The argument functions allow you to create arguments which are displayed to, and selected by the user.

An argument is an entity which is created by hmreslib upon request. Each argument has the following data associated with it:
datatypename
The name for the data that is associated with this argument.
argumentname
The character string that must be typed to select this argument.
Type
The type of the argument.
Selected
Determines if the argument is selected.

The first step in the procedure for using hmreslib arguments is to create or assign the arguments displayed. Arguments are assigned by using the function HMRES_argumentassign(). It is with this function call that the fields in the argument structure are initialized.

After all of the arguments are assigned, they must either be displayed, or used by the argument parser to determine which items are selected. To perform this operation, call the function HMRES_agrumentparse(). The result of this function call indicates that either: (1) you have requested the program usage to be printed; or (2) the selected field in the arguments you selected is set to one.

After HMRES_argumentparse() has returned, you have the opportunity to inspect and modify the selected arguments. In this way, you can check to see if an argument is selected, and if so, you may select several other arguments as well. The functions that modify and return the selected status of an argument are HMRES_argumentgetselected() and HMRES_argumentgetselected().

After completing any modifications to the selected arguments, you can be informed of their final selections, and any modifications, by calling the function, HMRES_argumentprintselected().