3e1a17b75247296bc56e281787bbcb4f18248376
[melted] / 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 /* MLT Header files */
25 #include <framework/mlt.h>
26
27 /* Application header files */
28 #include "valerie_response.h"
29 #include "valerie_notifier.h"
30
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #endif
35
36 /** Callbacks to define the parser.
37 */
38
39 typedef valerie_response (*parser_connect)( void * );
40 typedef valerie_response (*parser_execute)( void *, char * );
41 typedef valerie_response (*parser_push)( void *, char *, mlt_service );
42 typedef void (*parser_close)( void * );
43
44 /** Structure for the valerie parser.
45 */
46
47 typedef struct
48 {
49 parser_connect connect;
50 parser_execute execute;
51 parser_push push;
52 parser_close close;
53 void *real;
54 valerie_notifier notifier;
55 }
56 *valerie_parser, valerie_parser_t;
57
58 /** API for the parser - note that no constructor is defined here.
59 */
60
61 extern valerie_response valerie_parser_connect( valerie_parser );
62 extern valerie_response valerie_parser_push( valerie_parser, char *, mlt_service );
63 extern valerie_response valerie_parser_execute( valerie_parser, char * );
64 extern valerie_response valerie_parser_executef( valerie_parser, char *, ... );
65 extern valerie_response valerie_parser_run( valerie_parser, char * );
66 extern valerie_notifier valerie_parser_get_notifier( valerie_parser );
67 extern void valerie_parser_close( valerie_parser );
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif