ezxml.h File Reference

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <fcntl.h>

Go to the source code of this file.


struct  ezxml


#define EZXML_BUFSIZE   1024
#define EZXML_NAMEM   0x80
#define EZXML_TXTM   0x40
#define EZXML_DUP   0x20
#define ezxml_next(xml)   ((xml) ? xml->next : NULL)
#define ezxml_name(xml)   ((xml) ? xml->name : NULL)
#define ezxml_txt(xml)   ((xml) ? xml->txt : "")
#define ezxml_new_d(name)   ezxml_set_flag(ezxml_new(strdup(name)), EZXML_NAMEM)
#define ezxml_add_child_d(xml, name, off)   ezxml_set_flag(ezxml_add_child(xml, strdup(name), off), EZXML_NAMEM)
#define ezxml_set_txt_d(xml, txt)   ezxml_set_flag(ezxml_set_txt(xml, strdup(txt)), EZXML_TXTM)
#define ezxml_set_attr_d(xml, name, value)   ezxml_set_attr(ezxml_set_flag(xml, EZXML_DUP), strdup(name), strdup(value))
#define ezxml_move(xml, dest, off)   ezxml_insert(ezxml_cut(xml), dest, off)
#define ezxml_remove(xml)   ezxml_free(ezxml_cut(xml))


typedef struct ezxmlezxml_t


ezxml_t ezxml_parse_str (char *s, size_t len)
ezxml_t ezxml_parse_fd (int fd)
ezxml_t ezxml_parse_file (const char *file)
ezxml_t ezxml_parse_fp (FILE *fp)
ezxml_t ezxml_child (ezxml_t xml, const char *name)
ezxml_t ezxml_idx (ezxml_t xml, int idx)
const char * ezxml_attr (ezxml_t xml, const char *attr)
ezxml_t ezxml_get (ezxml_t xml,...)
char * ezxml_toxml (ezxml_t xml)
const char ** ezxml_pi (ezxml_t xml, const char *target)
void ezxml_free (ezxml_t xml)
const char * ezxml_error (ezxml_t xml)
ezxml_t ezxml_new (const char *name)
ezxml_t ezxml_add_child (ezxml_t xml, const char *name, size_t off)
ezxml_t ezxml_set_txt (ezxml_t xml, const char *txt)
ezxml_t ezxml_set_attr (ezxml_t xml, const char *name, const char *value)
ezxml_t ezxml_set_flag (ezxml_t xml, short flag)
ezxml_t ezxml_cut (ezxml_t xml)
ezxml_t ezxml_insert (ezxml_t xml, ezxml_t dest, size_t off)

Define Documentation

#define ezxml_add_child_d ( xml,
off   )     ezxml_set_flag(ezxml_add_child(xml, strdup(name), off), EZXML_NAMEM)

Definition at line 129 of file ezxml.h.

#define EZXML_BUFSIZE   1024

Definition at line 37 of file ezxml.h.

#define EZXML_DUP   0x20

Definition at line 40 of file ezxml.h.

#define ezxml_move ( xml,
off   )     ezxml_insert(ezxml_cut(xml), dest, off)

Definition at line 158 of file ezxml.h.

#define ezxml_name ( xml   )     ((xml) ? xml->name : NULL)

Definition at line 88 of file ezxml.h.

#define EZXML_NAMEM   0x80

Definition at line 38 of file ezxml.h.

#define ezxml_new_d ( name   )     ezxml_set_flag(ezxml_new(strdup(name)), EZXML_NAMEM)

Definition at line 122 of file ezxml.h.

#define ezxml_next ( xml   )     ((xml) ? xml->next : NULL)

Definition at line 81 of file ezxml.h.

#define ezxml_remove ( xml   )     ezxml_free(ezxml_cut(xml))

Definition at line 161 of file ezxml.h.

#define ezxml_set_attr_d ( xml,
value   )     ezxml_set_attr(ezxml_set_flag(xml, EZXML_DUP), strdup(name), strdup(value))

Definition at line 144 of file ezxml.h.

#define ezxml_set_txt_d ( xml,
txt   )     ezxml_set_flag(ezxml_set_txt(xml, strdup(txt)), EZXML_TXTM)

Definition at line 136 of file ezxml.h.

#define ezxml_txt ( xml   )     ((xml) ? xml->txt : "")

Definition at line 91 of file ezxml.h.

#define EZXML_TXTM   0x40

Definition at line 39 of file ezxml.h.

Typedef Documentation

typedef struct ezxml* ezxml_t

Definition at line 42 of file ezxml.h.

Function Documentation

ezxml_t ezxml_add_child ( ezxml_t  xml,
const char *  name,
size_t  off 
const char* ezxml_attr ( ezxml_t  xml,
const char *  attr 
ezxml_t ezxml_child ( ezxml_t  xml,
const char *  name 
ezxml_t ezxml_cut ( ezxml_t  xml  ) 
const char* ezxml_error ( ezxml_t  xml  ) 
void ezxml_free ( ezxml_t  xml  ) 
ezxml_t ezxml_get ( ezxml_t  xml,
ezxml_t ezxml_idx ( ezxml_t  xml,
int  idx 
ezxml_t ezxml_insert ( ezxml_t  xml,
ezxml_t  dest,
size_t  off 
ezxml_t ezxml_new ( const char *  name  ) 
ezxml_t ezxml_parse_fd ( int  fd  ) 
ezxml_t ezxml_parse_file ( const char *  file  ) 
ezxml_t ezxml_parse_fp ( FILE *  fp  ) 
ezxml_t ezxml_parse_str ( char *  s,
size_t  len 
const char** ezxml_pi ( ezxml_t  xml,
const char *  target 
ezxml_t ezxml_set_attr ( ezxml_t  xml,
const char *  name,
const char *  value 
ezxml_t ezxml_set_flag ( ezxml_t  xml,
short  flag 
ezxml_t ezxml_set_txt ( ezxml_t  xml,
const char *  txt 
char* ezxml_toxml ( ezxml_t  xml  ) 
© 2004-2010 bbv Software Services AG / Apparatus Services