[vlc-commits] Declare methods in a similar way for Unix and Mac OS X
Jean-Baptiste Kempf
git at videolan.org
Thu Apr 24 12:02:41 CEST 2014
npapi-vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Apr 24 12:02:25 2014 +0200| [bf55a1fb2f7fdcceabf5275f01ba939cdc1e44dd] | committer: Jean-Baptiste Kempf
Declare methods in a similar way for Unix and Mac OS X
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=bf55a1fb2f7fdcceabf5275f01ba939cdc1e44dd
---
npapi/support/npmac.cpp | 53 ++++++++++++++++++++++++++--------------------
npapi/support/npunix.cpp | 13 ++++++------
2 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/npapi/support/npmac.cpp b/npapi/support/npmac.cpp
index 1ee0a92..c7b7628 100644
--- a/npapi/support/npmac.cpp
+++ b/npapi/support/npmac.cpp
@@ -410,29 +410,36 @@ void NPN_SetException(NPObject *npobj, const NPUTF8 *message)
#pragma mark -
#pragma mark Private Functions
-NPError
- Private_Initialize(void);
-void Private_Shutdown(void);
-NPError
- Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
-NPError
- Private_Destroy(NPP instance, NPSavedData** save);
-NPError
- Private_SetWindow(NPP instance, NPWindow* window);
-NPError
- Private_GetValue( NPP instance, NPPVariable variable, void *value);
-NPError
- Private_SetValue( NPP instance, NPPVariable variable, void *value);
-NPError
- Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
-NPError
- Private_DestroyStream(NPP instance, NPStream* stream, NPError reason);
-int32_t Private_WriteReady(NPP instance, NPStream* stream);
-int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
-void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
-void Private_Print(NPP instance, NPPrint* platformPrint);
-int16_t Private_HandleEvent(NPP instance, void* event);
-void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData);
+/***********************************************************************
+ *
+ * Wrapper functions : Netscape Navigator -> plugin
+ *
+ * These functions let the plugin developer just create the APIs
+ * as documented and defined in npapi.h, without needing to
+ * install those functions in the function table or worry about
+ * setting up globals for 68K plugins.
+ *
+ ***********************************************************************/
+
+/* Function prototypes */
+NPError Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
+ int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
+NPError Private_Destroy(NPP instance, NPSavedData** save);
+NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
+ NPBool seekable, uint16_t* stype);
+int32_t Private_WriteReady(NPP instance, NPStream* stream);
+int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
+void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
+NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason);
+void Private_Print(NPP instance, NPPrint* platformPrint);
+void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData);
+int16_t Private_HandleEvent(NPP instance, void* event);
+NPError Private_GetValue(NPP instance, NPPVariable variable, void *r_value);
+NPError Private_SetValue(NPP instance, NPNVariable variable, void *r_value);
+NPError Private_SetWindow(NPP instance, NPWindow* window);
+
+NPError Private_Initialize(void);
+void Private_Shutdown(void);
NPError
diff --git a/npapi/support/npunix.cpp b/npapi/support/npunix.cpp
index b6d1989..8641acc 100644
--- a/npapi/support/npunix.cpp
+++ b/npapi/support/npunix.cpp
@@ -498,20 +498,19 @@ void NPN_SetException(NPObject *npobj, const NPUTF8 *message)
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
NPError Private_Destroy(NPP instance, NPSavedData** save);
-NPError Private_SetWindow(NPP instance, NPWindow* window);
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
NPBool seekable, uint16_t* stype);
int32_t Private_WriteReady(NPP instance, NPStream* stream);
-int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset,
- int32_t len, void* buffer);
-void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
+int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
+void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason);
-void Private_URLNotify(NPP instance, const char* url,
- NPReason reason, void* notifyData);
-void Private_Print(NPP instance, NPPrint* platformPrint);
+void Private_Print(NPP instance, NPPrint* platformPrint);
+void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData);
int16_t Private_HandleEvent(NPP instance, NPEvent *event);
NPError Private_GetValue(NPP instance, NPPVariable variable, void *r_value);
NPError Private_SetValue(NPP instance, NPNVariable variable, void *r_value);
+NPError Private_SetWindow(NPP instance, NPWindow* window);
+
/* function implementations */
NPError
More information about the vlc-commits
mailing list