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

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_NIL as last argument)

Reference:

  • None

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com