prg_file_parse_block_count_get()

Abstract

Returns the number of parsed blocks in a parse file data structure.

Syntax

prg_file_parse_block_count_get (parse_ptr, block_type_str)
Argument Type Description
parse_ptr PrgT_File_Parse * Parse data structure returned by prg_file_parse() or prg_tfile_parse().
block_type_str const char * Type of block for which to get a count. NULL means all blocks.

Return Type

int

Number of blocks that appear in the parsed file.

prg_file_funcs.h

Details

This function returns the number of blocks that were parsed from a configuration file with prg_file_parse() or prg_tfile_parse(). If the block_type_str argument is NULL, this function returns the total number of blocks in the file. If the argument is non-NULL, the function returns just the number of named blocks that match the block type name. For example, if the file was of the form:

start_A
a : b
end_A
start_A
a2:b2
end_A
start_B
a3:b3
end_B

then

prg_file_parse_block_count_get (parse_ptr, NULL)

would return 3, whereas

prg_file_parse_block_count_get (parse_ptr, "A")

would return 2.

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