]> git.sesse.net Git - vlc/blob - include/modules_export.h
* Applied patch from Jon Lech Johansen <jon-vl@nanocrew.net> to compile
[vlc] / include / modules_export.h
1 /*****************************************************************************
2  * modules_export.h: macros for exporting vlc symbols to plugins
3  *****************************************************************************
4  * Copyright (C) 2001 VideoLAN
5  *
6  * Authors: Samuel Hocevar <sam@zoy.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22
23 typedef struct module_symbols_s
24 {
25     struct main_s* p_main;
26     struct aout_bank_s* p_aout_bank;
27     struct vout_bank_s* p_vout_bank;
28
29     int    ( * main_GetIntVariable ) ( char *, int );
30     char * ( * main_GetPszVariable ) ( char *, char * );
31     void   ( * main_PutIntVariable ) ( char *, int );
32     void   ( * main_PutPszVariable ) ( char *, char * );
33
34     int  ( * TestProgram )  ( char * );
35     int  ( * TestMethod )   ( char *, char * );
36     int  ( * TestCPU )      ( int );
37
38     int  ( * intf_ProcessKey ) ( struct intf_thread_s *, int );
39     void ( * intf_AssignKey )  ( struct intf_thread_s *, int, int, int );
40
41     void ( * intf_Msg )     ( char *, ... );
42     void ( * intf_ErrMsg )  ( char *, ... );
43     void ( * intf_WarnMsg ) ( int, char *, ... );
44
45     int  ( * intf_PlaylistAdd )     ( struct playlist_s *, int, const char* );
46     int  ( * intf_PlaylistDelete )  ( struct playlist_s *, int );
47     void ( * intf_PlaylistNext )    ( struct playlist_s * );
48     void ( * intf_PlaylistPrev )    ( struct playlist_s * );
49     void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
50     void ( * intf_PlaylistJumpto )  ( struct playlist_s *, int );
51     void ( * intf_UrlDecode )       ( char * );
52
53     void    ( * msleep )         ( mtime_t );
54     mtime_t ( * mdate )          ( void );
55
56     int  ( * network_ChannelCreate )( void );
57     int  ( * network_ChannelJoin )  ( int );
58
59     void ( * input_SetStatus )      ( struct input_thread_s *, int );
60     void ( * input_SetRate )        ( struct input_thread_s *, int );
61     void ( * input_Seek )           ( struct input_thread_s *, off_t );
62     void ( * input_DumpStream )     ( struct input_thread_s * );
63     char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
64     int  ( * input_ChangeES )       ( struct input_thread_s *,
65                                       struct es_descriptor_s *, u8 );
66     int  ( * input_ToggleES )       ( struct input_thread_s *,
67                                       struct es_descriptor_s *, boolean_t );
68     int  ( * input_ChangeArea )     ( struct input_thread_s *,
69                                       struct input_area_s * );
70
71 } module_symbols_t;
72
73 #define STORE_SYMBOLS( p_symbols ) \
74     (p_symbols)->p_main = p_main; \
75     (p_symbols)->p_aout_bank = p_aout_bank; \
76     (p_symbols)->p_vout_bank = p_vout_bank; \
77     (p_symbols)->main_GetIntVariable = main_GetIntVariable; \
78     (p_symbols)->main_GetPszVariable = main_GetPszVariable; \
79     (p_symbols)->main_PutIntVariable = main_PutIntVariable; \
80     (p_symbols)->main_PutPszVariable = main_PutPszVariable; \
81     (p_symbols)->TestProgram = TestProgram; \
82     (p_symbols)->TestMethod = TestMethod; \
83     (p_symbols)->TestCPU = TestCPU; \
84     (p_symbols)->intf_AssignKey = intf_AssignKey; \
85     (p_symbols)->intf_ProcessKey = intf_ProcessKey; \
86     (p_symbols)->intf_Msg = intf_Msg; \
87     (p_symbols)->intf_ErrMsg = intf_ErrMsg; \
88     (p_symbols)->intf_WarnMsg = intf_WarnMsg; \
89     (p_symbols)->intf_PlaylistAdd = intf_PlaylistAdd; \
90     (p_symbols)->intf_PlaylistDelete = intf_PlaylistDelete; \
91     (p_symbols)->intf_PlaylistNext = intf_PlaylistNext; \
92     (p_symbols)->intf_PlaylistPrev = intf_PlaylistPrev; \
93     (p_symbols)->intf_PlaylistDestroy = intf_PlaylistDestroy; \
94     (p_symbols)->intf_PlaylistJumpto = intf_PlaylistJumpto; \
95     (p_symbols)->intf_UrlDecode = intf_UrlDecode; \
96     (p_symbols)->msleep = msleep; \
97     (p_symbols)->mdate = mdate; \
98     (p_symbols)->network_ChannelCreate = network_ChannelCreate; \
99     (p_symbols)->network_ChannelJoin = network_ChannelJoin; \
100     (p_symbols)->input_SetStatus = input_SetStatus; \
101     (p_symbols)->input_SetRate = input_SetRate; \
102     (p_symbols)->input_Seek = input_Seek; \
103     (p_symbols)->input_DumpStream = input_DumpStream; \
104     (p_symbols)->input_OffsetToTime = input_OffsetToTime; \
105     (p_symbols)->input_ChangeES = input_ChangeES; \
106     (p_symbols)->input_ToggleES = input_ToggleES; \
107     (p_symbols)->input_ChangeArea = input_ChangeArea;
108     
109 #ifdef PLUGIN
110 extern module_symbols_t* p_symbols;
111
112 #   define p_main (p_symbols->p_main)
113 #   define p_aout_bank (p_symbols->p_aout_bank)
114 #   define p_vout_bank (p_symbols->p_vout_bank)
115
116 #   define main_GetIntVariable(a,b) p_symbols->main_GetIntVariable(a,b)
117 #   define main_PutIntVariable(a,b) p_symbols->main_PutIntVariable(a,b)
118 #   define main_GetPszVariable(a,b) p_symbols->main_GetPszVariable(a,b)
119 #   define main_PutPszVariable(a,b) p_symbols->main_PutPszVariable(a,b)
120
121 #   define TestProgram(a) p_symbols->TestProgram(a)
122 #   define TestMethod(a,b) p_symbols->TestMethod(a,b)
123 #   define TestCPU(a,b) p_symbols->TestCPU(a)
124
125 #   define intf_AssignKey(a,b,c,d) p_symbols->intf_AssignKey(a,b,c,d)
126 #   define intf_ProcessKey(a,b) p_symbols->intf_ProcessKey(a,b)
127
128 #   define intf_Msg(a,b...) p_symbols->intf_Msg(a, ## b)
129 #   define intf_ErrMsg(a,b...) p_symbols->intf_ErrMsg(a, ## b)
130 #   define intf_WarnMsg(a,b,c...) p_symbols->intf_WarnMsg(a,b, ## c)
131
132 #   define intf_PlaylistAdd(a,b,c) p_symbols->intf_PlaylistAdd(a,b,c)
133 #   define intf_PlaylistDelete(a,b) p_symbols->intf_PlaylistDelete(a,b)
134 #   define intf_PlaylistNext(a) p_symbols->intf_PlaylistNext(a)
135 #   define intf_PlaylistPrev(a) p_symbols->intf_PlaylistPrev(a)
136 #   define intf_PlaylistDestroy(a) p_symbols->intf_PlaylistDestroy(a)
137 #   define intf_PlaylistJumpto(a,b) p_symbols->intf_PlaylistJumpto(a,b)
138 #   define intf_UrlDecode(a) p_symbols->intf_UrlDecode(a)
139
140 #   define msleep(a) p_symbols->msleep(a)
141 #   define mdate() p_symbols->mdate()
142
143 #   define network_ChannelCreate() p_symbols->network_ChannelCreate()
144 #   define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
145
146 #   define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
147 #   define input_SetRate(a,b) p_symbols->input_SetRate(a,b)
148 #   define input_Seek(a,b) p_symbols->input_Seek(a,b)
149 #   define input_DumpStream(a) p_symbols->input_DumpStream(a)
150 #   define input_OffsetToTime(a,b,c) p_symbols->input_OffsetToTime(a,b,c)
151 #   define input_ChangeES(a,b,c) p_symbols->input_ChangeES(a,b,c)
152 #   define input_ToggleES(a,b,c) p_symbols->input_ToggleES(a,b,c)
153 #   define input_ChangeArea(a,b) p_symbols->input_ChangeArea(a,b)
154
155 #endif
156