summaryrefslogtreecommitdiff
path: root/src/xml/xml.h
blob: 41d40069bd2695405ee026db234260ce9e834a10 (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
#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);

#endif