2 * mvcp_parser.h -- MVCP Parser for Melted
3 * Copyright (C) 2002-2009 Ushodaya Enterprises Limited
4 * Author: Charles Yates <charles.yates@pandora.be>
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.
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.
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
21 #ifndef _MVCP_PARSER_H_
22 #define _MVCP_PARSER_H_
24 /* MLT Header files */
26 #include <framework/mlt.h>
28 #define mlt_service void *
31 /* Application header files */
32 #include "mvcp_response.h"
33 #include "mvcp_notifier.h"
40 /** Callbacks to define the parser.
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 * );
49 /** Structure for the mvcp parser.
54 parser_connect connect
;
55 parser_execute execute
;
57 parser_received received
;
60 mvcp_notifier notifier
;
62 *mvcp_parser
, mvcp_parser_t
;
64 /** API for the parser - note that no constructor is defined here.
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
);