]> git.sesse.net Git - vlc/blob - include/vlc_vlm.h
Start cleaning up VLM + fixed vlm_New() race condition.
[vlc] / include / vlc_vlm.h
1 /*****************************************************************************
2  * vlc_vlm.h: VLM core structures
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Simon Latapie <garf@videolan.org>
8  *          Laurent Aimar <fenrir@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #if !defined( __LIBVLC__ )
26   #error You are not libvlc or one of its plugins. You cannot include this file
27 #endif
28
29 #ifndef _VLC_VLM_H
30 #define _VLC_VLM_H 1
31
32 #ifdef __cpluplus
33 extern "C" {
34 #endif
35
36 #include <vlc_input.h>
37
38 /* VLM specific - structures and functions */
39
40 /* ok, here is the structure of a vlm_message:
41    The parent node is ( name_of_the_command , NULL ), or
42    ( name_of_the_command , message_error ) on error.
43    If a node has children, it should not have a value (=NULL).*/
44 struct vlm_message_t
45 {
46     char *psz_name;
47     char *psz_value;
48
49     int           i_child;
50     vlm_message_t **child;
51 };
52
53
54 #define vlm_New( a ) __vlm_New( VLC_OBJECT(a) )
55 VLC_EXPORT( vlm_t *, __vlm_New, ( vlc_object_t * ) );
56 VLC_EXPORT( void,      vlm_Delete, ( vlm_t * ) );
57 VLC_EXPORT( int,       vlm_ExecuteCommand, ( vlm_t *, const char *, vlm_message_t ** ) );
58
59 VLC_EXPORT( vlm_message_t *, vlm_MessageNew, ( const char *, const char *, ... ) );
60 VLC_EXPORT( vlm_message_t *, vlm_MessageAdd, ( vlm_message_t *, vlm_message_t * ) );
61 VLC_EXPORT( void,            vlm_MessageDelete, ( vlm_message_t * ) );
62
63 #ifdef __cpluplus
64 }
65 #endif
66
67 #endif