remove rule for running bootstrap, it's only safe to run it manually now
[asterisk-bristuff.git] / mxml / mxml-private.c
blobd78484b082dfca8339ee4d199bb55100a2e7d94d
1 /*
2 * "$Id$"
4 * Private functions for Mini-XML, a small XML-like file parsing library.
6 * Copyright 2003-2005 by Michael Sweet.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * Contents:
20 * mxml_error() - Display an error message.
21 * mxml_integer_cb() - Default callback for integer values.
22 * mxml_opaque_cb() - Default callback for opaque values.
23 * mxml_real_cb() - Default callback for real number values.
27 * Include necessary headers...
30 #include "config.h"
31 #include "mxml.h"
35 * Error callback function...
38 void (*mxml_error_cb)(const char *) = NULL;
42 * 'mxml_error()' - Display an error message.
45 void
46 mxml_error(const char *format, /* I - Printf-style format string */
47 ...) /* I - Additional arguments as needed */
49 va_list ap; /* Pointer to arguments */
50 char *s; /* Message string */
54 * Range check input...
57 if (!format)
58 return;
61 * Format the error message string...
64 va_start(ap, format);
66 s = mxml_strdupf(format, ap);
68 va_end(ap);
71 * And then display the error message...
74 if (mxml_error_cb)
75 (*mxml_error_cb)(s);
76 else
77 fprintf(stderr, "mxml: %s\n", s);
80 * Free the string...
83 free(s);
88 * 'mxml_integer_cb()' - Default callback for integer values.
91 mxml_type_t /* O - Node type */
92 mxml_integer_cb(mxml_node_t *node) /* I - Current node */
94 (void)node;
96 return (MXML_INTEGER);
101 * 'mxml_opaque_cb()' - Default callback for opaque values.
104 mxml_type_t /* O - Node type */
105 mxml_opaque_cb(mxml_node_t *node) /* I - Current node */
107 (void)node;
109 return (MXML_OPAQUE);
114 * 'mxml_real_cb()' - Default callback for real number values.
117 mxml_type_t /* O - Node type */
118 mxml_real_cb(mxml_node_t *node) /* I - Current node */
120 (void)node;
122 return (MXML_REAL);
127 * End of "$Id$".