next up previous contents index
Next: Options Up: Syntax Previous: Version Statement   Contents   Index


Usage Statement

Syntax : usage = { usage specification list };

Description : describes the module interface for a call by the run-time command. An usage specification is made by an argument declaration followed by space and a quoted string; the quoted string is a description of the corresponding argument. The usage specifications are separated by a comma. Therefore, an extended description of the syntax may be:

usage = { arg_1 "string_1",
          arg_2 "string_2",
              ...
          arg_n "string_n"
        };

There are five types of argument declaration:

  1. options : they are optional parameters, which are selected by putting in the command line a - followed by any printable character (but ?). These character defines the option. Unix uses such options for its commands, as the option -a (list all entries) of the command ls. Options are always placed before needed arguments.

  2. needed arguments : they are needed parameters, as the Unix command write has a needed arguments (which is a user name). Any module must define at least one needed argument.

  3. optional arguments : it is a list of parameters which is used entirely or is not used at all (you cannot use some of the arguments of this list and don't use the others); this list is put between { and } and is always placed after needed arguments.

  4. variable argument : this argument corresponds to a list of undefined length, the module loops on all arguments of the list; it is always placed after needed arguments; You cannot define for the same module optional and variable arguments.

  5. unused arguments : this list describes the parameters of the module function which are not used as arguments in the command mode. This list should be put at the end of the declaration.

The corresponding C variables (which are defined in the module function) can be of scalar type (short, int, long, unsigned short, unsigned int, unsigned long, float, double) or of MegaWave2 type (a pointer to a structure, see the Volume two: ``MegaWave2 System Library'' for a list of all available MegaWave2 types).

The common description for the usage specification is the following: H name -> or <- C name. The right arrow -> describes an input flow and the left arrow <- describes an output flow.

The word H name contains the name of the argument which is used by Human being (e.g. used in the help, in the documentation) The word C name contains the name of the C variable used in the module body. One can choice to give to H name and C name the same word.

The syntax for each type of argument declaration is described in the next sections 4.2 to 4.6. We write by H_id any word of type H name and by C_id any word of type C name.


next up previous contents index
Next: Options Up: Syntax Previous: Version Statement   Contents   Index
mw 2004-05-05