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