Signal cleanups.
[pwmd.git] / src / xml.h
blob56300b279e16cc1db86af3a9aafdecd0734f3250
1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
2 /*
3 Copyright (C) 2006-2007 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef XML_H
20 #define XML_H
22 #include <libxml/tree.h>
23 #include <libxml/parser.h>
25 #include "gettext.h"
26 #define N_(msgid) gettext(msgid)
28 gint max_recursion_depth;
29 gboolean is_list_command;
31 gpg_error_t new_account(xmlDocPtr doc, gchar *name);
32 xmlChar *new_document(void);
33 gpg_error_t list_accounts(xmlDocPtr doc, GString **);
34 gboolean valid_xml_element(xmlChar *element);
35 gchar **split_input_line(gchar *str, gchar *delim, gint n);
36 xmlNodePtr find_elements(xmlDocPtr doc, xmlNodePtr node,
37 gchar **req, gpg_error_t *error, gboolean *target,
38 xmlNodePtr (*found_fn)(xmlNodePtr, gchar **, gpg_error_t *, void *),
39 xmlNodePtr (*not_found_fn)(xmlNodePtr, gchar **, gpg_error_t *, void *),
40 void *data);
41 xmlNodePtr find_element(xmlNodePtr node, gchar *element);
42 xmlNodePtr find_account(xmlDocPtr doc, gchar ***req, gpg_error_t *error, gboolean *target);
43 xmlNodePtr create_elements_cb(xmlNodePtr node, gchar **elements,
44 gpg_error_t *error, void *data);
45 xmlNodePtr create_target_elements_cb(xmlNodePtr node, gchar **elements,
46 gpg_error_t *error, void *data);
47 gboolean is_literal_element(gchar **element);
48 gboolean is_literal_element_str(gchar *element);
49 xmlChar *node_has_attribute(xmlNodePtr n, xmlChar *attr);
50 gboolean node_has_child_element(xmlNodePtr node);
51 gint sort_element_list(gconstpointer a, gconstpointer b);
53 #endif