]> git.sesse.net Git - vlc/blob - include/modules_export.h
293d700627ddf695550bba398754f2445c71584b
[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     void ( * intf_WarnMsgImm ) ( int, char *, ... );
45 #ifdef TRACE
46     void ( * intf_DbgMsg )     ( char *, char *, int, char *, ... );
47     void ( * intf_DbgMsgImm )  ( char *, char *, int, char *, ... );
48 #endif
49
50     int  ( * intf_PlaylistAdd )     ( struct playlist_s *, int, const char* );
51     int  ( * intf_PlaylistDelete )  ( struct playlist_s *, int );
52     void ( * intf_PlaylistNext )    ( struct playlist_s * );
53     void ( * intf_PlaylistPrev )    ( struct playlist_s * );
54     void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
55     void ( * intf_PlaylistJumpto )  ( struct playlist_s *, int );
56     void ( * intf_UrlDecode )       ( char * );
57
58     void    ( * msleep )         ( mtime_t );
59     mtime_t ( * mdate )          ( void );
60
61     int  ( * network_ChannelCreate )( void );
62     int  ( * network_ChannelJoin )  ( int );
63
64     void ( * input_SetStatus )      ( struct input_thread_s *, int );
65     void ( * input_Seek )           ( struct input_thread_s *, off_t );
66     void ( * input_DumpStream )     ( struct input_thread_s * );
67     char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
68     int  ( * input_ChangeES )       ( struct input_thread_s *,
69                                       struct es_descriptor_s *, u8 );
70     int  ( * input_ToggleES )       ( struct input_thread_s *,
71                                       struct es_descriptor_s *, boolean_t );
72     int  ( * input_ChangeArea )     ( struct input_thread_s *,
73                                       struct input_area_s * );
74     struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
75                                                   u16 );
76     struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
77                                       struct pgrm_descriptor_s *, u16, size_t );
78     void ( * input_DelES )          ( struct input_thread_s *,
79                                       struct es_descriptor_s * );
80     int  ( * input_SelectES )       ( struct input_thread_s *,
81                                       struct es_descriptor_s * );
82     int  ( * input_UnselectES )     ( struct input_thread_s *,
83                                       struct es_descriptor_s * );
84     struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
85                                                        u16, size_t );
86     void ( * input_DelProgram )     ( struct input_thread_s *,
87                                       struct pgrm_descriptor_s * );
88     struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
89     void ( * input_DelArea )        ( struct input_thread_s *,
90                                       struct input_area_s * );
91
92     int  ( * input_InitStream )     ( struct input_thread_s *, size_t );
93     void ( * input_EndStream )      ( struct input_thread_s * );
94
95     void ( * input_ParsePES )       ( struct input_thread_s *,
96                                       struct es_descriptor_s * );
97     void ( * input_GatherPES )      ( struct input_thread_s *,
98                                       struct data_packet_s *,
99                                       struct es_descriptor_s *,
100                                       boolean_t, boolean_t );
101     struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
102                                                    struct data_packet_s * );
103     void ( * input_DemuxPS )        ( struct input_thread_s *,
104                                       struct data_packet_s * );
105     void ( * input_DemuxTS )        ( struct input_thread_s *,
106                                       struct data_packet_s * );
107     void ( * input_DemuxPSI )       ( struct input_thread_s *,
108                                       struct data_packet_s *,
109                                       struct es_descriptor_s *, 
110                                       boolean_t, boolean_t );
111
112     int ( * input_NetlistInit )          ( struct input_thread_s *,
113                                            int, int, size_t, int );
114     struct iovec * ( * input_NetlistGetiovec ) ( void * p_method_data );
115     void ( * input_NetlistMviovec )      ( void * , size_t,
116                                            struct data_packet_s **);
117     struct data_packet_s * ( * input_NetlistNewPacket ) ( void *, size_t );
118     struct pes_packet_s * ( * input_NetlistNewPES ) ( void * );
119     void ( * input_NetlistDeletePacket ) ( void *, struct data_packet_s * );
120     void ( * input_NetlistDeletePES )    ( void *, struct pes_packet_s * );
121     void ( * input_NetlistEnd )          ( struct input_thread_s * );
122
123 } module_symbols_t;
124
125 #define STORE_SYMBOLS( p_symbols ) \
126     (p_symbols)->p_main = p_main; \
127     (p_symbols)->p_aout_bank = p_aout_bank; \
128     (p_symbols)->p_vout_bank = p_vout_bank; \
129     (p_symbols)->main_GetIntVariable = main_GetIntVariable; \
130     (p_symbols)->main_GetPszVariable = main_GetPszVariable; \
131     (p_symbols)->main_PutIntVariable = main_PutIntVariable; \
132     (p_symbols)->main_PutPszVariable = main_PutPszVariable; \
133     (p_symbols)->TestProgram = TestProgram; \
134     (p_symbols)->TestMethod = TestMethod; \
135     (p_symbols)->TestCPU = TestCPU; \
136     (p_symbols)->intf_AssignKey = intf_AssignKey; \
137     (p_symbols)->intf_ProcessKey = intf_ProcessKey; \
138     (p_symbols)->intf_Msg = intf_Msg; \
139     (p_symbols)->intf_ErrMsg = intf_ErrMsg; \
140     (p_symbols)->intf_WarnMsg = intf_WarnMsg; \
141     (p_symbols)->intf_WarnMsgImm = intf_WarnMsgImm; \
142     (p_symbols)->intf_PlaylistAdd = intf_PlaylistAdd; \
143     (p_symbols)->intf_PlaylistDelete = intf_PlaylistDelete; \
144     (p_symbols)->intf_PlaylistNext = intf_PlaylistNext; \
145     (p_symbols)->intf_PlaylistPrev = intf_PlaylistPrev; \
146     (p_symbols)->intf_PlaylistDestroy = intf_PlaylistDestroy; \
147     (p_symbols)->intf_PlaylistJumpto = intf_PlaylistJumpto; \
148     (p_symbols)->intf_UrlDecode = intf_UrlDecode; \
149     (p_symbols)->msleep = msleep; \
150     (p_symbols)->mdate = mdate; \
151     (p_symbols)->network_ChannelCreate = network_ChannelCreate; \
152     (p_symbols)->network_ChannelJoin = network_ChannelJoin; \
153     (p_symbols)->input_SetStatus = input_SetStatus; \
154     (p_symbols)->input_Seek = input_Seek; \
155     (p_symbols)->input_DumpStream = input_DumpStream; \
156     (p_symbols)->input_OffsetToTime = input_OffsetToTime; \
157     (p_symbols)->input_ChangeES = input_ChangeES; \
158     (p_symbols)->input_ToggleES = input_ToggleES; \
159     (p_symbols)->input_ChangeArea = input_ChangeArea; \
160     (p_symbols)->input_FindES = input_FindES; \
161     (p_symbols)->input_AddES = input_AddES; \
162     (p_symbols)->input_DelES = input_DelES; \
163     (p_symbols)->input_SelectES = input_SelectES; \
164     (p_symbols)->input_UnselectES = input_UnselectES; \
165     (p_symbols)->input_AddProgram = input_AddProgram; \
166     (p_symbols)->input_DelProgram = input_DelProgram; \
167     (p_symbols)->input_AddArea = input_AddArea; \
168     (p_symbols)->input_DelArea = input_DelArea; \
169     (p_symbols)->input_InitStream = input_InitStream; \
170     (p_symbols)->input_EndStream = input_EndStream; \
171     (p_symbols)->input_ParsePES = input_ParsePES; \
172     (p_symbols)->input_GatherPES = input_GatherPES; \
173     (p_symbols)->input_ParsePS = input_ParsePS; \
174     (p_symbols)->input_DemuxPS = input_DemuxPS; \
175     (p_symbols)->input_DemuxTS = input_DemuxTS; \
176     (p_symbols)->input_DemuxPSI = input_DemuxPSI; \
177     (p_symbols)->input_NetlistInit = input_NetlistInit; \
178     (p_symbols)->input_NetlistGetiovec = input_NetlistGetiovec; \
179     (p_symbols)->input_NetlistMviovec = input_NetlistMviovec; \
180     (p_symbols)->input_NetlistNewPacket = input_NetlistNewPacket; \
181     (p_symbols)->input_NetlistNewPES = input_NetlistNewPES; \
182     (p_symbols)->input_NetlistDeletePacket = input_NetlistDeletePacket; \
183     (p_symbols)->input_NetlistDeletePES = input_NetlistDeletePES; \
184     (p_symbols)->input_NetlistEnd = input_NetlistEnd;
185     
186 #define STORE_TRACE_SYMBOLS( p_symbols ) \
187     (p_symbols)->intf_DbgMsg = _intf_DbgMsg; \
188     (p_symbols)->intf_DbgMsgImm = _intf_DbgMsgImm;
189
190 #ifdef PLUGIN
191 extern module_symbols_t* p_symbols;
192
193 #   define p_main (p_symbols->p_main)
194 #   define p_aout_bank (p_symbols->p_aout_bank)
195 #   define p_vout_bank (p_symbols->p_vout_bank)
196
197 #   define main_GetIntVariable(a,b) p_symbols->main_GetIntVariable(a,b)
198 #   define main_PutIntVariable(a,b) p_symbols->main_PutIntVariable(a,b)
199 #   define main_GetPszVariable(a,b) p_symbols->main_GetPszVariable(a,b)
200 #   define main_PutPszVariable(a,b) p_symbols->main_PutPszVariable(a,b)
201
202 #   define TestProgram(a) p_symbols->TestProgram(a)
203 #   define TestMethod(a,b) p_symbols->TestMethod(a,b)
204 #   define TestCPU(a) p_symbols->TestCPU(a)
205
206 #   define intf_AssignKey(a,b,c,d) p_symbols->intf_AssignKey(a,b,c,d)
207 #   define intf_ProcessKey(a,b) p_symbols->intf_ProcessKey(a,b)
208
209 #   define intf_Msg p_symbols->intf_Msg
210 #   define intf_ErrMsg p_symbols->intf_ErrMsg
211 #   define intf_WarnMsg p_symbols->intf_WarnMsg
212 #   define intf_WarnMsgImm p_symbols->intf_WarnMsgImm
213 #ifdef TRACE
214 #   undef  intf_DbgMsg
215 #   undef  intf_DbgMsgImm
216 #   define intf_DbgMsg( format, args... ) \
217     p_symbols->intf_DbgMsg( __FILE__, __FUNCTION__, \
218                             __LINE__, format, ## args )
219 #   define intf_DbgMsgImm( format, args... ) \
220     p_symbols->intf_DbgMsgImm( __FILE__, __FUNCTION__, \
221                                __LINE__, format, ## args )
222 #endif
223
224 #   define intf_PlaylistAdd(a,b,c) p_symbols->intf_PlaylistAdd(a,b,c)
225 #   define intf_PlaylistDelete(a,b) p_symbols->intf_PlaylistDelete(a,b)
226 #   define intf_PlaylistNext(a) p_symbols->intf_PlaylistNext(a)
227 #   define intf_PlaylistPrev(a) p_symbols->intf_PlaylistPrev(a)
228 #   define intf_PlaylistDestroy(a) p_symbols->intf_PlaylistDestroy(a)
229 #   define intf_PlaylistJumpto(a,b) p_symbols->intf_PlaylistJumpto(a,b)
230 #   define intf_UrlDecode(a) p_symbols->intf_UrlDecode(a)
231
232 #   define msleep(a) p_symbols->msleep(a)
233 #   define mdate() p_symbols->mdate()
234
235 #   define network_ChannelCreate() p_symbols->network_ChannelCreate()
236 #   define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
237
238 #   define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
239 #   define input_Seek(a,b) p_symbols->input_Seek(a,b)
240 #   define input_DumpStream(a) p_symbols->input_DumpStream(a)
241 #   define input_OffsetToTime(a,b,c) p_symbols->input_OffsetToTime(a,b,c)
242 #   define input_ChangeES(a,b,c) p_symbols->input_ChangeES(a,b,c)
243 #   define input_ToggleES(a,b,c) p_symbols->input_ToggleES(a,b,c)
244 #   define input_ChangeArea(a,b) p_symbols->input_ChangeArea(a,b)
245 #   define input_FindES p_symbols->input_FindES
246 #   define input_AddES p_symbols->input_AddES
247 #   define input_DelES p_symbols->input_DelES
248 #   define input_SelectES p_symbols->input_SelectES
249 #   define input_UnselectES p_symbols->input_UnselectES
250 #   define input_AddProgram p_symbols->input_AddProgram
251 #   define input_DelProgram p_symbols->input_DelProgram
252 #   define input_AddArea p_symbols->input_AddArea
253 #   define input_DelArea p_symbols->input_DelArea
254
255 #   define input_InitStream p_symbols->input_InitStream
256 #   define input_EndStream p_symbols->input_EndStream
257
258 #   define input_ParsePES p_symbols->input_ParsePES
259 #   define input_GatherPES p_symbols->input_GatherPES
260 #   define input_ParsePS p_symbols->input_ParsePS
261 #   define input_DemuxPS p_symbols->input_DemuxPS
262 #   define input_DemuxTS p_symbols->input_DemuxTS
263 #   define input_DemuxPSI p_symbols->input_DemuxPSI
264
265 #   define input_NetlistInit p_symbols->input_NetlistInit
266 #   define input_NetlistGetiovec p_symbols->input_NetlistGetiovec
267 #   define input_NetlistMviovec p_symbols->input_NetlistMviovec
268 #   define input_NetlistNewPacket p_symbols->input_NetlistNewPacket
269 #   define input_NetlistNewPES p_symbols->input_NetlistNewPES
270 #   define input_NetlistDeletePacket p_symbols->input_NetlistDeletePacket
271 #   define input_NetlistDeletePES p_symbols->input_NetlistDeletePES
272 #   define input_NetlistEnd p_symbols->input_NetlistEnd
273
274 #endif
275