prg_list_strings_append()
Abstract
Appends a set of strings to the list specified.
Syntax
prg_list_strings_append (list_ptr)
| Argument | Type | Description |
|---|---|---|
listptr |
PrgT_List* |
pointer to the list-of-interest |
<string list> |
char * |
comma-separated list of string constants or variables this list of one or more arguments must be terminated by the symbolic constant PRGC_NIL. |
Return Type
void
No return value
Header
prg_list_funcs.h
Example:
/* create a textlist to be used for setting an Ema object value.*/
lptr [0] = prg_list_create ();
lptr [1] = prg_list_create();
prg_list_strings_append (lptr [1], “custom_model_list”, “general”, PRGC_NIL);
Ema_Model_Attr_Set (model_id, “ext fileset”, COMP_CONTENTS, lptr[0],
“keywords list”, COMP_CONTENTS, lptr[1],
EMAC_EOL);
Details
A variable number of strings can be appended to the specified list. The string arguments must be terminated by a PRGC_NIL constant.
For each string to be appended to the list, this function creates a newly allocated copy of the string before adding it to the list. Thus, you must deallocate both the string list elements and the list itself when no longer needed.
WARNING: This function is MT unsafe, as described in “Multi-Threading Safety“ on page 11. Access to shared lists must be externally serialized.
Purpose:
This function provides a mechanism by which strings can be appended to a list.
Errors:
- Program Abort: Segmentation violation (due to a malformed or invalid list, or missing
PRGC_NILas last argument)
Reference:
- None