Initial revision
[melted] / mlt / src / valerie / valerie_parser.h
1 /*
2 * valerie_parser.h -- Valerie Parser for Miracle Server
3 * Copyright (C) 2002-2003 Ushodaya Enterprises Limited
4 * Author: Charles Yates <charles.yates@pandora.be>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef _VALERIE_PARSER_H_
22 #define _VALERIE_PARSER_H_
23
24 /* Application header files */
25 #include "valerie_response.h"
26 #include "valerie_notifier.h"
27
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32
33 /** Callbacks to define the parser.
34 */
35
36 typedef valerie_response (*parser_connect)( void * );
37 typedef valerie_response (*parser_execute)( void *, char * );
38 typedef void (*parser_close)( void * );
39
40 /** Structure for the valerie parser.
41 */
42
43 typedef struct
44 {
45 parser_connect connect;
46 parser_execute execute;
47 parser_close close;
48 void *real;
49 valerie_notifier notifier;
50 }
51 *valerie_parser, valerie_parser_t;
52
53 /** API for the parser - note that no constructor is defined here.
54 */
55
56 extern valerie_response valerie_parser_connect( valerie_parser );
57 extern valerie_response valerie_parser_execute( valerie_parser, char * );
58 extern valerie_response valerie_parser_executef( valerie_parser, char *, ... );
59 extern valerie_response valerie_parser_run( valerie_parser, char * );
60 extern valerie_notifier valerie_parser_get_notifier( valerie_parser );
61 extern void valerie_parser_close( valerie_parser );
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #endif