]> git.sesse.net Git - vlc/blob - include/modules_export.h
Documentation updates.
[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_StatMsg )    ( char *, ... );
44     void ( * intf_WarnMsg )    ( int, char *, ... );
45     void ( * intf_WarnMsgImm ) ( int, char *, ... );
46 #ifdef TRACE
47     void ( * intf_DbgMsg )     ( char *, char *, int, char *, ... );
48     void ( * intf_DbgMsgImm )  ( char *, char *, int, char *, ... );
49 #endif
50
51     int  ( * intf_PlaylistAdd )     ( struct playlist_s *, int, const char* );
52     int  ( * intf_PlaylistDelete )  ( struct playlist_s *, int );
53     void ( * intf_PlaylistNext )    ( struct playlist_s * );
54     void ( * intf_PlaylistPrev )    ( struct playlist_s * );
55     void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
56     void ( * intf_PlaylistJumpto )  ( struct playlist_s *, int );
57     void ( * intf_UrlDecode )       ( char * );
58
59     void    ( * msleep )         ( mtime_t );
60     mtime_t ( * mdate )          ( void );
61
62     int  ( * network_ChannelCreate )( void );
63     int  ( * network_ChannelJoin )  ( int );
64
65     void ( * input_SetStatus )      ( struct input_thread_s *, int );
66     void ( * input_Seek )           ( struct input_thread_s *, off_t );
67     void ( * input_DumpStream )     ( struct input_thread_s * );
68     char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
69     int  ( * input_ChangeES )       ( struct input_thread_s *,
70                                       struct es_descriptor_s *, u8 );
71     int  ( * input_ToggleES )       ( struct input_thread_s *,
72                                       struct es_descriptor_s *, boolean_t );
73     int  ( * input_ChangeArea )     ( struct input_thread_s *,
74                                       struct input_area_s * );
75     struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
76                                                   u16 );
77     struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
78                                       struct pgrm_descriptor_s *, u16, size_t );
79     void ( * input_DelES )          ( struct input_thread_s *,
80                                       struct es_descriptor_s * );
81     int  ( * input_SelectES )       ( struct input_thread_s *,
82                                       struct es_descriptor_s * );
83     int  ( * input_UnselectES )     ( struct input_thread_s *,
84                                       struct es_descriptor_s * );
85     struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
86                                                        u16, size_t );
87     void ( * input_DelProgram )     ( struct input_thread_s *,
88                                       struct pgrm_descriptor_s * );
89     struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
90     void ( * input_DelArea )        ( struct input_thread_s *,
91                                       struct input_area_s * );
92
93     void ( * InitBitstream )        ( struct bit_stream_s *,
94                                       struct decoder_fifo_s *,
95                                       void ( * ) ( struct bit_stream_s *,
96                                                    boolean_t ),
97                                       void * );
98     int  ( * input_InitStream )     ( struct input_thread_s *, size_t );
99     void ( * input_EndStream )      ( struct input_thread_s * );
100
101     void ( * input_ParsePES )       ( struct input_thread_s *,
102                                       struct es_descriptor_s * );
103     void ( * input_GatherPES )      ( struct input_thread_s *,
104                                       struct data_packet_s *,
105                                       struct es_descriptor_s *,
106                                       boolean_t, boolean_t );
107     void ( * input_DecodePES )      ( struct decoder_fifo_s *,
108                                       struct pes_packet_s * );
109     struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
110                                                    struct data_packet_s * );
111     void ( * input_DemuxPS )        ( struct input_thread_s *,
112                                       struct data_packet_s * );
113     void ( * input_DemuxTS )        ( struct input_thread_s *,
114                                       struct data_packet_s * );
115     void ( * input_DemuxPSI )       ( struct input_thread_s *,
116                                       struct data_packet_s *,
117                                       struct es_descriptor_s *, 
118                                       boolean_t, boolean_t );
119
120     int ( * input_ClockManageControl )   ( struct input_thread_s *,
121                                            struct pgrm_descriptor_s *,
122                                            mtime_t );
123
124     int ( * input_NetlistInit )          ( struct input_thread_s *,
125                                            int, int, int, size_t, int );
126     struct iovec * ( * input_NetlistGetiovec ) ( void * p_method_data );
127     void ( * input_NetlistMviovec )      ( void * , int,
128                                            struct data_packet_s **);
129     struct data_packet_s * ( * input_NetlistNewPacket ) ( void *, size_t );
130     struct data_packet_s * ( * input_NetlistNewPtr ) ( void * );
131     struct pes_packet_s * ( * input_NetlistNewPES ) ( void * );
132     void ( * input_NetlistDeletePacket ) ( void *, struct data_packet_s * );
133     void ( * input_NetlistDeletePES )    ( void *, struct pes_packet_s * );
134     void ( * input_NetlistEnd )          ( struct input_thread_s * );
135
136     struct aout_fifo_s * ( * aout_CreateFifo ) 
137                                        ( int, int, long, long, long, void * );
138     void ( * aout_DestroyFifo )     ( struct aout_fifo_s * );
139
140     struct vout_thread_s * (* vout_CreateThread) ( int *, int, int );
141     struct subpicture_s * (* vout_CreateSubPicture) ( struct vout_thread_s *, 
142                                                       int, int );
143     struct picture_s * ( * vout_CreatePicture ) ( struct vout_thread_s *, 
144                                                   int, int, int );
145
146     void  ( * vout_DestroySubPicture )  ( struct vout_thread_s *, 
147                                           struct subpicture_s * );
148     void  ( * vout_DisplaySubPicture )  ( struct vout_thread_s *, 
149                                           struct subpicture_s * );
150     void  ( * vout_DisplayPicture ) ( struct vout_thread_s *, 
151                                       struct picture_s * );
152     void  ( * vout_DestroyPicture ) ( struct vout_thread_s *,
153                                       struct picture_s * );
154     void  ( * vout_LinkPicture )    ( struct vout_thread_s *,
155                                       struct picture_s * );
156     void  ( * vout_UnlinkPicture )    ( struct vout_thread_s *,
157                                       struct picture_s * );
158     void  ( * vout_DatePicture )    ( struct vout_thread_s *p_vout, 
159                                       struct picture_s *p_pic, mtime_t );
160     
161     u32  ( * UnalignedShowBits )    ( struct bit_stream_s *, unsigned int );
162     void ( * UnalignedRemoveBits )  ( struct bit_stream_s * );
163     u32  ( * UnalignedGetBits )     ( struct bit_stream_s *, unsigned int );
164
165     char * ( * DecodeLanguage ) ( u16 );
166
167     struct module_s * ( * module_Need )    ( int, void * );
168     void ( * module_Unneed )        ( struct module_s * );
169 } module_symbols_t;
170
171 #define STORE_SYMBOLS( p_symbols ) \
172     (p_symbols)->p_main = p_main; \
173     (p_symbols)->p_aout_bank = p_aout_bank; \
174     (p_symbols)->p_vout_bank = p_vout_bank; \
175     (p_symbols)->main_GetIntVariable = main_GetIntVariable; \
176     (p_symbols)->main_GetPszVariable = main_GetPszVariable; \
177     (p_symbols)->main_PutIntVariable = main_PutIntVariable; \
178     (p_symbols)->main_PutPszVariable = main_PutPszVariable; \
179     (p_symbols)->TestProgram = TestProgram; \
180     (p_symbols)->TestMethod = TestMethod; \
181     (p_symbols)->TestCPU = TestCPU; \
182     (p_symbols)->intf_AssignKey = intf_AssignKey; \
183     (p_symbols)->intf_ProcessKey = intf_ProcessKey; \
184     (p_symbols)->intf_Msg = intf_Msg; \
185     (p_symbols)->intf_ErrMsg = intf_ErrMsg; \
186     (p_symbols)->intf_StatMsg = intf_StatMsg;\
187     (p_symbols)->intf_WarnMsg = intf_WarnMsg; \
188     (p_symbols)->intf_WarnMsgImm = intf_WarnMsgImm; \
189     (p_symbols)->intf_PlaylistAdd = intf_PlaylistAdd; \
190     (p_symbols)->intf_PlaylistDelete = intf_PlaylistDelete; \
191     (p_symbols)->intf_PlaylistNext = intf_PlaylistNext; \
192     (p_symbols)->intf_PlaylistPrev = intf_PlaylistPrev; \
193     (p_symbols)->intf_PlaylistDestroy = intf_PlaylistDestroy; \
194     (p_symbols)->intf_PlaylistJumpto = intf_PlaylistJumpto; \
195     (p_symbols)->intf_UrlDecode = intf_UrlDecode; \
196     (p_symbols)->msleep = msleep; \
197     (p_symbols)->mdate = mdate; \
198     (p_symbols)->network_ChannelCreate = network_ChannelCreate; \
199     (p_symbols)->network_ChannelJoin = network_ChannelJoin; \
200     (p_symbols)->input_SetStatus = input_SetStatus; \
201     (p_symbols)->input_Seek = input_Seek; \
202     (p_symbols)->input_DumpStream = input_DumpStream; \
203     (p_symbols)->input_OffsetToTime = input_OffsetToTime; \
204     (p_symbols)->input_ChangeES = input_ChangeES; \
205     (p_symbols)->input_ToggleES = input_ToggleES; \
206     (p_symbols)->input_ChangeArea = input_ChangeArea; \
207     (p_symbols)->input_FindES = input_FindES; \
208     (p_symbols)->input_AddES = input_AddES; \
209     (p_symbols)->input_DelES = input_DelES; \
210     (p_symbols)->input_SelectES = input_SelectES; \
211     (p_symbols)->input_UnselectES = input_UnselectES; \
212     (p_symbols)->input_AddProgram = input_AddProgram; \
213     (p_symbols)->input_DelProgram = input_DelProgram; \
214     (p_symbols)->input_AddArea = input_AddArea; \
215     (p_symbols)->input_DelArea = input_DelArea; \
216     (p_symbols)->InitBitstream = InitBitstream; \
217     (p_symbols)->input_InitStream = input_InitStream; \
218     (p_symbols)->input_EndStream = input_EndStream; \
219     (p_symbols)->input_ParsePES = input_ParsePES; \
220     (p_symbols)->input_GatherPES = input_GatherPES; \
221     (p_symbols)->input_DecodePES = input_DecodePES; \
222     (p_symbols)->input_ParsePS = input_ParsePS; \
223     (p_symbols)->input_DemuxPS = input_DemuxPS; \
224     (p_symbols)->input_DemuxTS = input_DemuxTS; \
225     (p_symbols)->input_DemuxPSI = input_DemuxPSI; \
226     (p_symbols)->input_ClockManageControl = input_ClockManageControl; \
227     (p_symbols)->input_NetlistInit = input_NetlistInit; \
228     (p_symbols)->input_NetlistGetiovec = input_NetlistGetiovec; \
229     (p_symbols)->input_NetlistMviovec = input_NetlistMviovec; \
230     (p_symbols)->input_NetlistNewPacket = input_NetlistNewPacket; \
231     (p_symbols)->input_NetlistNewPtr = input_NetlistNewPtr; \
232     (p_symbols)->input_NetlistNewPES = input_NetlistNewPES; \
233     (p_symbols)->input_NetlistDeletePacket = input_NetlistDeletePacket; \
234     (p_symbols)->input_NetlistDeletePES = input_NetlistDeletePES; \
235     (p_symbols)->input_NetlistEnd = input_NetlistEnd; \
236     (p_symbols)->aout_CreateFifo = aout_CreateFifo; \
237     (p_symbols)->aout_DestroyFifo = aout_DestroyFifo; \
238     (p_symbols)->vout_CreateThread = vout_CreateThread; \
239     (p_symbols)->vout_CreateSubPicture = vout_CreateSubPicture; \
240     (p_symbols)->vout_DestroySubPicture = vout_DestroySubPicture; \
241     (p_symbols)->vout_DisplaySubPicture = vout_DisplaySubPicture; \
242     (p_symbols)->vout_CreatePicture = vout_CreatePicture; \
243     (p_symbols)->vout_DisplayPicture = vout_DisplayPicture; \
244     (p_symbols)->vout_DestroyPicture = vout_DestroyPicture; \
245     (p_symbols)->vout_DatePicture = vout_DatePicture; \
246     (p_symbols)->vout_LinkPicture = vout_LinkPicture; \
247     (p_symbols)->vout_UnlinkPicture = vout_UnlinkPicture; \
248     (p_symbols)->UnalignedGetBits = UnalignedGetBits; \
249     (p_symbols)->UnalignedRemoveBits = UnalignedRemoveBits; \
250     (p_symbols)->UnalignedShowBits = UnalignedShowBits; \
251     (p_symbols)->DecodeLanguage = DecodeLanguage; \
252     (p_symbols)->module_Need = module_Need; \
253     (p_symbols)->module_Unneed = module_Unneed;
254     
255 #define STORE_TRACE_SYMBOLS( p_symbols ) \
256     (p_symbols)->intf_DbgMsg = _intf_DbgMsg; \
257     (p_symbols)->intf_DbgMsgImm = _intf_DbgMsgImm;
258
259 #ifdef PLUGIN
260 extern module_symbols_t* p_symbols;
261
262 #   define p_main (p_symbols->p_main)
263 #   define p_aout_bank (p_symbols->p_aout_bank)
264 #   define p_vout_bank (p_symbols->p_vout_bank)
265
266 #   define main_GetIntVariable(a,b) p_symbols->main_GetIntVariable(a,b)
267 #   define main_PutIntVariable(a,b) p_symbols->main_PutIntVariable(a,b)
268 #   define main_GetPszVariable(a,b) p_symbols->main_GetPszVariable(a,b)
269 #   define main_PutPszVariable(a,b) p_symbols->main_PutPszVariable(a,b)
270
271 #   define TestProgram(a) p_symbols->TestProgram(a)
272 #   define TestMethod(a,b) p_symbols->TestMethod(a,b)
273 #   define TestCPU(a) p_symbols->TestCPU(a)
274
275 #   define intf_AssignKey(a,b,c,d) p_symbols->intf_AssignKey(a,b,c,d)
276 #   define intf_ProcessKey(a,b) p_symbols->intf_ProcessKey(a,b)
277
278 #   define intf_Msg p_symbols->intf_Msg
279 #   define intf_ErrMsg p_symbols->intf_ErrMsg
280 #   define intf_StatMsg p_symbols->intf_StatMsg
281 #   define intf_WarnMsg p_symbols->intf_WarnMsg
282 #   define intf_WarnMsgImm p_symbols->intf_WarnMsgImm
283 #ifdef TRACE
284 #   undef  intf_DbgMsg
285 #   undef  intf_DbgMsgImm
286 #   define intf_DbgMsg( format, args... ) \
287     p_symbols->intf_DbgMsg( __FILE__, __FUNCTION__, \
288                             __LINE__, format, ## args )
289 #   define intf_DbgMsgImm( format, args... ) \
290     p_symbols->intf_DbgMsgImm( __FILE__, __FUNCTION__, \
291                                __LINE__, format, ## args )
292 #endif
293
294 #   define intf_PlaylistAdd(a,b,c) p_symbols->intf_PlaylistAdd(a,b,c)
295 #   define intf_PlaylistDelete(a,b) p_symbols->intf_PlaylistDelete(a,b)
296 #   define intf_PlaylistNext(a) p_symbols->intf_PlaylistNext(a)
297 #   define intf_PlaylistPrev(a) p_symbols->intf_PlaylistPrev(a)
298 #   define intf_PlaylistDestroy(a) p_symbols->intf_PlaylistDestroy(a)
299 #   define intf_PlaylistJumpto(a,b) p_symbols->intf_PlaylistJumpto(a,b)
300 #   define intf_UrlDecode(a) p_symbols->intf_UrlDecode(a)
301
302 #   define msleep(a) p_symbols->msleep(a)
303 #   define mdate() p_symbols->mdate()
304
305 #   define network_ChannelCreate() p_symbols->network_ChannelCreate()
306 #   define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
307
308 #   define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
309 #   define input_Seek(a,b) p_symbols->input_Seek(a,b)
310 #   define input_DumpStream(a) p_symbols->input_DumpStream(a)
311 #   define input_OffsetToTime(a,b,c) p_symbols->input_OffsetToTime(a,b,c)
312 #   define input_ChangeES(a,b,c) p_symbols->input_ChangeES(a,b,c)
313 #   define input_ToggleES(a,b,c) p_symbols->input_ToggleES(a,b,c)
314 #   define input_ChangeArea(a,b) p_symbols->input_ChangeArea(a,b)
315 #   define input_FindES p_symbols->input_FindES
316 #   define input_AddES p_symbols->input_AddES
317 #   define input_DelES p_symbols->input_DelES
318 #   define input_SelectES p_symbols->input_SelectES
319 #   define input_UnselectES p_symbols->input_UnselectES
320 #   define input_AddProgram p_symbols->input_AddProgram
321 #   define input_DelProgram p_symbols->input_DelProgram
322 #   define input_AddArea p_symbols->input_AddArea
323 #   define input_DelArea p_symbols->input_DelArea
324
325 #   define InitBitstream p_symbols->InitBitstream
326 #   define input_InitStream p_symbols->input_InitStream
327 #   define input_EndStream p_symbols->input_EndStream
328
329 #   define input_ParsePES p_symbols->input_ParsePES
330 #   define input_GatherPES p_symbols->input_GatherPES
331 #   define input_DecodePES p_symbols->input_DecodePES
332 #   define input_ParsePS p_symbols->input_ParsePS
333 #   define input_DemuxPS p_symbols->input_DemuxPS
334 #   define input_DemuxTS p_symbols->input_DemuxTS
335 #   define input_DemuxPSI p_symbols->input_DemuxPSI
336
337 #   define input_ClockManageControl p_symbols->input_ClockManageControl
338
339 #   define input_NetlistInit p_symbols->input_NetlistInit
340 #   define input_NetlistGetiovec p_symbols->input_NetlistGetiovec
341 #   define input_NetlistMviovec p_symbols->input_NetlistMviovec
342 #   define input_NetlistNewPacket p_symbols->input_NetlistNewPacket
343 #   define input_NetlistNewPtr p_symbols->input_NetlistNewPtr
344 #   define input_NetlistNewPES p_symbols->input_NetlistNewPES
345 #   define input_NetlistDeletePacket p_symbols->input_NetlistDeletePacket
346 #   define input_NetlistDeletePES p_symbols->input_NetlistDeletePES
347 #   define input_NetlistEnd p_symbols->input_NetlistEnd
348
349 #   define aout_CreateFifo p_symbols->aout_CreateFifo
350 #   define aout_DestroyFifo p_symbols->aout_DestroyFifo
351
352 #   define vout_CreateThread p_symbols->vout_CreateThread
353 #   define vout_CreateSubPicture p_symbols->vout_CreateSubPicture
354 #   define vout_DestroySubPicture p_symbols->vout_DestroySubPicture
355 #   define vout_DisplaySubPicture p_symbols->vout_DisplaySubPicture
356 #   define vout_CreatePicture p_symbols->vout_CreatePicture
357 #   define vout_DisplayPicture p_symbols->vout_DisplayPicture
358 #   define vout_DestroyPicture p_symbols->vout_DestroyPicture
359 #   define vout_DatePicture p_symbols->vout_DatePicture
360 #   define vout_LinkPicture p_symbols->vout_LinkPicture
361 #   define vout_UnlinkPicture p_symbols->vout_UnlinkPicture
362     
363 #   define UnalignedShowBits p_symbols->UnalignedShowBits
364 #   define UnalignedRemoveBits p_symbols->UnalignedRemoveBits
365 #   define UnalignedGetBits p_symbols->UnalignedGetBits
366
367 #   define DecodeLanguage p_symbols->DecodeLanguage
368
369 #   define module_Need p_symbols->module_Need
370 #   define module_Unneed p_symbols->module_Unneed
371     
372 #endif
373