Blame bibutils/xml.h

Packit 89ede9
/*
Packit 89ede9
 * xml.h
Packit 89ede9
 *
Packit 89ede9
 * Copyright (c) Chris Putnam 2004-2018
Packit 89ede9
 *
Packit 89ede9
 * Source code released under the GPL version 2
Packit 89ede9
 *
Packit 89ede9
 */
Packit 89ede9
#ifndef XML_H
Packit 89ede9
#define XML_H
Packit 89ede9
Packit 89ede9
#include "slist.h"
Packit 89ede9
#include "str.h"
Packit 89ede9
Packit 89ede9
typedef struct xml {
Packit 89ede9
	str tag;
Packit 89ede9
	str value;
Packit 89ede9
	slist attributes;
Packit 89ede9
	slist attribute_values;
Packit 89ede9
	struct xml *down;
Packit 89ede9
	struct xml *next;
Packit 89ede9
} xml;
Packit 89ede9
Packit 89ede9
void   xml_init                 ( xml *node );
Packit 89ede9
void   xml_free                 ( xml *node );
Packit 89ede9
int    xml_has_value            ( xml *node );
Packit 89ede9
str *  xml_value                ( xml *node );
Packit 89ede9
char * xml_value_cstr           ( xml *node );
Packit 89ede9
str *  xml_tag                  ( xml *node );
Packit 89ede9
char * xml_tag_cstr             ( xml *node );
Packit 89ede9
int    xml_tag_matches          ( xml *node, const char *tag );
Packit 89ede9
int    xml_tag_matches_has_value( xml *node, const char *tag );
Packit 89ede9
str *  xml_attribute            ( xml *node, const char *attribute );
Packit 89ede9
char * xml_find_start           ( char *buffer, char *tag );
Packit 89ede9
char * xml_find_end             ( char *buffer, char *tag );
Packit 89ede9
int    xml_tag_has_attribute    ( xml *node, const char *tag, const char *attribute, const char *attribute_value );
Packit 89ede9
int    xml_has_attribute        ( xml *node, const char *attribute, const char *attribute_value );
Packit 89ede9
char * xml_parse                ( char *p, xml *onode );
Packit 89ede9
Packit 89ede9
extern char * xml_pns; /* global Namespace */
Packit 89ede9
Packit 89ede9
#endif
Packit 89ede9