67d2bba1a0ed0ff7a034a7359296f55f985517b5
[melted] / src / mvcp / mvcp_parser.h
1 /*
2 * mvcp_parser.h -- MVCP Parser for Melted
3 * Copyright (C) 2002-2009 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 _MVCP_PARSER_H_
22 #define _MVCP_PARSER_H_
23
24 /* MLT Header files */
25 #include <framework/mlt.h>
26
27 /* Application header files */
28 #include "mvcp_response.h"
29 #include "mvcp_notifier.h"
30
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #endif
35
36 /** Callbacks to define the parser.
37 */
38
39 typedef mvcp_response (*parser_connect)( void * );
40 typedef mvcp_response (*parser_execute)( void *, char * );
41 typedef mvcp_response (*parser_received)( void *, char *, char * );
42 typedef mvcp_response (*parser_push)( void *, char *, mlt_service );
43 typedef void (*parser_close)( void * );
44
45 /** Structure for the mvcp parser.
46 */
47
48 typedef struct
49 {
50 parser_connect connect;
51 parser_execute execute;
52 parser_push push;
53 parser_received received;
54 parser_close close;
55 void *real;
56 mvcp_notifier notifier;
57 }
58 *mvcp_parser, mvcp_parser_t;
59
60 /** API for the parser - note that no constructor is defined here.
61 */
62
63 extern mvcp_response mvcp_parser_connect( mvcp_parser );
64 extern mvcp_response mvcp_parser_push( mvcp_parser, char *, mlt_service );
65 extern mvcp_response mvcp_parser_received( mvcp_parser, char *, char * );
66 extern mvcp_response mvcp_parser_execute( mvcp_parser, char * );
67 extern mvcp_response mvcp_parser_executef( mvcp_parser, const char *, ... );
68 extern mvcp_response mvcp_parser_run_file( mvcp_parser parser, FILE *file );
69 extern mvcp_response mvcp_parser_run( mvcp_parser, char * );
70 extern mvcp_notifier mvcp_parser_get_notifier( mvcp_parser );
71 extern void mvcp_parser_close( mvcp_parser );
72
73 #ifdef __cplusplus
74 }
75 #endif
76
77 #endif