blob: 4849ced11422344dbb96f63fbdc3ed765208510f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#ifndef KALMIA_XML_H
#define KALMIA_XML_H
#define YYLTYPE KALMIALTYPE
#define YYSTYPE KALMIASTYPE
#include "xml/kalmia.tab.h"
#include "xml/kalmia.lex.h"
struct kai_tag_t * kai_parse_string(const char *str);
/* return pointer to the attribute's value string, or NULL if it
* isn't present
*/
char * kai_tag_get_attr(struct kai_tag_t *t, const char *attr);
/* find an attribute and convert to long.
* if not found, return "base" instead.
*/
long kai_tag_attr_to_long(
struct kai_tag_t *t, const char *attr, long base);
/* find an attribute and return a duplicate of the value string, or NULL
* if not found.
*/
char *kai_tag_attr_to_dup(struct kai_tag_t *t, const char *attr);
/* return the number of immediate children of a node */
int kai_tag_num_children(struct kai_tag_t *t);
/* get the first child of type "type", or NULL if no such child exists */
struct kai_tag_t * kai_tag_get_first_child_with_type(struct kai_tag_t *t, char *type);
/* get the next sibling of type "type", or NULL if no such sibling exists */
struct kai_tag_t * kai_tag_get_next_sibling_with_type(struct kai_tag_t *t, char *type);
#endif
|