@@ -57,69 +57,74 @@ struct ezxml {
5757/* structure. For efficiency, modifies the data by adding null terminators*/
5858/* and decoding ampersand sequences. If you don't want this, copy the data and*/
5959/* pass in the copy. Returns NULL on failure.*/
60- ezxml_t ezxml_parse_str (char * s , size_t len );
61-
62- /* A wrapper for ezxml_parse_str() that accepts a file descriptor. First*/
63- /* attempts to mem map the file. Failing that, reads the file into memory.*/
64- /* Returns NULL on failure.*/
65- ezxml_t ezxml_parse_fd (int fd );
66-
67- /* a wrapper for ezxml_parse_fd() that accepts a file name*/
68- ezxml_t ezxml_parse_file (const char * file );
69-
70- /* Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire*/
71- /* stream into memory and then parses it. For xml files, use ezxml_parse_file()*/
72- /* or ezxml_parse_fd()*/
73- ezxml_t ezxml_parse_fp (FILE * fp );
60+ ezxml_t nc_ezxml_parse_str (char * s , size_t len );
7461
7562/* returns the first child tag (one level deeper) with the given name or NULL*/
7663/* if not found*/
77- ezxml_t ezxml_child (ezxml_t xml , const char * name );
64+ ezxml_t nc_ezxml_child (ezxml_t xml , const char * name );
7865
7966/* returns the next tag of the same name in the same section and depth or NULL*/
8067/* if not found*/
81- #define ezxml_next (xml ) ((xml) ? xml->next : NULL)
68+ #define nc_ezxml_next (xml ) ((xml) ? ( xml) ->next : NULL)
8269
8370/* Returns the Nth tag with the same name in the same section at the same depth*/
8471/* or NULL if not found. An index of 0 returns the tag given.*/
85- ezxml_t ezxml_idx (ezxml_t xml , int idx );
72+ ezxml_t nc_ezxml_idx (ezxml_t xml , int idx );
8673
8774/* returns the name of the given tag*/
88- #define ezxml_name (xml ) ((xml) ? xml->name : NULL)
75+ #define nc_ezxml_name (xml ) ((xml) ? xml->name : NULL)
8976
9077/* returns the given tag's character content or empty string if none*/
91- #define ezxml_txt (xml ) ((xml) ? xml->txt : "")
78+ #define nc_ezxml_txt (xml ) ((xml) ? xml->txt : "")
9279
9380/* returns the value of the requested tag attribute, or NULL if not found*/
94- const char * ezxml_attr (ezxml_t xml , const char * attr );
81+ const char * nc_ezxml_attr (ezxml_t xml , const char * attr );
9582
9683/* Traverses the ezxml structure to retrieve a specific subtag. Takes a*/
9784/* variable length list of tag names and indexes. The argument list must be*/
9885/* terminated by either an index of -1 or an empty string tag name. Example: */
9986/* title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1);*/
10087/* This retrieves the title of the 3rd book on the 1st shelf of library.*/
10188/* Returns NULL if not found.*/
102- ezxml_t ezxml_get (ezxml_t xml , ...);
89+ ezxml_t nc_ezxml_get (ezxml_t xml , ...);
10390
10491/* Converts an ezxml structure back to xml. Returns a string of xml data that*/
10592/* must be freed.*/
106- char * ezxml_toxml (ezxml_t xml );
93+ char * nc_ezxml_toxml (ezxml_t xml );
10794
10895/* returns a NULL terminated array of processing instructions for the given*/
10996/* target*/
110- const char * * ezxml_pi (ezxml_t xml , const char * target );
97+ const char * * nc_ezxml_pi (ezxml_t xml , const char * target );
11198
11299/* frees the memory allocated for an ezxml structure*/
113- void ezxml_free (ezxml_t xml );
100+ void nc_ezxml_free (ezxml_t xml );
114101
115102/* returns parser error message or empty string if none*/
116- const char * ezxml_error (ezxml_t xml );
103+ const char * nc_ezxml_error (ezxml_t xml );
104+
105+ const char * * nc_ezxml_all_attr (ezxml_t xml , int * countp );
106+
107+
108+ #if 0
117109
118110/* returns a new empty ezxml structure with the given root tag name*/
119- ezxml_t ezxml_new (const char * name );
111+ ezxml_t nc_ezxml_new (const char * name );
120112
121113/* wrapper for ezxml_new() that strdup()s name*/
122- #define ezxml_new_d (name ) ezxml_set_flag(ezxml_new(strdup(name)), EZXML_NAMEM)
114+ #define nc_ezxml_new_d (name ) ezxml_set_flag(ezxml_new(strdup(name)), EZXML_NAMEM)
115+
116+ /* A wrapper for ezxml_parse_str() that accepts a file descriptor. First*/
117+ /* attempts to mem map the file. Failing that, reads the file into memory.*/
118+ /* Returns NULL on failure.*/
119+ ezxml_t ezxml_parse_fd (int fd );
120+
121+ /* a wrapper for ezxml_parse_fd() that accepts a file name*/
122+ ezxml_t ezxml_parse_file (const char * file );
123+
124+ /* Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire*/
125+ /* stream into memory and then parses it. For xml files, use ezxml_parse_file()*/
126+ /* or ezxml_parse_fd()*/
127+ ezxml_t ezxml_parse_fp (FILE * fp );
123128
124129/* Adds a child tag. off is the offset of the child tag relative to the start*/
125130/* of the parent tag's character content. Returns the child tag.*/
@@ -160,6 +165,8 @@ ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off);
160165/* removes a tag along with all its subtags*/
161166#define ezxml_remove (xml ) ezxml_free(ezxml_cut(xml))
162167
168+ #endif /*0*/
169+
163170#ifdef __cplusplus
164171}
165172#endif
0 commit comments