previous next Up Title Contents

Basic Module Routines Used in Hard Programming


In hard programming, all of the routines in the section above are called, the full routine name must be given (see section "Hard" Programming (AudPer86.c)). In addition to the routines given above the following routines are also used:

The Init Routine

Syntax
BOOLN Init_...(ParameterSpecifier parSpec);


Returns
TRUE if the function is successful, otherwise it returns FALSE.


Description
This routine initialises the module by setting the module's parameters, accessed using the module's structure pointer. The parSpec argument can be either "GLOBAL" or "LOCAL", and decides which set of parameters is used by the module. This facility allows more than one instance of a particular module within the same program, e.g. A program could use two instances of the "DataFile" module to read a sound format file from two different files, which could then both be processed.

If the "GLOBAL" option is chosenwhich is the simplest choice for hard programmingthe module uses a single global parameter set for the module parameters, allocating the struture memory space. The "LOCAL" option will initialise the parameter structure currently pointed to by the module's parameter pointer. This option is used in generic programming, where the module's Init routine is explicitly called when the EarObject is initialised. When this occurs an individual module parameter structure is especially prepared for use by that instance of the module.[9


]

The SetPars Routine

Syntax
BOOLN SetPars_...(module parameter settings);


Returns
TRUE all of the parameters are set successfully, otherwise it returns FALSE.


Description
This routine sets all of the parameters for a module at the same time. The parameters are passed to the routine as the function arguments. This routine is called by the ReadPars routine.

The Free Routine

Syntax
BOOLN Free_...(void);


Returns
FALSE if the module has not been initialised, otherwise it returns TRUE.


Description
This routine releases the memory allocated for the module parameter structure. It should be called when the module is no longer in use. In generic programming this routine is called explicitly when the associated EarObject `s memory is free'd using the Free_EarObject or FreeAll_EarObject routines.

[9] An example of where the "LOCAL" option can be used is given in the ?? program (Display module?).


previous next Up Title Contents