./configure wasnt happy if gsf is present but no wv. Its happy now. pkg-check-modules...
[beagle.git] / libbeagle / beagle / beagle-parser.h
blobf16c7fb7bd436c326e9aa56520683ef3b78f9c85
1 /*
2 * beagle-parser.h
4 * Copyright (C) 2005 Novell, Inc.
6 */
8 /*
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
28 #ifndef __BEAGLE_PARSER_H
29 #define __BEAGLE_PARSER_H
31 #include <glib.h>
33 #include "beagle-response.h"
35 typedef struct _BeagleParserContext BeagleParserContext;
37 typedef void (*BeagleParserStartElementFunction) (BeagleParserContext *ctx, const char **attrs);
38 typedef void (*BeagleParserEndElementFunction) (BeagleParserContext *ctx);
41 typedef struct {
42 const char *name;
43 int src_state;
44 int dest_state;
45 BeagleParserStartElementFunction start_element_func;
46 BeagleParserEndElementFunction end_element_func;
47 } BeagleParserHandler;
50 BeagleParserContext *_beagle_parser_context_new (void);
52 BeagleResponse *_beagle_parser_context_get_request (BeagleParserContext *ctx);
53 char *_beagle_parser_context_get_text_buffer (BeagleParserContext *ctx);
55 void _beagle_parser_context_parse_chunk (BeagleParserContext *ctx,
56 const char *buf,
57 gsize byteS);
59 BeagleResponse *_beagle_parser_context_finished (BeagleParserContext *ctx);
61 extern int _beagle_parser_state_index;
63 #endif /* __BEAGLE_PARSER_H */