The dtw_parm_data_t Structure

Net.Data uses the dtw_parm_data_t structure to pass parameters to a language environment. Parameters are obtained from three sources:

Net.Data passes explicit parameters first, followed by the return variable, and then the parameters specified on the ENVIRONMENT statement.

The dtw_parm_data_t structure has the following format:

typedef struct dtw_parm_data_t {        /* Parameter data             */
    int   parm_descriptor;            /* Parameter descriptor        */
    char *parm_name;                  /* Parameter name              */
    char *parm_value;                 /* Parameter value             */
    void *res1;                       /* Reserved                    */
    void *res2;                       /* Reserved                    */
} dtw_parm_data_t;

Fields in the dtw_parm_data_t structure:

parm_descriptor
The parm_descriptor field describes the type and use of the parameter being passed to the language environment. Net.Data sets the field by performing an OR operation using the following constants:

parm_name
The parm_name field is a pointer to a string that contains the name of the parameter. Net.Data sets this pointer to NULL if the parameter is a literal string. This pointer should not be freed or modified, and the name's contents should not be modified.

parm_value
The parm_value field is a pointer to an object that contains the value of the parameter. This pointer is set to NULL by Net.Data if the parameter is a variable that is not already defined.

The parm_value field points to an object allocated from the Net.Data run-time heap, the area of memory used for dynamic memory allocation by Net.Data. If parm_value is replaced with another string, the original string must be freed and replaced with a pointer to a character string allocated from the Net.Data heap. Use the dtw_malloc() and dtw_free() utility functions to allocate and free character strings", and use dtw_table_New() and dtw_table_Delete() to allocate and free table objects. Table objects and character strings can also be modified without freeing and reallocating space.

The parm_value pointer and its contents should not be modified for input parameters. Also, do not delete or replace table objects in a parameter list.

The res1 and res2 fields are reserved fields.


[ Top of Page | Previous Page | Next Page | Index ]