1 /** **************************************************************************
4 * Copyright 2008 Bryan Ischo <bryan@ischo.com>
6 * This file is part of libs3.
8 * libs3 is free software: you can redistribute it and/or modify it under the
9 * terms of the GNU General Public License as published by the Free Software
10 * Foundation, version 3 of the License.
12 * In addition, as a special exception, the copyright holders give
13 * permission to link the code of this library and its programs with the
14 * OpenSSL library, and distribute linked combinations including the two.
16 * libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
17 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 * You should have received a copy of the GNU General Public License version 3
22 * along with libs3, in a file named COPYING. If not, see
23 * <http://www.gnu.org/licenses/>.
25 ************************************************************************** **/
33 // Simple XML callback.
35 // elementPath: is the full "path" of the element; i.e.
36 // <foo><bar><baz>data</baz></bar></foo> would have 'data' in the element
39 // Return of anything other than S3StatusOK causes the calling
40 // simplexml_add() function to immediately stop and return the status.
42 // data is passed in as 0 on end of element
43 typedef S3Status (SimpleXmlCallback)(const char *elementPath, const char *data,
44 int dataLen, void *callbackData);
46 typedef struct SimpleXml
50 SimpleXmlCallback *callback;
54 char elementPath[512];
63 // ----------------------------------------------------------------------------
65 // Always call this, even if the simplexml doesn't end up being used
66 void simplexml_initialize(SimpleXml *simpleXml, SimpleXmlCallback *callback,
69 S3Status simplexml_add(SimpleXml *simpleXml, const char *data, int dataLen);
73 void simplexml_deinitialize(SimpleXml *simpleXml);
76 #endif /* SIMPLEXML_H */