33 *netscape_minor = LOBYTE(NPNFuncs.version); |
33 *netscape_minor = LOBYTE(NPNFuncs.version); |
34 } |
34 } |
35 |
35 |
36 NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData) |
36 NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData) |
37 { |
37 { |
38 int navMinorVers = NPNFuncs.version & 0xFF; |
38 int navMinorVers = NPNFuncs.version & 0xFF; |
39 NPError rv = NPERR_NO_ERROR; |
39 NPError rv = NPERR_NO_ERROR; |
40 |
40 |
41 if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) |
41 if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) |
42 rv = CallNPN_GetURLNotifyProc(NPNFuncs.geturlnotify, instance, url, target, notifyData); |
42 rv = CallNPN_GetURLNotifyProc(NPNFuncs.geturlnotify, instance, url, target, notifyData); |
43 else |
43 else |
44 rv = NPERR_INCOMPATIBLE_VERSION_ERROR; |
44 rv = NPERR_INCOMPATIBLE_VERSION_ERROR; |
45 |
45 |
46 return rv; |
46 return rv; |
47 } |
47 } |
48 |
48 |
49 NPError NPN_GetURL(NPP instance, const char *url, const char *target) |
49 NPError NPN_GetURL(NPP instance, const char *url, const char *target) |
52 return rv; |
52 return rv; |
53 } |
53 } |
54 |
54 |
55 NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData) |
55 NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData) |
56 { |
56 { |
57 int navMinorVers = NPNFuncs.version & 0xFF; |
57 int navMinorVers = NPNFuncs.version & 0xFF; |
58 NPError rv = NPERR_NO_ERROR; |
58 NPError rv = NPERR_NO_ERROR; |
59 |
59 |
60 if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) |
60 if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) |
61 rv = CallNPN_PostURLNotifyProc(NPNFuncs.posturlnotify, instance, url, window, len, buf, file, notifyData); |
61 rv = CallNPN_PostURLNotifyProc(NPNFuncs.posturlnotify, instance, url, window, len, buf, file, notifyData); |
62 else |
62 else |
63 rv = NPERR_INCOMPATIBLE_VERSION_ERROR; |
63 rv = NPERR_INCOMPATIBLE_VERSION_ERROR; |
64 |
64 |
65 return rv; |
65 return rv; |
66 } |
66 } |
67 |
67 |
68 NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file) |
68 NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file) |
77 return rv; |
77 return rv; |
78 } |
78 } |
79 |
79 |
80 NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream) |
80 NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream) |
81 { |
81 { |
82 int navMinorVersion = NPNFuncs.version & 0xFF; |
82 int navMinorVersion = NPNFuncs.version & 0xFF; |
83 |
83 |
84 NPError rv = NPERR_NO_ERROR; |
84 NPError rv = NPERR_NO_ERROR; |
85 |
85 |
86 if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) |
86 if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) |
87 rv = CallNPN_NewStreamProc(NPNFuncs.newstream, instance, type, target, stream); |
87 rv = CallNPN_NewStreamProc(NPNFuncs.newstream, instance, type, target, stream); |
88 else |
88 else |
89 rv = NPERR_INCOMPATIBLE_VERSION_ERROR; |
89 rv = NPERR_INCOMPATIBLE_VERSION_ERROR; |
90 |
90 |
91 return rv; |
91 return rv; |
92 } |
92 } |
93 |
93 |
94 int32 NPN_Write(NPP instance, NPStream *stream, int32 len, void *buffer) |
94 int32 NPN_Write(NPP instance, NPStream *stream, int32 len, void *buffer) |
95 { |
95 { |
96 int navMinorVersion = NPNFuncs.version & 0xFF; |
96 int navMinorVersion = NPNFuncs.version & 0xFF; |
97 int32 rv = 0; |
97 int32 rv = 0; |
98 |
98 |
99 if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) |
99 if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) |
100 rv = CallNPN_WriteProc(NPNFuncs.write, instance, stream, len, buffer); |
100 rv = CallNPN_WriteProc(NPNFuncs.write, instance, stream, len, buffer); |
101 else |
101 else |
102 rv = -1; |
102 rv = -1; |
103 |
103 |
104 return rv; |
104 return rv; |
105 } |
105 } |
106 |
106 |
107 NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) |
107 NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) |
108 { |
108 { |
109 int navMinorVersion = NPNFuncs.version & 0xFF; |
109 int navMinorVersion = NPNFuncs.version & 0xFF; |
110 NPError rv = NPERR_NO_ERROR; |
110 NPError rv = NPERR_NO_ERROR; |
111 |
111 |
112 if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) |
112 if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) |
113 rv = CallNPN_DestroyStreamProc(NPNFuncs.destroystream, instance, stream, reason); |
113 rv = CallNPN_DestroyStreamProc(NPNFuncs.destroystream, instance, stream, reason); |
114 else |
114 else |
115 rv = NPERR_INCOMPATIBLE_VERSION_ERROR; |
115 rv = NPERR_INCOMPATIBLE_VERSION_ERROR; |
116 |
116 |
117 return rv; |
117 return rv; |
118 } |
118 } |
119 |
119 |
120 void NPN_Status(NPP instance, const char *message) |
120 void NPN_Status(NPP instance, const char *message) |
197 return NPNFuncs.releaseobject(obj); |
197 return NPNFuncs.releaseobject(obj); |
198 } |
198 } |
199 |
199 |
200 void NPN_PluginThreadAsyncCall (NPP instance, void (*func)(void *), void *userData) |
200 void NPN_PluginThreadAsyncCall (NPP instance, void (*func)(void *), void *userData) |
201 { |
201 { |
202 CallNPN_PluginThreadAsyncCallProc(NPNFuncs.pluginthreadasynccall, |
202 CallNPN_PluginThreadAsyncCallProc(NPNFuncs.pluginthreadasynccall, |
203 instance, func, userData); |
203 instance, func, userData); |
204 } |
204 } |