summaryrefslogtreecommitdiff
blob: fd659e05f9112abfe9ec5d95e94d1feeca8631e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
diff -Naur freepv-0.3.0.orig/CMakeScripts/FindGECKO.cmake freepv-0.3.0/CMakeScripts/FindGECKO.cmake
--- freepv-0.3.0.orig/CMakeScripts/FindGECKO.cmake	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/CMakeScripts/FindGECKO.cmake	2009-07-15 14:49:03.000000000 +0200
@@ -30,6 +30,11 @@
       SET(GECKO_INCLUDE_DIR ${GECKO_ROOT_DIR} ${GECKO_NSPR_DIR})
       SET(GECKO_LIBRARY ${Xt_LIBRARY})
 
+      FIND_PATH(NPFUNCTIONS_H_DIR npfunctions.h ${GECKO_ROOT_DIR})
+      IF (NPFUNCTIONS_H_DIR)
+         SET(HAVE_NPFUNCTIONS_H TRUE)
+      ENDIF (NPFUNCTIONS_H_DIR)
+
 IF (GECKO_INCLUDE_DIR AND GECKO_LIBRARY)
    SET(GECKO_FOUND TRUE)
    SET(GECKO_LIBRARIES ${GECKO_LIBRARY})
diff -Naur freepv-0.3.0.orig/src/config.h.in.cmake freepv-0.3.0/src/config.h.in.cmake
--- freepv-0.3.0.orig/src/config.h.in.cmake	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/src/config.h.in.cmake	2009-07-15 14:49:03.000000000 +0200
@@ -24,3 +24,6 @@
 /* Define to 1 if you have are under Windows */
 #cmakedefine XP_WIN 1
 
+/* newer xulrunner has npfunctions.h not npupp.h */
+#cmakedefine HAVE_NPFUNCTIONS_H 1
+
diff -Naur freepv-0.3.0.orig/src/freepv-mozilla/npn_gate.cpp freepv-0.3.0/src/freepv-mozilla/npn_gate.cpp
--- freepv-0.3.0.orig/src/freepv-mozilla/npn_gate.cpp	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/src/freepv-mozilla/npn_gate.cpp	2009-07-15 15:00:25.000000000 +0200
@@ -58,7 +58,7 @@
   NPError rv = NPERR_NO_ERROR;
 
   if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
-		rv = CallNPN_GetURLNotifyProc(NPNFuncs.geturlnotify, instance, url, target, notifyData);
+		rv = (*NPNFuncs.geturlnotify)(instance, url, target, notifyData);
 	else
 		rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
 
@@ -67,32 +67,32 @@
 
 NPError NPN_GetURL(NPP instance, const char *url, const char *target)
 {
-  NPError rv = CallNPN_GetURLProc(NPNFuncs.geturl, instance, url, target);
+  NPError rv = (*NPNFuncs.geturl)(instance, url, target);
   return rv;
 }
 
-NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
+NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData)
 {
 	int navMinorVers = NPNFuncs.version & 0xFF;
   NPError rv = NPERR_NO_ERROR;
 
 	if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
-		rv = CallNPN_PostURLNotifyProc(NPNFuncs.posturlnotify, instance, url, window, len, buf, file, notifyData);
+		rv = (*NPNFuncs.posturlnotify)(instance, url, window, len, buf, file, notifyData);
 	else
 		rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
 
   return rv;
 }
 
-NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
+NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file)
 {
-  NPError rv = CallNPN_PostURLProc(NPNFuncs.posturl, instance, url, window, len, buf, file);
+  NPError rv = (*NPNFuncs.posturl)(instance, url, window, len, buf, file);
   return rv;
 } 
 
 NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
 {
-  NPError rv = CallNPN_RequestReadProc(NPNFuncs.requestread, stream, rangeList);
+  NPError rv = (*NPNFuncs.requestread)(stream, rangeList);
   return rv;
 }
 
@@ -103,20 +103,20 @@
   NPError rv = NPERR_NO_ERROR;
 
 	if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
-		rv = CallNPN_NewStreamProc(NPNFuncs.newstream, instance, type, target, stream);
+		rv = (*NPNFuncs.newstream)(instance, type, target, stream);
 	else
 		rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
 
   return rv;
 }
 
-int32 NPN_Write(NPP instance, NPStream *stream, int32 len, void *buffer)
+int32_t NPN_Write(NPP instance, NPStream *stream, int32_t len, void *buffer)
 {
 	int navMinorVersion = NPNFuncs.version & 0xFF;
-  int32 rv = 0;
+  int32_t rv = 0;
 
   if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
-		rv = CallNPN_WriteProc(NPNFuncs.write, instance, stream, len, buffer);
+		rv = (*NPNFuncs.write)(instance, stream, len, buffer);
 	else
 		rv = -1;
 
@@ -129,7 +129,7 @@
   NPError rv = NPERR_NO_ERROR;
 
   if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
-		rv = CallNPN_DestroyStreamProc(NPNFuncs.destroystream, instance, stream, reason);
+		rv = (*NPNFuncs.destroystream)(instance, stream, reason);
 	else
 		rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
 
@@ -138,37 +138,37 @@
 
 void NPN_Status(NPP instance, const char *message)
 {
-  CallNPN_StatusProc(NPNFuncs.status, instance, message);
+  (*NPNFuncs.status)(instance, message);
 }
 
 const char* NPN_UserAgent(NPP instance)
 {
   const char * rv = NULL;
-  rv = CallNPN_UserAgentProc(NPNFuncs.uagent, instance);
+  rv = (*NPNFuncs.uagent)(instance);
   return rv;
 }
 
-void* NPN_MemAlloc(uint32 size)
+void* NPN_MemAlloc(uint32_t size)
 {
   void * rv = NULL;
-  rv = CallNPN_MemAllocProc(NPNFuncs.memalloc, size);
+  rv = (*NPNFuncs.memalloc)(size);
   return rv;
 }
 
 void NPN_MemFree(void* ptr)
 {
-  CallNPN_MemFreeProc(NPNFuncs.memfree, ptr);
+  (*NPNFuncs.memfree)(ptr);
 }
 
-uint32 NPN_MemFlush(uint32 size)
+uint32_t NPN_MemFlush(uint32_t size)
 {
-  uint32 rv = CallNPN_MemFlushProc(NPNFuncs.memflush, size);
+  uint32_t rv = (*NPNFuncs.memflush)(size);
   return rv;
 }
 
 void NPN_ReloadPlugins(NPBool reloadPages)
 {
-  CallNPN_ReloadPluginsProc(NPNFuncs.reloadplugins, reloadPages);
+  (*NPNFuncs.reloadplugins)(reloadPages);
 }
 
 #ifdef OJI
@@ -182,34 +182,34 @@
 jref NPN_GetJavaPeer(NPP instance)
 {
   jref rv;
-  rv = CallNPN_GetJavaPeerProc(NPNFuncs.getJavaPeer, instance);
+  rv = (*NPNFuncs.getJavaPeer)(instance);
   return rv;
 }
 #endif
 
 NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
 {
-  NPError rv = CallNPN_GetValueProc(NPNFuncs.getvalue, instance, variable, value);
+  NPError rv = (*NPNFuncs.getvalue)(instance, variable, value);
   return rv;
 }
 
 NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
 {
-  NPError rv = CallNPN_SetValueProc(NPNFuncs.setvalue, instance, variable, value);
+  NPError rv = (*NPNFuncs.setvalue)(instance, variable, value);
   return rv;
 }
 
 void NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
 {
-  CallNPN_InvalidateRectProc(NPNFuncs.invalidaterect, instance, invalidRect);
+  (*NPNFuncs.invalidaterect)(instance, invalidRect);
 }
 
 void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
 {
-  CallNPN_InvalidateRegionProc(NPNFuncs.invalidateregion, instance, invalidRegion);
+  (*NPNFuncs.invalidateregion)(instance, invalidRegion);
 }
 
 void NPN_ForceRedraw(NPP instance)
 {
-  CallNPN_ForceRedrawProc(NPNFuncs.forceredraw, instance);
+  (*NPNFuncs.forceredraw)(instance);
 }
diff -Naur freepv-0.3.0.orig/src/freepv-mozilla/npp_gate.cpp freepv-0.3.0/src/freepv-mozilla/npp_gate.cpp
--- freepv-0.3.0.orig/src/freepv-mozilla/npp_gate.cpp	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/src/freepv-mozilla/npp_gate.cpp	2009-07-15 15:03:01.000000000 +0200
@@ -45,7 +45,7 @@
 // here the plugin creates a plugin instance object which 
 // will be associated with this newly created NPP instance and 
 // will do all the necessary job
-NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved)
+NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
 {   
   if(instance == NULL)
     return NPERR_INVALID_INSTANCE_ERROR;
@@ -130,7 +130,7 @@
   return rv;
 }
 
-NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype)
+NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype)
 {
   if(instance == NULL)
     return NPERR_INVALID_INSTANCE_ERROR;
@@ -143,7 +143,7 @@
   return rv;
 }
 
-int32 NPP_WriteReady (NPP instance, NPStream *stream)
+int32_t NPP_WriteReady (NPP instance, NPStream *stream)
 {
   if(instance == NULL)
     return 0x0fffffff;
@@ -152,11 +152,11 @@
   if(plugin == NULL) 
     return 0x0fffffff;
 
-  int32 rv = plugin->WriteReady(stream);
+  int32_t rv = plugin->WriteReady(stream);
   return rv;
 }
 
-int32 NPP_Write (NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
+int32_t NPP_Write (NPP instance, NPStream *stream, int32_t offset, int32_t len, void *buffer)
 {   
   if(instance == NULL)
     return len;
@@ -165,7 +165,7 @@
   if(plugin == NULL) 
     return len;
 
-  int32 rv = plugin->Write(stream, offset, len, buffer);
+  int32_t rv = plugin->Write(stream, offset, len, buffer);
   return rv;
 }
 
@@ -244,7 +244,7 @@
   return rv;
 }
 
-int16	NPP_HandleEvent(NPP instance, void* event)
+int16_t	NPP_HandleEvent(NPP instance, void* event)
 {
   if(instance == NULL)
     return 0;
@@ -253,7 +253,7 @@
   if(plugin == NULL) 
     return 0;
 
-  uint16 rv = plugin->HandleEvent(event);
+  uint16_t rv = plugin->HandleEvent(event);
   return rv;
 }
 
@@ -274,7 +274,7 @@
 
 #ifdef XP_MAC
 
-NPError	Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved)
+NPError	Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
 {
   NPError rv = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
   return rv;	
@@ -298,15 +298,15 @@
   return rv;
 }
 
-int32 Private_WriteReady(NPP instance, NPStream* stream)
+int32_t Private_WriteReady(NPP instance, NPStream* stream)
 {
-  int32 rv = NPP_WriteReady(instance, stream);
+  int32_t rv = NPP_WriteReady(instance, stream);
   return rv;
 }
 
-int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer)
+int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer)
 {
-  int32 rv = NPP_Write(instance, stream, offset, len, buffer);
+  int32_t rv = NPP_Write(instance, stream, offset, len, buffer);
   return rv;
 }
 
@@ -322,9 +322,9 @@
   return rv;
 }
 
-int16 Private_HandleEvent(NPP instance, void* event)
+int16_t Private_HandleEvent(NPP instance, void* event)
 {
-  int16 rv = NPP_HandleEvent(instance, event);
+  int16_t rv = NPP_HandleEvent(instance, event);
   return rv;
 }
 
diff -Naur freepv-0.3.0.orig/src/freepv-mozilla/npplat.h freepv-0.3.0/src/freepv-mozilla/npplat.h
--- freepv-0.3.0.orig/src/freepv-mozilla/npplat.h	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/src/freepv-mozilla/npplat.h	2009-07-15 14:49:03.000000000 +0200
@@ -40,7 +40,11 @@
 
 #include "config.h"
 #include "npapi.h"
+#ifdef HAVE_NPFUNCTIONS_H
+#include "npfunctions.h"
+#else
 #include "npupp.h"
+#endif
 
 /**************************************************/
 /*                                                */
diff -Naur freepv-0.3.0.orig/src/freepv-mozilla/pluginbase.h freepv-0.3.0/src/freepv-mozilla/pluginbase.h
--- freepv-0.3.0.orig/src/freepv-mozilla/pluginbase.h	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/src/freepv-mozilla/pluginbase.h	2009-07-15 14:52:48.000000000 +0200
@@ -44,8 +44,8 @@
 {
   NPP instance;
   NPMIMEType type; 
-  uint16 mode; 
-  int16 argc; 
+  uint16_t mode; 
+  int16_t argc; 
   char** argn; 
   char** argv; 
   NPSavedData* saved;
@@ -64,14 +64,14 @@
   // class as needed
   virtual NPError SetWindow(NPWindow* pNPWindow)                    { return NPERR_NO_ERROR; }
   virtual NPError NewStream(NPMIMEType type, NPStream* stream, 
-                            NPBool seekable, uint16* stype)         { return NPERR_NO_ERROR; }
+                            NPBool seekable, uint16_t* stype)         { return NPERR_NO_ERROR; }
   virtual NPError DestroyStream(NPStream *stream, NPError reason)   { return NPERR_NO_ERROR; }
   virtual void    StreamAsFile(NPStream* stream, const char* fname) { return; }
-  virtual int32   WriteReady(NPStream *stream)                      { return 0x0fffffff; }
-  virtual int32   Write(NPStream *stream, int32 offset, 
-                        int32 len, void *buffer)                    { return len; }
+  virtual int32_t   WriteReady(NPStream *stream)                      { return 0x0fffffff; }
+  virtual int32_t   Write(NPStream *stream, int32_t offset, 
+                        int32_t len, void *buffer)                    { return len; }
   virtual void    Print(NPPrint* printInfo)                         { return; }
-  virtual uint16  HandleEvent(void* event)                          { return 0; }
+  virtual uint16_t  HandleEvent(void* event)                          { return 0; }
   virtual void    URLNotify(const char* url, NPReason reason, 
                             void* notifyData)                       { return; }
   virtual NPError GetValue(NPPVariable variable, void *value)       { return NPERR_NO_ERROR; }
diff -Naur freepv-0.3.0.orig/src/freepv-mozilla/plugin.cpp freepv-0.3.0/src/freepv-mozilla/plugin.cpp
--- freepv-0.3.0.orig/src/freepv-mozilla/plugin.cpp	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/src/freepv-mozilla/plugin.cpp	2009-07-15 14:52:24.000000000 +0200
@@ -37,6 +37,7 @@
 
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <cstring>
 
 #include "plugin.h"
@@ -64,7 +65,7 @@
 
 nsPluginInstance::nsPluginInstance(nsPluginCreateData *pcd) : nsPluginInstanceBase(),
   mInstance( pcd->instance ),
-  mInitialized(FALSE)
+  mInitialized(0)
 {
     DEBUG_TRACE("");
     pCData = pcd;
@@ -97,7 +98,7 @@
     return NPN_UserAgent(mInstance);
 }
 
-NPError nsPluginInstance::NewStream(NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype)
+NPError nsPluginInstance::NewStream(NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype)
 {
     DEBUG_TRACE("mime type:" << type);
     if( m_fpvIgnoreStreams ) {
@@ -161,18 +162,18 @@
 	return NPERR_NO_ERROR;
 }
 
-int32 nsPluginInstance::WriteReady(NPStream* stream)
+int32_t nsPluginInstance::WriteReady(NPStream* stream)
 {
     DEBUG_TRACE("");
     return FPV_CHUNKSIZE;
 }
 
-int32 nsPluginInstance::Write(NPStream* stream, int32 offset, int32 len, void* buffer)
+int32_t nsPluginInstance::Write(NPStream* stream, int32_t offset, int32_t len, void* buffer)
 {
     DEBUG_TRACE("offset: " << offset << "  length: " << len);
     if (!m_fpvDownloadToFile) {
         // check if the data fits into the buffer...
-        if (offset+len >= (int32) m_fpvBufferSize) {
+        if (offset+len >= (int32_t) m_fpvBufferSize) {
             // allocate more memory
             unsigned char * newmem = (unsigned char*) realloc(m_fpvDownBuffer, m_fpvBufferSize*2);
             if (newmem == 0) {
diff -Naur freepv-0.3.0.orig/src/freepv-mozilla/plugin.h freepv-0.3.0/src/freepv-mozilla/plugin.h
--- freepv-0.3.0.orig/src/freepv-mozilla/plugin.h	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/src/freepv-mozilla/plugin.h	2009-07-15 14:52:29.000000000 +0200
@@ -73,10 +73,10 @@
 public:
 
     // these functions are called by the browser
-	NPError NewStream(NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
+	NPError NewStream(NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
 	NPError DestroyStream(NPStream* stream, NPError reason);
-	int32 WriteReady(NPStream* stream);
-	int32 Write(NPStream* stream, int32 offset, int32 len, void* buffer);
+	int32_t WriteReady(NPStream* stream);
+	int32_t Write(NPStream* stream, int32_t offset, int32_t len, void* buffer);
     void StreamAsFile(NPStream* stream, const char* fname);
 
 protected:
diff -Naur freepv-0.3.0.orig/src/libfreepv/SPiVparser.cpp freepv-0.3.0/src/libfreepv/SPiVparser.cpp
--- freepv-0.3.0.orig/src/libfreepv/SPiVparser.cpp	2009-07-15 14:48:53.000000000 +0200
+++ freepv-0.3.0/src/libfreepv/SPiVparser.cpp	2009-07-15 14:49:03.000000000 +0200
@@ -490,7 +490,7 @@
 {
     char * aux_url=NULL;
     char * url=(char*) _url;
-    if(aux_url = strrchr (_url,'/'))
+    if(aux_url == strrchr (_url,'/'))
     {
        url=aux_url;
        url++;