File: lgl-xml.h

package info (click to toggle)
glabels 3.4.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,888 kB
  • sloc: ansic: 41,314; xml: 10,328; sh: 4,172; makefile: 834
file content (119 lines) | stat: -rw-r--r-- 3,913 bytes parent folder | download | duplicates (8)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 *  lgl-xml.h
 *  Copyright (C) 2003-2010  Jim Evins <evins@snaught.com>.
 *
 *  This file is part of libglabels.
 *
 *  libglabels is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  libglabels is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with libglabels.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __LGL_XML_H__
#define __LGL_XML_H__

#include <glib.h>
#include <libxml/tree.h>

#include "lgl-units.h"

#define LGL_XML_NAME_SPACE "http://glabels.org/xmlns/3.0/"

G_BEGIN_DECLS

/*
 * Get property functions
 */
gchar *  lgl_xml_get_prop_string   (xmlNodePtr    node,
                                    const gchar  *property,
                                    const gchar  *default_val);

gchar *  lgl_xml_get_prop_i18n_string (xmlNodePtr    node,
                                       const gchar  *property,
                                       const gchar  *default_val);

gdouble  lgl_xml_get_prop_double   (xmlNodePtr    node,
                                    const gchar  *property,
                                    gdouble       default_val);

gboolean lgl_xml_get_prop_boolean  (xmlNodePtr    node,
                                    const gchar  *property,
                                    gboolean      default_val);

gint     lgl_xml_get_prop_int      (xmlNodePtr    node,
                                    const gchar  *property,
                                    gint          default_val);

guint    lgl_xml_get_prop_uint     (xmlNodePtr    node,
                                    const gchar  *property,
                                    guint         default_val);

gdouble  lgl_xml_get_prop_length   (xmlNodePtr    node,
                                    const gchar  *property,
                                    gdouble       default_val);


/*
 * Set property functions
 */
void     lgl_xml_set_prop_string   (xmlNodePtr    node,
                                    const gchar  *property,
                                    const gchar  *val);

void     lgl_xml_set_prop_double   (xmlNodePtr    node,
                                    const gchar  *property,
                                    gdouble       val);

void     lgl_xml_set_prop_boolean  (xmlNodePtr    node,
                                    const gchar  *property,
                                    gboolean      val);

void     lgl_xml_set_prop_int      (xmlNodePtr    node,
                                    const gchar  *property,
                                    gint          val);

void     lgl_xml_set_prop_uint_hex (xmlNodePtr    node,
                                    const gchar  *property,
                                    guint         val);

void     lgl_xml_set_prop_length   (xmlNodePtr    node,
                                    const gchar  *property,
                                    gdouble       val);

/*
 * Other node functions
 */
gboolean lgl_xml_is_node           (xmlNodePtr    node,
                                    const gchar  *name);

gchar *  lgl_xml_get_node_content  (xmlNodePtr    node);

/*
 * Misc functions
 */
void     lgl_xml_set_default_units (lglUnits      units);

G_END_DECLS


#endif /* __LGL_XML_H__ */



/*
 * Local Variables:       -- emacs
 * mode: C                -- emacs
 * c-basic-offset: 8      -- emacs
 * tab-width: 8           -- emacs
 * indent-tabs-mode: nil  -- emacs
 * End:                   -- emacs
 */