prg_tfile_name_list_get()

Abstract

Returns a list of model file names.

Syntax

prg_tfile_name_list_get (type)
Argument Type Description
type PrgT_Tfile_Type Model file type of interest. See Table 5 for a list of the constants used to specify a model type.

Return Type

Prg_List*

Returns a pointer to the list containing the names of files corresponding to the requested type. These file names lack a file extension and represent the "visible" files as per the user's "mod_dirs" settings.

prg_file_funcs.h

Example

/* Obtain a list of network models.	*/
file_list = prg_tfile_name_list_get (PrgC_Tfile_Type_Network);
printf ("Network files\n");
if (file_list) {
	op_prg_list_map (file_list, prg_test_map_string_fast, 0);
	}
/* Obtain a list of node models.	*/
file_list = prg_tfile_name_list_get (PrgC_Tfile_Type_Node);
printf ("Node files\n");
if (file_list) {
	op_prg_list_map (file_list, prg_test_map_string_fast, 0);
	}
/* Obtain a list of process models.	*/
file_list = prg_tfile_name_list_get (PrgC_Tfile_Type_Process);
printf ("Process files\n");
if (file_list) {
	p_prg_list_map (file_list, prg_test_map_string_fast, 0);
	}

Details

The available model files are constrained by the environment within which this function is executed. The "mod_dirs" preference specifies the list of model directories to be searched to obtain model names. The list of model files returned by this function should be deallocated by calls to prg_list_free() and prg_mem_free() when no longer needed.

The model names stored in the list are base names, without extensions such as .nt.m or .ex.o.

Purpose

Provides a mechanism by which the names of specified types of models can be obtained from the system. These names can be used in future calls to open and read model files, or display model names for further processing.

Errors

  • None

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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