11#ifndef _GVM_UTIL_XMLUTILS_H
12#define _GVM_UTIL_XMLUTILS_H
17#include <gnutls/gnutls.h>
GnuTLS based functions for server communication - header file.
GSList * first
The very first entity.
GSList * current
The element currently being parsed.
gboolean done
Flag which is true when the first element is closed.
entities_t entities
Children.
GHashTable * attributes
Attributes.
Opaque data structure for XML file iterator.
Data for xml search functions.
GHashTable * find_attributes
void element_free(element_t element)
Free an entire element tree.
int read_entity_c(gvm_connection_t *connection, entity_t *entity)
Read an XML entity tree from the manager.
void xml_handle_start_element(context_data_t *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values)
Handle the start of an OMP XML element.
const char * entity_attribute(entity_t entity, const char *name)
Get an attribute of an entity.
int read_string(gnutls_session_t *session, GString **string)
Read entity and text. Free the entity immediately.
int read_string_c(gvm_connection_t *connection, GString **string)
Read entity and text. Free the entity immediately.
int find_element_in_xml_file(gchar *file_path, gchar *find_element, GHashTable *find_attributes)
Tests if an XML file contains an element with given attributes.
char * entity_name(entity_t entity)
Get the name an entity.
char * entity_text(entity_t entity)
Get the text an entity.
const gchar * element_name(element_t element)
Get the name of an element.
xml_file_iterator_t xml_file_iterator_new(void)
Allocates a new, uninitialized XML file iterator.
entity_t first_entity(entities_t entities)
Return the first entity from an entities_t.
gchar * element_text(element_t element)
Get text of an element.
int read_entity_and_string_c(gvm_connection_t *connection, entity_t *entity, GString **string_return)
Try read an XML entity tree from the manager.
int xml_file_iterator_init_from_file_path(xml_file_iterator_t iterator, const char *file_path, int output_depth)
Initializes an XML file iterator to read from a given path.
void print_element_to_string(element_t element, GString *string)
Print an XML element tree to a GString, appending it if string is not.
int read_entity(gnutls_session_t *session, entity_t *entity)
Read an XML entity tree from the manager.
int read_entity_and_string(gnutls_session_t *session, entity_t *entity, GString **string_return)
Try read an XML entity tree from the manager.
int xml_file_iterator_rewind(xml_file_iterator_t iterator)
Rewinds an XML file iterator by rewinding the file and creating a new XML parser context.
int try_read_entity(gnutls_session_t *session, int timeout, entity_t *entity)
Try read an XML entity tree from the manager.
entities_t next_entities(entities_t entities)
Return all the entities from an entities_t after the first.
gchar * element_attribute(element_t element, const gchar *name)
Get an attribute of an element.
element_t element_first_child(element_t element)
Get the first child of an element.
void print_entity_format(entity_t entity, gpointer indent)
Print an XML entity to stdout, recursively printing its children.
element_t xml_file_iterator_next(xml_file_iterator_t iterator, gchar **error)
Get the next subelement from a XML file iterator.
void free_entity(entity_t entity)
Free an entity, recursively.
void xml_file_iterator_free(xml_file_iterator_t iterator)
Frees an XML file iterator and all of its internal data structures.
int read_text_c(gvm_connection_t *connection, char **text)
Read text from the server.
int read_entity_and_text_c(gvm_connection_t *connection, entity_t *entity, char **text)
Read an XML entity tree from the manager.
int parse_element(const gchar *string, element_t *element)
Read an XML element tree from a string.
int read_entity_and_text(gnutls_session_t *session, entity_t *entity, char **text)
Read an XML entity tree from the manager.
int try_read_entity_and_string(gnutls_session_t *session, int timeout, entity_t *entity, GString **string_return)
Try read an XML entity tree from the manager.
entity_t add_entity(entities_t *entities, const char *name, const char *text)
Add an XML entity to a tree of entities.
int xml_count_entities(entities_t entities)
Count the number of entities.
entity_t entity_child(entity_t entity, const char *name)
Get a child of an entity.
void xml_handle_end_element(context_data_t *context, const gchar *element_name)
Handle the end of an XML element.
element_t element_next(element_t element)
Get the next sibling of an element.
gchar * element_to_string(element_t element)
Output the XML element as a string.
element_t element_child(element_t element, const gchar *name)
Get a child of an element.
int parse_entity(const char *string, entity_t *entity)
Read an XML entity tree from a string.
int compare_entities(entity_t entity1, entity_t entity2)
Compare two XML entity.
int try_read_entity_c(gvm_connection_t *connection, int timeout, entity_t *entity)
Try read an XML entity tree from the manager.
int read_entity_s(int socket, entity_t *entity)
Read an XML entity tree from the socket.
void print_entity(FILE *stream, entity_t entity)
Print an XML entity.
void xml_handle_text(context_data_t *context, const gchar *text, gsize text_len)
Handle additional text of an XML element.
void xml_string_append(GString *xml, const char *format,...)
Append formatted escaped XML to a string.
void print_entity_to_string(entity_t entity, GString *string)
Print an XML entity tree to a GString, appending it if string is not.
struct entity_s * entity_t
struct xml_file_iterator_struct * xml_file_iterator_t
struct _xmlNode * element_t
GSList * entities_t
Entities.