2
* Copyright 2006-2008 Ondrej Jirman <ondrej.jirman@zonio.net>
4
* This file is part of libxr.
6
* Libxr is free software: you can redistribute it and/or modify it under the
7
* terms of the GNU Lesser General Public License as published by the Free
8
* Software Foundation, either version 2 of the License, or (at your option) any
11
* Libxr is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with libxr. If not, see <http://www.gnu.org/licenses/>.
19
* Author: David Lee <live4thee@gmail.com> (2007-12-27)
20
* Small cleanups by Ondrej Jirman <ondrej.jirman@zonio.net>.
23
/** @file xr-value-utils.h
25
* xr_value parser/builder.
27
* API which accepts a subset of xmlrpc-c format string. c.f.
28
* http://xmlrpc-c.sourceforge.net/doc/libxmlrpc.html#formatstring
30
* Supported specifiers:
37
* ( -- begin of an array
38
* ) -- end of an array
39
* { -- begin of a struct
40
* } -- end of a struct
41
* : -- key-value pair separator in a struct
42
* , -- separator for members of a struct
43
* * -- tagging the end of a struct, or ingore rest items of an array
46
#ifndef __XR_VALUE_UTILS_H__
47
#define __XR_VALUE_UTILS_H__
53
/** Build a value node from format string.
55
* @param fmt The format string.
57
* @return A NULL pointer indicates a failure.
59
xr_value* xr_value_build(const char* fmt, ...);
61
/** Parse a value node using format string.
63
* @param value The node to be parsed.
64
* @param fmt The format string.
66
* @return TRUE on success, FALSE on failure.
68
gboolean xr_value_parse(xr_value* value, const char* fmt, ...);