1 /*****************************************************************************
2 * modules_export.h: macros for exporting vlc symbols to plugins
3 *****************************************************************************
4 * Copyright (C) 2001 VideoLAN
6 * Authors: Samuel Hocevar <sam@zoy.org>
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.
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.
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 *****************************************************************************/
23 typedef struct module_symbols_s
25 struct main_s* p_main;
26 struct aout_bank_s* p_aout_bank;
27 struct vout_bank_s* p_vout_bank;
29 int ( * main_GetIntVariable ) ( char *, int );
30 char * ( * main_GetPszVariable ) ( char *, char * );
31 void ( * main_PutIntVariable ) ( char *, int );
32 void ( * main_PutPszVariable ) ( char *, char * );
34 int ( * TestProgram ) ( char * );
35 int ( * TestMethod ) ( char *, char * );
36 int ( * TestCPU ) ( int );
38 int ( * intf_ProcessKey ) ( struct intf_thread_s *, int );
39 void ( * intf_AssignKey ) ( struct intf_thread_s *, int, int, int );
41 void ( * intf_Msg ) ( char *, ... );
42 void ( * intf_ErrMsg ) ( char *, ... );
43 void ( * intf_WarnMsg ) ( int, char *, ... );
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 * );
53 void ( * msleep ) ( mtime_t );
54 mtime_t ( * mdate ) ( void );
56 int ( * network_ChannelCreate )( void );
57 int ( * network_ChannelJoin ) ( int );
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 struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
72 struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
73 struct pgrm_descriptor_s *, u16, size_t );
74 void ( * input_DelES ) ( struct input_thread_s *,
75 struct es_descriptor_s * );
76 int ( * input_SelectES ) ( struct input_thread_s *,
77 struct es_descriptor_s * );
78 int ( * input_UnselectES ) ( struct input_thread_s *,
79 struct es_descriptor_s * );
80 struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
82 void ( * input_DelProgram ) ( struct input_thread_s *,
83 struct pgrm_descriptor_s * );
84 struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
85 void ( * input_DelArea ) ( struct input_thread_s *,
86 struct input_area_s * );
88 int ( * input_InitStream ) ( struct input_thread_s *, size_t );
89 void ( * input_EndStream ) ( struct input_thread_s * );
91 void ( * input_ParsePES ) ( struct input_thread_s *,
92 struct es_descriptor_s * );
93 void ( * input_GatherPES ) ( struct input_thread_s *,
94 struct data_packet_s *,
95 struct es_descriptor_s *,
96 boolean_t, boolean_t );
97 struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
98 struct data_packet_s * );
99 void ( * input_DemuxPS ) ( struct input_thread_s *,
100 struct data_packet_s * );
101 void ( * input_DemuxTS ) ( struct input_thread_s *,
102 struct data_packet_s * );
103 void ( * input_DemuxPSI ) ( struct input_thread_s *,
104 struct data_packet_s *,
105 struct es_descriptor_s *,
106 boolean_t, boolean_t );
108 int ( * input_NetlistInit ) ( struct input_thread_s *,
109 int, int, size_t, int );
110 struct iovec * ( * input_NetlistGetiovec ) ( void * p_method_data );
111 void ( * input_NetlistMviovec ) ( void * , size_t,
112 struct data_packet_s **);
113 struct data_packet_s * ( * input_NetlistNewPacket ) ( void *, size_t );
114 struct pes_packet_s * ( * input_NetlistNewPES ) ( void * );
115 void ( * input_NetlistDeletePacket ) ( void *, struct data_packet_s * );
116 void ( * input_NetlistDeletePES ) ( void *, struct pes_packet_s * );
117 void ( * input_NetlistEnd ) ( struct input_thread_s * );
121 #define STORE_SYMBOLS( p_symbols ) \
122 (p_symbols)->p_main = p_main; \
123 (p_symbols)->p_aout_bank = p_aout_bank; \
124 (p_symbols)->p_vout_bank = p_vout_bank; \
125 (p_symbols)->main_GetIntVariable = main_GetIntVariable; \
126 (p_symbols)->main_GetPszVariable = main_GetPszVariable; \
127 (p_symbols)->main_PutIntVariable = main_PutIntVariable; \
128 (p_symbols)->main_PutPszVariable = main_PutPszVariable; \
129 (p_symbols)->TestProgram = TestProgram; \
130 (p_symbols)->TestMethod = TestMethod; \
131 (p_symbols)->TestCPU = TestCPU; \
132 (p_symbols)->intf_AssignKey = intf_AssignKey; \
133 (p_symbols)->intf_ProcessKey = intf_ProcessKey; \
134 (p_symbols)->intf_Msg = intf_Msg; \
135 (p_symbols)->intf_ErrMsg = intf_ErrMsg; \
136 (p_symbols)->intf_WarnMsg = intf_WarnMsg; \
137 (p_symbols)->intf_PlaylistAdd = intf_PlaylistAdd; \
138 (p_symbols)->intf_PlaylistDelete = intf_PlaylistDelete; \
139 (p_symbols)->intf_PlaylistNext = intf_PlaylistNext; \
140 (p_symbols)->intf_PlaylistPrev = intf_PlaylistPrev; \
141 (p_symbols)->intf_PlaylistDestroy = intf_PlaylistDestroy; \
142 (p_symbols)->intf_PlaylistJumpto = intf_PlaylistJumpto; \
143 (p_symbols)->intf_UrlDecode = intf_UrlDecode; \
144 (p_symbols)->msleep = msleep; \
145 (p_symbols)->mdate = mdate; \
146 (p_symbols)->network_ChannelCreate = network_ChannelCreate; \
147 (p_symbols)->network_ChannelJoin = network_ChannelJoin; \
148 (p_symbols)->input_SetStatus = input_SetStatus; \
149 (p_symbols)->input_SetRate = input_SetRate; \
150 (p_symbols)->input_Seek = input_Seek; \
151 (p_symbols)->input_DumpStream = input_DumpStream; \
152 (p_symbols)->input_OffsetToTime = input_OffsetToTime; \
153 (p_symbols)->input_ChangeES = input_ChangeES; \
154 (p_symbols)->input_ToggleES = input_ToggleES; \
155 (p_symbols)->input_ChangeArea = input_ChangeArea; \
156 (p_symbols)->input_FindES = input_FindES; \
157 (p_symbols)->input_AddES = input_AddES; \
158 (p_symbols)->input_DelES = input_DelES; \
159 (p_symbols)->input_SelectES = input_SelectES; \
160 (p_symbols)->input_UnselectES = input_UnselectES; \
161 (p_symbols)->input_AddProgram = input_AddProgram; \
162 (p_symbols)->input_DelProgram = input_DelProgram; \
163 (p_symbols)->input_AddArea = input_AddArea; \
164 (p_symbols)->input_DelArea = input_DelArea; \
165 (p_symbols)->input_InitStream = input_InitStream; \
166 (p_symbols)->input_EndStream = input_EndStream; \
167 (p_symbols)->input_ParsePES = input_ParsePES; \
168 (p_symbols)->input_GatherPES = input_GatherPES; \
169 (p_symbols)->input_ParsePS = input_ParsePS; \
170 (p_symbols)->input_DemuxPS = input_DemuxPS; \
171 (p_symbols)->input_DemuxTS = input_DemuxTS; \
172 (p_symbols)->input_DemuxPSI = input_DemuxPSI; \
173 (p_symbols)->input_NetlistInit = input_NetlistInit; \
174 (p_symbols)->input_NetlistGetiovec = input_NetlistGetiovec; \
175 (p_symbols)->input_NetlistMviovec = input_NetlistMviovec; \
176 (p_symbols)->input_NetlistNewPacket = input_NetlistNewPacket; \
177 (p_symbols)->input_NetlistNewPES = input_NetlistNewPES; \
178 (p_symbols)->input_NetlistDeletePacket = input_NetlistDeletePacket; \
179 (p_symbols)->input_NetlistDeletePES = input_NetlistDeletePES; \
180 (p_symbols)->input_NetlistEnd = input_NetlistEnd;
183 extern module_symbols_t* p_symbols;
185 # define p_main (p_symbols->p_main)
186 # define p_aout_bank (p_symbols->p_aout_bank)
187 # define p_vout_bank (p_symbols->p_vout_bank)
189 # define main_GetIntVariable(a,b) p_symbols->main_GetIntVariable(a,b)
190 # define main_PutIntVariable(a,b) p_symbols->main_PutIntVariable(a,b)
191 # define main_GetPszVariable(a,b) p_symbols->main_GetPszVariable(a,b)
192 # define main_PutPszVariable(a,b) p_symbols->main_PutPszVariable(a,b)
194 # define TestProgram(a) p_symbols->TestProgram(a)
195 # define TestMethod(a,b) p_symbols->TestMethod(a,b)
196 # define TestCPU(a) p_symbols->TestCPU(a)
198 # define intf_AssignKey(a,b,c,d) p_symbols->intf_AssignKey(a,b,c,d)
199 # define intf_ProcessKey(a,b) p_symbols->intf_ProcessKey(a,b)
201 # define intf_Msg(a,b...) p_symbols->intf_Msg(a, ## b)
202 # define intf_ErrMsg(a,b...) p_symbols->intf_ErrMsg(a, ## b)
203 # define intf_WarnMsg(a,b,c...) p_symbols->intf_WarnMsg(a,b, ## c)
205 # define intf_PlaylistAdd(a,b,c) p_symbols->intf_PlaylistAdd(a,b,c)
206 # define intf_PlaylistDelete(a,b) p_symbols->intf_PlaylistDelete(a,b)
207 # define intf_PlaylistNext(a) p_symbols->intf_PlaylistNext(a)
208 # define intf_PlaylistPrev(a) p_symbols->intf_PlaylistPrev(a)
209 # define intf_PlaylistDestroy(a) p_symbols->intf_PlaylistDestroy(a)
210 # define intf_PlaylistJumpto(a,b) p_symbols->intf_PlaylistJumpto(a,b)
211 # define intf_UrlDecode(a) p_symbols->intf_UrlDecode(a)
213 # define msleep(a) p_symbols->msleep(a)
214 # define mdate() p_symbols->mdate()
216 # define network_ChannelCreate() p_symbols->network_ChannelCreate()
217 # define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
219 # define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
220 # define input_SetRate(a,b) p_symbols->input_SetRate(a,b)
221 # define input_Seek(a,b) p_symbols->input_Seek(a,b)
222 # define input_DumpStream(a) p_symbols->input_DumpStream(a)
223 # define input_OffsetToTime(a,b,c) p_symbols->input_OffsetToTime(a,b,c)
224 # define input_ChangeES(a,b,c) p_symbols->input_ChangeES(a,b,c)
225 # define input_ToggleES(a,b,c) p_symbols->input_ToggleES(a,b,c)
226 # define input_ChangeArea(a,b) p_symbols->input_ChangeArea(a,b)
227 # define input_FindES p_symbols->input_FindES
228 # define input_AddES p_symbols->input_AddES
229 # define input_DelES p_symbols->input_DelES
230 # define input_SelectES p_symbols->input_SelectES
231 # define input_UnselectES p_symbols->input_UnselectES
232 # define input_AddProgram p_symbols->input_AddProgram
233 # define input_DelProgram p_symbols->input_DelProgram
234 # define input_AddArea p_symbols->input_AddArea
235 # define input_DelArea p_symbols->input_DelArea
237 # define input_InitStream p_symbols->input_InitStream
238 # define input_EndStream p_symbols->input_EndStream
240 # define input_ParsePES p_symbols->input_ParsePES
241 # define input_GatherPES p_symbols->input_GatherPES
242 # define input_ParsePS p_symbols->input_ParsePS
243 # define input_DemuxPS p_symbols->input_DemuxPS
244 # define input_DemuxTS p_symbols->input_DemuxTS
245 # define input_DemuxPSI p_symbols->input_DemuxPSI
247 # define input_NetlistInit p_symbols->input_NetlistInit
248 # define input_NetlistGetiovec p_symbols->input_NetlistGetiovec
249 # define input_NetlistMviovec p_symbols->input_NetlistMviovec
250 # define input_NetlistNewPacket p_symbols->input_NetlistNewPacket
251 # define input_NetlistNewPES p_symbols->input_NetlistNewPES
252 # define input_NetlistDeletePacket p_symbols->input_NetlistDeletePacket
253 # define input_NetlistDeletePES p_symbols->input_NetlistDeletePES
254 # define input_NetlistEnd p_symbols->input_NetlistEnd