Back to index

lightning-sunbird  0.9+nobinonly
npupp.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 
00039 /*
00040  *  npupp.h $Revision: 3.20 $
00041  *  function call mecahnics needed by platform specific glue code.
00042  */
00043 
00044 
00045 #ifndef _NPUPP_H_
00046 #define _NPUPP_H_
00047 
00048 #if defined(__OS2__)
00049 #pragma pack(1)
00050 #endif
00051 
00052 #ifndef GENERATINGCFM
00053 #define GENERATINGCFM 0
00054 #endif
00055 
00056 #ifndef _NPAPI_H_
00057 #include "npapi.h"
00058 #endif
00059 
00060 #include "npruntime.h"
00061 
00062 #include "jri.h"
00063 
00064 /******************************************************************************************
00065    plug-in function table macros
00066                for each function in and out of the plugin API we define
00067                     typedef NPP_FooUPP
00068                                    #define NewNPP_FooProc
00069                                    #define CallNPP_FooProc
00070                      for mac, define the UPP magic for PPC/68K calling
00071  *******************************************************************************************/
00072 
00073 
00074 /* NPP_Initialize */
00075 
00076 #define _NPUPP_USE_UPP_ (TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON)
00077 
00078 #if _NPUPP_USE_UPP_
00079 typedef UniversalProcPtr NPP_InitializeUPP;
00080 
00081 enum {
00082        uppNPP_InitializeProcInfo = kThinkCStackBased
00083               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))              
00084               | RESULT_SIZE(SIZE_CODE(0))
00085 };
00086 
00087 #define NewNPP_InitializeProc(FUNC)              \
00088               (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture())
00089 #define CallNPP_InitializeProc(FUNC)             \
00090               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo)
00091               
00092 #else
00093 
00094 typedef void (* NP_LOADDS NPP_InitializeUPP)(void);
00095 #define NewNPP_InitializeProc(FUNC)              \
00096               ((NPP_InitializeUPP) (FUNC))
00097 #define CallNPP_InitializeProc(FUNC)             \
00098               (*(FUNC))()
00099 
00100 #endif
00101 
00102 
00103 /* NPP_Shutdown */
00104 
00105 #if _NPUPP_USE_UPP_
00106 typedef UniversalProcPtr NPP_ShutdownUPP;
00107 
00108 enum {
00109        uppNPP_ShutdownProcInfo = kThinkCStackBased
00110               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))              
00111               | RESULT_SIZE(SIZE_CODE(0))
00112 };
00113 
00114 #define NewNPP_ShutdownProc(FUNC)         \
00115               (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture())
00116 #define CallNPP_ShutdownProc(FUNC)        \
00117               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo)
00118               
00119 #else
00120 
00121 typedef void (* NP_LOADDS NPP_ShutdownUPP)(void);
00122 #define NewNPP_ShutdownProc(FUNC)         \
00123               ((NPP_ShutdownUPP) (FUNC))
00124 #define CallNPP_ShutdownProc(FUNC)        \
00125               (*(FUNC))()
00126 
00127 #endif
00128 
00129 
00130 /* NPP_New */
00131 
00132 #if _NPUPP_USE_UPP_
00133 typedef UniversalProcPtr NPP_NewUPP;
00134 
00135 enum {
00136        uppNPP_NewProcInfo = kThinkCStackBased
00137               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType)))
00138               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP)))
00139               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16)))
00140               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16)))
00141               | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **)))
00142               | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **)))
00143               | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *)))
00144               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00145 };
00146 
00147 #define NewNPP_NewProc(FUNC)              \
00148               (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture())
00149 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
00150               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \
00151                                                            (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
00152 #else
00153 
00154 typedef NPError      (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
00155 #define NewNPP_NewProc(FUNC)              \
00156               ((NPP_NewUPP) (FUNC))
00157 #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)             \
00158               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
00159 
00160 #endif
00161 
00162 
00163 /* NPP_Destroy */
00164 
00165 #if _NPUPP_USE_UPP_
00166 
00167 typedef UniversalProcPtr NPP_DestroyUPP;
00168 enum {
00169        uppNPP_DestroyProcInfo = kThinkCStackBased
00170               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00171               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **)))
00172               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00173 };
00174 #define NewNPP_DestroyProc(FUNC)          \
00175               (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture())
00176 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2)           \
00177               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2))
00178 #else
00179 
00180 typedef NPError      (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
00181 #define NewNPP_DestroyProc(FUNC)          \
00182               ((NPP_DestroyUPP) (FUNC))
00183 #define CallNPP_DestroyProc(FUNC, ARG1, ARG2)           \
00184               (*(FUNC))((ARG1), (ARG2))
00185 
00186 #endif
00187 
00188 
00189 /* NPP_SetWindow */
00190 
00191 #if _NPUPP_USE_UPP_
00192 
00193 typedef UniversalProcPtr NPP_SetWindowUPP;
00194 enum {
00195        uppNPP_SetWindowProcInfo = kThinkCStackBased
00196               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00197               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *)))
00198               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00199 };
00200 #define NewNPP_SetWindowProc(FUNC)        \
00201               (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture())
00202 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2)         \
00203               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2))
00204 
00205 #else
00206 
00207 typedef NPError      (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
00208 #define NewNPP_SetWindowProc(FUNC)        \
00209               ((NPP_SetWindowUPP) (FUNC))
00210 #define CallNPP_SetWindowProc(FUNC, ARG1, ARG2)         \
00211               (*(FUNC))((ARG1), (ARG2))
00212 
00213 #endif
00214 
00215 
00216 /* NPP_NewStream */
00217 
00218 #if _NPUPP_USE_UPP_
00219 
00220 typedef UniversalProcPtr NPP_NewStreamUPP;
00221 enum {
00222        uppNPP_NewStreamProcInfo = kThinkCStackBased
00223               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00224               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
00225               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *)))
00226               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool)))
00227               | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *)))
00228               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00229 };
00230 #define NewNPP_NewStreamProc(FUNC)        \
00231               (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture())
00232 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5)            \
00233               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
00234 #else
00235 
00236 typedef NPError      (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
00237 #define NewNPP_NewStreamProc(FUNC)        \
00238               ((NPP_NewStreamUPP) (FUNC))
00239 #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
00240               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
00241 #endif
00242 
00243 
00244 /* NPP_DestroyStream */
00245 
00246 #if _NPUPP_USE_UPP_
00247 
00248 typedef UniversalProcPtr NPP_DestroyStreamUPP;
00249 enum {
00250        uppNPP_DestroyStreamProcInfo = kThinkCStackBased
00251               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00252               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00253               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
00254               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00255 };
00256 #define NewNPP_DestroyStreamProc(FUNC)           \
00257               (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture())
00258 #define CallNPP_DestroyStreamProc(FUNC,  NPParg, NPStreamPtr, NPReasonArg)          \
00259               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg))
00260 
00261 #else
00262 
00263 typedef NPError      (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
00264 #define NewNPP_DestroyStreamProc(FUNC)           \
00265               ((NPP_DestroyStreamUPP) (FUNC))
00266 #define CallNPP_DestroyStreamProc(FUNC,  NPParg, NPStreamPtr, NPReasonArg)          \
00267               (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg))
00268 
00269 #endif
00270 
00271 
00272 /* NPP_WriteReady */
00273 
00274 #if _NPUPP_USE_UPP_
00275 
00276 typedef UniversalProcPtr NPP_WriteReadyUPP;
00277 enum {
00278        uppNPP_WriteReadyProcInfo = kThinkCStackBased
00279               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00280               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00281               | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
00282 };
00283 #define NewNPP_WriteReadyProc(FUNC)              \
00284               (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture())
00285 #define CallNPP_WriteReadyProc(FUNC,  NPParg, NPStreamPtr)            \
00286               (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr))
00287 
00288 #else
00289 
00290 typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
00291 #define NewNPP_WriteReadyProc(FUNC)              \
00292               ((NPP_WriteReadyUPP) (FUNC))
00293 #define CallNPP_WriteReadyProc(FUNC,  NPParg, NPStreamPtr)            \
00294               (*(FUNC))((NPParg), (NPStreamPtr))
00295 
00296 #endif
00297 
00298 
00299 /* NPP_Write */
00300 
00301 #if _NPUPP_USE_UPP_
00302 
00303 typedef UniversalProcPtr NPP_WriteUPP;
00304 enum {
00305        uppNPP_WriteProcInfo = kThinkCStackBased
00306               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00307               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00308               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
00309               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32)))
00310               | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*)))
00311               | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
00312 };
00313 #define NewNPP_WriteProc(FUNC)            \
00314               (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture())
00315 #define CallNPP_WriteProc(FUNC,  NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr)        \
00316               (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
00317 
00318 #else
00319 
00320 typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
00321 #define NewNPP_WriteProc(FUNC)            \
00322               ((NPP_WriteUPP) (FUNC))
00323 #define CallNPP_WriteProc(FUNC,  NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr)        \
00324               (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
00325 
00326 #endif
00327 
00328 
00329 /* NPP_StreamAsFile */
00330 
00331 #if _NPUPP_USE_UPP_
00332 
00333 typedef UniversalProcPtr NPP_StreamAsFileUPP;
00334 enum {
00335        uppNPP_StreamAsFileProcInfo = kThinkCStackBased
00336               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00337               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00338               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
00339               | RESULT_SIZE(SIZE_CODE(0))
00340 };
00341 #define NewNPP_StreamAsFileProc(FUNC)            \
00342               (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture())
00343 #define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3)              \
00344               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3))
00345 
00346 #else
00347 
00348 typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
00349 #define NewNPP_StreamAsFileProc(FUNC)            \
00350               ((NPP_StreamAsFileUPP) (FUNC))
00351 #define CallNPP_StreamAsFileProc(FUNC,  ARG1, ARG2, ARG3)             \
00352               (*(FUNC))((ARG1), (ARG2), (ARG3))
00353 #endif
00354 
00355 
00356 /* NPP_Print */
00357 
00358 #if _NPUPP_USE_UPP_
00359 
00360 typedef UniversalProcPtr NPP_PrintUPP;
00361 enum {
00362        uppNPP_PrintProcInfo = kThinkCStackBased
00363               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00364               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *)))
00365               | RESULT_SIZE(SIZE_CODE(0))
00366 };
00367 #define NewNPP_PrintProc(FUNC)            \
00368               (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture())
00369 #define CallNPP_PrintProc(FUNC,  NPParg, voidPtr)              \
00370               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr))
00371 
00372 #else
00373 
00374 typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
00375 #define NewNPP_PrintProc(FUNC)            \
00376               ((NPP_PrintUPP) (FUNC))
00377 #define CallNPP_PrintProc(FUNC,  NPParg, NPPrintArg)           \
00378               (*(FUNC))((NPParg), (NPPrintArg))
00379 
00380 #endif
00381 
00382 
00383 /* NPP_HandleEvent */
00384 
00385 #if _NPUPP_USE_UPP_
00386 
00387 typedef UniversalProcPtr NPP_HandleEventUPP;
00388 enum {
00389        uppNPP_HandleEventProcInfo = kThinkCStackBased
00390               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00391               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
00392               | RESULT_SIZE(SIZE_CODE(sizeof(int16)))
00393 };
00394 #define NewNPP_HandleEventProc(FUNC)             \
00395               (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture())
00396 #define CallNPP_HandleEventProc(FUNC,  NPParg, voidPtr)        \
00397               (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr))
00398 
00399 #else
00400 
00401 typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
00402 #define NewNPP_HandleEventProc(FUNC)             \
00403               ((NPP_HandleEventUPP) (FUNC))
00404 #define CallNPP_HandleEventProc(FUNC,  NPParg, voidPtr)        \
00405               (*(FUNC))((NPParg), (voidPtr))
00406 
00407 #endif
00408 
00409 
00410 /* NPP_URLNotify */
00411 
00412 #if _NPUPP_USE_UPP_
00413 
00414 typedef UniversalProcPtr NPP_URLNotifyUPP;
00415 enum {
00416        uppNPP_URLNotifyProcInfo = kThinkCStackBased
00417               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00418               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00419               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
00420               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
00421               | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0)))
00422 };
00423 #define NewNPP_URLNotifyProc(FUNC)        \
00424               (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture())
00425 #define CallNPP_URLNotifyProc(FUNC,  ARG1, ARG2, ARG3, ARG4)          \
00426               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
00427 
00428 #else
00429 
00430 typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
00431 #define NewNPP_URLNotifyProc(FUNC)        \
00432               ((NPP_URLNotifyUPP) (FUNC))
00433 #define CallNPP_URLNotifyProc(FUNC,  ARG1, ARG2, ARG3, ARG4)          \
00434               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
00435 
00436 #endif
00437 
00438 
00439 /* NPP_GetValue */
00440 
00441 #if _NPUPP_USE_UPP_
00442 
00443 typedef UniversalProcPtr NPP_GetValueUPP;
00444 enum {
00445        uppNPP_GetValueProcInfo = kThinkCStackBased
00446               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00447               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
00448               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
00449               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00450 };
00451 #define NewNPP_GetValueProc(FUNC)         \
00452               (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_GetValueProcInfo, GetCurrentArchitecture())
00453 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
00454               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
00455 #else
00456 
00457 typedef NPError      (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
00458 #define NewNPP_GetValueProc(FUNC)         \
00459               ((NPP_GetValueUPP) (FUNC))
00460 #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3)           \
00461               (*(FUNC))((ARG1), (ARG2), (ARG3))
00462 #endif
00463 
00464 
00465 /* NPP_SetValue */
00466 
00467 #if _NPUPP_USE_UPP_
00468 
00469 typedef UniversalProcPtr NPP_SetValueUPP;
00470 enum {
00471        uppNPP_SetValueProcInfo = kThinkCStackBased
00472               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00473               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
00474               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
00475               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00476 };
00477 #define NewNPP_SetValueProc(FUNC)         \
00478               (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetValueProcInfo, GetCurrentArchitecture())
00479 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
00480               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
00481 #else
00482 
00483 typedef NPError      (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
00484 #define NewNPP_SetValueProc(FUNC)         \
00485               ((NPP_SetValueUPP) (FUNC))
00486 #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3)           \
00487               (*(FUNC))((ARG1), (ARG2), (ARG3))
00488 #endif
00489 
00490 
00491 /*
00492  *  Netscape entry points
00493  */
00494 
00495 
00496 /* NPN_GetValue */
00497 
00498 #if _NPUPP_USE_UPP_
00499 
00500 typedef UniversalProcPtr NPN_GetValueUPP;
00501 enum {
00502        uppNPN_GetValueProcInfo = kThinkCStackBased
00503               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00504               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
00505               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
00506               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00507 };
00508 #define NewNPN_GetValueProc(FUNC)         \
00509               (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture())
00510 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
00511               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
00512 #else
00513 
00514 typedef NPError      (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
00515 #define NewNPN_GetValueProc(FUNC)         \
00516               ((NPN_GetValueUPP) (FUNC))
00517 #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3)           \
00518               (*(FUNC))((ARG1), (ARG2), (ARG3))
00519 #endif
00520 
00521 
00522 /* NPN_SetValue */
00523 
00524 #if _NPUPP_USE_UPP_
00525 
00526 typedef UniversalProcPtr NPN_SetValueUPP;
00527 enum {
00528        uppNPN_SetValueProcInfo = kThinkCStackBased
00529               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00530               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
00531               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
00532               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00533 };
00534 #define NewNPN_SetValueProc(FUNC)         \
00535               (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetValueProcInfo, GetCurrentArchitecture())
00536 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
00537               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
00538 #else
00539 
00540 typedef NPError      (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
00541 #define NewNPN_SetValueProc(FUNC)         \
00542               ((NPN_SetValueUPP) (FUNC))
00543 #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3)           \
00544               (*(FUNC))((ARG1), (ARG2), (ARG3))
00545 #endif
00546 
00547 
00548 /* NPN_GetUrlNotify */
00549 
00550 #if _NPUPP_USE_UPP_
00551 
00552 typedef UniversalProcPtr NPN_GetURLNotifyUPP;
00553 enum {
00554        uppNPN_GetURLNotifyProcInfo = kThinkCStackBased
00555               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00556               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00557               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
00558               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
00559               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00560 };
00561 #define NewNPN_GetURLNotifyProc(FUNC)            \
00562               (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture())
00563 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
00564               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
00565 #else
00566 
00567 typedef NPError      (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
00568 #define NewNPN_GetURLNotifyProc(FUNC)            \
00569               ((NPN_GetURLNotifyUPP) (FUNC))
00570 #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4)        \
00571               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
00572 #endif
00573 
00574 
00575 /* NPN_PostUrlNotify */
00576 
00577 #if _NPUPP_USE_UPP_
00578 
00579 typedef UniversalProcPtr NPN_PostURLNotifyUPP;
00580 enum {
00581        uppNPN_PostURLNotifyProcInfo = kThinkCStackBased
00582               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00583               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00584               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
00585               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
00586               | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
00587               | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
00588               | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*)))
00589               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00590 };
00591 #define NewNPN_PostURLNotifyProc(FUNC)           \
00592               (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture())
00593 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
00594               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
00595 #else
00596 
00597 typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
00598 #define NewNPN_PostURLNotifyProc(FUNC)           \
00599               ((NPN_PostURLNotifyUPP) (FUNC))
00600 #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
00601               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
00602 #endif
00603 
00604 
00605 /* NPN_GetUrl */
00606 
00607 #if _NPUPP_USE_UPP_
00608 
00609 typedef UniversalProcPtr NPN_GetURLUPP;
00610 enum {
00611        uppNPN_GetURLProcInfo = kThinkCStackBased
00612               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00613               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00614               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
00615               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00616 };
00617 #define NewNPN_GetURLProc(FUNC)           \
00618               (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture())
00619 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
00620               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3))
00621 #else
00622 
00623 typedef NPError      (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
00624 #define NewNPN_GetURLProc(FUNC)           \
00625               ((NPN_GetURLUPP) (FUNC))
00626 #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3)             \
00627               (*(FUNC))((ARG1), (ARG2), (ARG3))
00628 #endif
00629 
00630 
00631 /* NPN_PostUrl */
00632 
00633 #if _NPUPP_USE_UPP_
00634 
00635 typedef UniversalProcPtr NPN_PostURLUPP;
00636 enum {
00637        uppNPN_PostURLProcInfo = kThinkCStackBased
00638               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00639               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
00640               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
00641               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
00642               | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
00643               | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
00644               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00645 };
00646 #define NewNPN_PostURLProc(FUNC)          \
00647               (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture())
00648 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
00649               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
00650 #else
00651 
00652 typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
00653 #define NewNPN_PostURLProc(FUNC)          \
00654               ((NPN_PostURLUPP) (FUNC))
00655 #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
00656               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
00657 #endif
00658 
00659 
00660 /* NPN_RequestRead */
00661 
00662 #if _NPUPP_USE_UPP_
00663 
00664 typedef UniversalProcPtr NPN_RequestReadUPP;
00665 enum {
00666        uppNPN_RequestReadProcInfo = kThinkCStackBased
00667               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *)))
00668               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *)))
00669               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00670 };
00671 #define NewNPN_RequestReadProc(FUNC)             \
00672               (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture())
00673 #define CallNPN_RequestReadProc(FUNC,  stream, range)          \
00674               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range))
00675 
00676 #else
00677 
00678 typedef NPError      (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
00679 #define NewNPN_RequestReadProc(FUNC)             \
00680               ((NPN_RequestReadUPP) (FUNC))
00681 #define CallNPN_RequestReadProc(FUNC, stream, range)           \
00682               (*(FUNC))((stream), (range))
00683 
00684 #endif
00685 
00686 
00687 /* NPN_NewStream */
00688 
00689 #if _NPUPP_USE_UPP_
00690 
00691 typedef UniversalProcPtr NPN_NewStreamUPP;
00692 enum {
00693        uppNPN_NewStreamProcInfo = kThinkCStackBased
00694               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00695               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
00696               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
00697               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **)))
00698               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00699 };
00700 #define NewNPN_NewStreamProc(FUNC)        \
00701               (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture())
00702 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream)        \
00703               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream))      
00704 
00705 #else
00706 
00707 typedef NPError      (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
00708 #define NewNPN_NewStreamProc(FUNC)        \
00709               ((NPN_NewStreamUPP) (FUNC))
00710 #define CallNPN_NewStreamProc(FUNC, npp, type, window, stream)        \
00711               (*(FUNC))((npp), (type), (window), (stream))
00712 
00713 #endif
00714 
00715 
00716 /* NPN_Write */
00717 
00718 #if _NPUPP_USE_UPP_
00719 
00720 typedef UniversalProcPtr NPN_WriteUPP;
00721 enum {
00722        uppNPN_WriteProcInfo = kThinkCStackBased
00723               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00724               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00725               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
00726               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
00727               | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
00728 };
00729 #define NewNPN_WriteProc(FUNC)            \
00730               (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture())
00731 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer)             \
00732               (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer))      
00733 
00734 #else
00735 
00736 typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
00737 #define NewNPN_WriteProc(FUNC)            \
00738               ((NPN_WriteUPP) (FUNC))
00739 #define CallNPN_WriteProc(FUNC, npp, stream, len, buffer)             \
00740               (*(FUNC))((npp), (stream), (len), (buffer))
00741 
00742 #endif
00743 
00744 
00745 /* NPN_DestroyStream */
00746 
00747 #if _NPUPP_USE_UPP_
00748 
00749 typedef UniversalProcPtr NPN_DestroyStreamUPP;
00750 enum {
00751        uppNPN_DestroyStreamProcInfo = kThinkCStackBased
00752               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
00753               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
00754               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
00755               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
00756 };
00757 #define NewNPN_DestroyStreamProc(FUNC)           \
00758               (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture())
00759 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason)          \
00760               (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason))   
00761 
00762 #else
00763 
00764 typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
00765 #define NewNPN_DestroyStreamProc(FUNC)           \
00766               ((NPN_DestroyStreamUPP) (FUNC))
00767 #define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason)          \
00768               (*(FUNC))((npp), (stream), (reason))
00769 
00770 #endif
00771 
00772 
00773 /* NPN_Status */
00774 
00775 #if _NPUPP_USE_UPP_
00776 
00777 typedef UniversalProcPtr NPN_StatusUPP;
00778 enum {
00779        uppNPN_StatusProcInfo = kThinkCStackBased
00780               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00781               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
00782 };
00783 
00784 #define NewNPN_StatusProc(FUNC)           \
00785               (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture())
00786 #define CallNPN_StatusProc(FUNC, npp, msg)              \
00787               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg))     
00788 
00789 #else
00790 
00791 typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
00792 #define NewNPN_StatusProc(FUNC)           \
00793               ((NPN_StatusUPP) (FUNC))
00794 #define CallNPN_StatusProc(FUNC, npp, msg)              \
00795               (*(FUNC))((npp), (msg))     
00796 
00797 #endif
00798 
00799 
00800 /* NPN_UserAgent */
00801 #if _NPUPP_USE_UPP_
00802 
00803 typedef UniversalProcPtr NPN_UserAgentUPP;
00804 enum {
00805         uppNPN_UserAgentProcInfo = kThinkCStackBased
00806                 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00807                 | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
00808 };
00809 
00810 #define NewNPN_UserAgentProc(FUNC)              \
00811                 (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture())
00812 #define CallNPN_UserAgentProc(FUNC, ARG1)               \
00813                 (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1))
00814 
00815 #else
00816 
00817 typedef const char*  (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
00818 #define NewNPN_UserAgentProc(FUNC)              \
00819                 ((NPN_UserAgentUPP) (FUNC))
00820 #define CallNPN_UserAgentProc(FUNC, ARG1)               \
00821                 (*(FUNC))((ARG1))
00822 
00823 #endif
00824 
00825 
00826 /* NPN_MemAlloc */
00827 #if _NPUPP_USE_UPP_
00828 
00829 typedef UniversalProcPtr NPN_MemAllocUPP;
00830 enum {
00831        uppNPN_MemAllocProcInfo = kThinkCStackBased
00832               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
00833               | RESULT_SIZE(SIZE_CODE(sizeof(void *)))
00834 };
00835 
00836 #define NewNPN_MemAllocProc(FUNC)         \
00837               (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture())
00838 #define CallNPN_MemAllocProc(FUNC, ARG1)         \
00839               (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1)) 
00840 
00841 #else
00842 
00843 typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size);
00844 #define NewNPN_MemAllocProc(FUNC)         \
00845               ((NPN_MemAllocUPP) (FUNC))
00846 #define CallNPN_MemAllocProc(FUNC, ARG1)         \
00847               (*(FUNC))((ARG1))    
00848 
00849 #endif
00850 
00851 
00852 /* NPN__MemFree */
00853 
00854 #if _NPUPP_USE_UPP_
00855 
00856 typedef UniversalProcPtr NPN_MemFreeUPP;
00857 enum {
00858        uppNPN_MemFreeProcInfo = kThinkCStackBased
00859               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *)))
00860 };
00861 
00862 #define NewNPN_MemFreeProc(FUNC)          \
00863               (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture())
00864 #define CallNPN_MemFreeProc(FUNC, ARG1)          \
00865               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1))
00866 
00867 #else
00868 
00869 typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
00870 #define NewNPN_MemFreeProc(FUNC)          \
00871               ((NPN_MemFreeUPP) (FUNC))
00872 #define CallNPN_MemFreeProc(FUNC, ARG1)          \
00873               (*(FUNC))((ARG1))    
00874 
00875 #endif
00876 
00877 
00878 /* NPN_MemFlush */
00879 
00880 #if _NPUPP_USE_UPP_
00881 
00882 typedef UniversalProcPtr NPN_MemFlushUPP;
00883 enum {
00884        uppNPN_MemFlushProcInfo = kThinkCStackBased
00885               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
00886               | RESULT_SIZE(SIZE_CODE(sizeof(uint32)))
00887 };
00888 
00889 #define NewNPN_MemFlushProc(FUNC)         \
00890               (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture())
00891 #define CallNPN_MemFlushProc(FUNC, ARG1)         \
00892               (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1))       
00893 
00894 #else
00895 
00896 typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size);
00897 #define NewNPN_MemFlushProc(FUNC)         \
00898               ((NPN_MemFlushUPP) (FUNC))
00899 #define CallNPN_MemFlushProc(FUNC, ARG1)         \
00900               (*(FUNC))((ARG1))    
00901 
00902 #endif
00903 
00904 
00905 
00906 /* NPN_ReloadPlugins */
00907 
00908 #if _NPUPP_USE_UPP_
00909 
00910 typedef UniversalProcPtr NPN_ReloadPluginsUPP;
00911 enum {
00912        uppNPN_ReloadPluginsProcInfo = kThinkCStackBased
00913               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool)))
00914               | RESULT_SIZE(SIZE_CODE(0))
00915 };
00916 
00917 #define NewNPN_ReloadPluginsProc(FUNC)           \
00918               (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture())
00919 #define CallNPN_ReloadPluginsProc(FUNC, ARG1)           \
00920               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1))    
00921 
00922 #else
00923 
00924 typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
00925 #define NewNPN_ReloadPluginsProc(FUNC)           \
00926               ((NPN_ReloadPluginsUPP) (FUNC))
00927 #define CallNPN_ReloadPluginsProc(FUNC, ARG1)           \
00928               (*(FUNC))((ARG1))    
00929 
00930 #endif
00931 
00932 /* NPN_GetJavaEnv */
00933 
00934 #if _NPUPP_USE_UPP_
00935 
00936 typedef UniversalProcPtr NPN_GetJavaEnvUPP;
00937 enum {
00938        uppNPN_GetJavaEnvProcInfo = kThinkCStackBased
00939               | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*)))
00940 };
00941 
00942 #define NewNPN_GetJavaEnvProc(FUNC)              \
00943               (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture())
00944 #define CallNPN_GetJavaEnvProc(FUNC)             \
00945               (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo)     
00946 
00947 #else
00948 typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
00949 #define NewNPN_GetJavaEnvProc(FUNC)              \
00950               ((NPN_GetJavaEnvUPP) (FUNC))
00951 #define CallNPN_GetJavaEnvProc(FUNC)             \
00952               (*(FUNC))()   
00953 
00954 #endif
00955 
00956 
00957 /* NPN_GetJavaPeer */
00958 
00959 #if _NPUPP_USE_UPP_
00960 
00961 typedef UniversalProcPtr NPN_GetJavaPeerUPP;
00962 enum {
00963        uppNPN_GetJavaPeerProcInfo = kThinkCStackBased
00964               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00965               | RESULT_SIZE(SIZE_CODE(sizeof(jref)))
00966 };
00967 
00968 #define NewNPN_GetJavaPeerProc(FUNC)             \
00969               (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture())
00970 #define CallNPN_GetJavaPeerProc(FUNC, ARG1)             \
00971               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1))      
00972 
00973 #else
00974 
00975 typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
00976 #define NewNPN_GetJavaPeerProc(FUNC)             \
00977               ((NPN_GetJavaPeerUPP) (FUNC))
00978 #define CallNPN_GetJavaPeerProc(FUNC, ARG1)             \
00979               (*(FUNC))((ARG1))    
00980 
00981 #endif
00982 
00983 /* NPN_InvalidateRect */
00984 
00985 #if _NPUPP_USE_UPP_
00986 
00987 typedef UniversalProcPtr NPN_InvalidateRectUPP;
00988 enum {
00989        uppNPN_InvalidateRectProcInfo = kThinkCStackBased
00990               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
00991               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *)))
00992               | RESULT_SIZE(SIZE_CODE(0))
00993 };
00994 
00995 #define NewNPN_InvalidateRectProc(FUNC)          \
00996               (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, GetCurrentArchitecture())
00997 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2)           \
00998               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, (ARG1), (ARG2))  
00999 
01000 #else
01001 
01002 typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect);
01003 #define NewNPN_InvalidateRectProc(FUNC)          \
01004               ((NPN_InvalidateRectUPP) (FUNC))
01005 #define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2)           \
01006               (*(FUNC))((ARG1), (ARG2))   
01007 
01008 #endif
01009 
01010 
01011 /* NPN_InvalidateRegion */
01012 
01013 #if _NPUPP_USE_UPP_
01014 
01015 typedef UniversalProcPtr NPN_InvalidateRegionUPP;
01016 enum {
01017        uppNPN_InvalidateRegionProcInfo = kThinkCStackBased
01018               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01019               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion)))
01020               | RESULT_SIZE(SIZE_CODE(0))
01021 };
01022 
01023 #define NewNPN_InvalidateRegionProc(FUNC)        \
01024               (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture())
01025 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2)         \
01026               (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, (ARG1), (ARG2))       
01027 
01028 #else
01029 
01030 typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region);
01031 #define NewNPN_InvalidateRegionProc(FUNC)        \
01032               ((NPN_InvalidateRegionUPP) (FUNC))
01033 #define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2)         \
01034               (*(FUNC))((ARG1), (ARG2))   
01035 
01036 #endif
01037 
01038 /* NPN_ForceRedraw */
01039 
01040 #if _NPUPP_USE_UPP_
01041 
01042 typedef UniversalProcPtr NPN_ForceRedrawUPP;
01043 enum {
01044        uppNPN_ForceRedrawProcInfo = kThinkCStackBased
01045               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01046               | RESULT_SIZE(SIZE_CODE(sizeof(0)))
01047 };
01048 
01049 #define NewNPN_ForceRedrawProc(FUNC)             \
01050               (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, GetCurrentArchitecture())
01051 #define CallNPN_ForceRedrawProc(FUNC, ARG1)             \
01052               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, (ARG1))      
01053 
01054 #else
01055 
01056 typedef void (* NP_LOADDS NPN_ForceRedrawUPP)(NPP instance);
01057 #define NewNPN_ForceRedrawProc(FUNC)             \
01058               ((NPN_ForceRedrawUPP) (FUNC))
01059 #define CallNPN_ForceRedrawProc(FUNC, ARG1)             \
01060               (*(FUNC))((ARG1))    
01061 
01062 #endif
01063 
01064 /* NPN_GetStringIdentifier */
01065 
01066 #if _NPUPP_USE_UPP_
01067 
01068 typedef UniversalProcPtr NPN_GetStringIdentifierUPP;
01069 enum {
01070        uppNPN_GetStringIdentifierProcInfo = kThinkCStackBased
01071               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const NPUTF8*)))
01072               | RESULT_SIZE(SIZE_CODE(sizeof(NPIdentifier)))
01073 };
01074 
01075 #define NewNPN_GetStringIdentifierProc(FUNC)            \
01076               (NPN_GetStringIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetStringIdentifierProcInfo, GetCurrentArchitecture())
01077 #define CallNPN_GetStringIdentifierProc(FUNC, ARG1)            \
01078               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetStringIdentifierProcInfo, (ARG1))     
01079 
01080 #else
01081 
01082 typedef NPIdentifier (* NP_LOADDS NPN_GetStringIdentifierUPP)(const NPUTF8* name);
01083 #define NewNPN_GetStringIdentifierProc(FUNC)            \
01084               ((NPN_GetStringIdentifierUPP) (FUNC))
01085 #define CallNPN_GetStringIdentifierProc(FUNC, ARG1)            \
01086               (*(FUNC))((ARG1))
01087 
01088 #endif
01089 
01090 /* NPN_GetStringIdentifiers */
01091 
01092 #if _NPUPP_USE_UPP_
01093 
01094 typedef UniversalProcPtr NPN_GetStringIdentifiersUPP;
01095 enum {
01096        uppNPN_GetStringIdentifiersProcInfo = kThinkCStackBased
01097               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const NPUTF8**)))
01098               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int32_t)))
01099               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier*)))
01100         | RESULT_SIZE(SIZE_CODE(0))
01101 };
01102 
01103 #define NewNPN_GetStringIdentifiersProc(FUNC)           \
01104               (NPN_GetStringIdentifiersUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetStringIdentifiersProcInfo, GetCurrentArchitecture())
01105 #define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3)             \
01106               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetStringIdentifiersProcInfo, (ARG1), (ARG2), (ARG3))  
01107 
01108 #else
01109 
01110 typedef void (* NP_LOADDS NPN_GetStringIdentifiersUPP)(const NPUTF8** names,
01111                                                  int32_t nameCount,
01112                                                  NPIdentifier* identifiers);
01113 #define NewNPN_GetStringIdentifiersProc(FUNC)           \
01114               ((NPN_GetStringIdentifiersUPP) (FUNC))
01115 #define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3)             \
01116               (*(FUNC))((ARG1), (ARG2), (ARG3))
01117 
01118 #endif
01119 
01120 /* NPN_GetIntIdentifier */
01121 
01122 #if _NPUPP_USE_UPP_
01123 
01124 typedef UniversalProcPtr NPN_GetIntIdentifierUPP;
01125 enum {
01126        uppNPN_GetIntIdentifierProcInfo = kThinkCStackBased
01127               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(int32_t)))
01128               | RESULT_SIZE(SIZE_CODE(sizeof(NPIdentifier)))
01129 };
01130 
01131 #define NewNPN_GetIntIdentifierProc(FUNC)        \
01132               (NPN_GetIntIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetIntIdentifierProcInfo, GetCurrentArchitecture())
01133 #define CallNPN_GetIntIdentifierProc(FUNC, ARG1)        \
01134               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetIntIdentifierProcInfo, (ARG1)) 
01135 
01136 #else
01137 
01138 typedef NPIdentifier (* NP_LOADDS NPN_GetIntIdentifierUPP)(int32_t intid);
01139 #define NewNPN_GetIntIdentifierProc(FUNC)        \
01140               ((NPN_GetIntIdentifierUPP) (FUNC))
01141 #define CallNPN_GetIntIdentifierProc(FUNC, ARG1)        \
01142               (*(FUNC))((ARG1))
01143 
01144 #endif
01145 
01146 /* NPN_IdentifierIsString */
01147 
01148 #if _NPUPP_USE_UPP_
01149 
01150 typedef UniversalProcPtr NPN_IdentifierIsStringUPP;
01151 enum {
01152        uppNPN_IdentifierIsStringProcInfo = kThinkCStackBased
01153               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier identifier)))
01154               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01155 };
01156 
01157 #define NewNPN_IdentifierIsStringProc(FUNC)             \
01158               (NPN_IdentifierIsStringUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_IdentifierIsStringProcInfo, GetCurrentArchitecture())
01159 #define CallNPN_IdentifierIsStringProc(FUNC, ARG1)             \
01160               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_IdentifierIsStringProcInfo, (ARG1))      
01161 
01162 #else
01163 
01164 typedef bool (* NP_LOADDS NPN_IdentifierIsStringUPP)(NPIdentifier identifier);
01165 #define NewNPN_IdentifierIsStringProc(FUNC)             \
01166               ((NPN_IdentifierIsStringUPP) (FUNC))
01167 #define CallNPN_IdentifierIsStringProc(FUNC, ARG1)             \
01168               (*(FUNC))((ARG1))
01169 
01170 #endif
01171 
01172 /* NPN_UTF8FromIdentifier */
01173 
01174 #if _NPUPP_USE_UPP_
01175 
01176 typedef UniversalProcPtr NPN_UTF8FromIdentifierUPP;
01177 enum {
01178        uppNPN_UTF8FromIdentifierProcInfo = kThinkCStackBased
01179               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier)))
01180               | RESULT_SIZE(SIZE_CODE(sizeof(NPUTF8*)))
01181 };
01182 
01183 #define NewNPN_UTF8FromIdentifierProc(FUNC)             \
01184               (NPN_UTF8FromIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UTF8FromIdentifierProcInfo, GetCurrentArchitecture())
01185 #define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1)             \
01186               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UTF8FromIdentifierProcInfo, (ARG1))      
01187 
01188 #else
01189 
01190 typedef NPUTF8* (* NP_LOADDS NPN_UTF8FromIdentifierUPP)(NPIdentifier identifier);
01191 #define NewNPN_UTF8FromIdentifierProc(FUNC)             \
01192               ((NPN_UTF8FromIdentifierUPP) (FUNC))
01193 #define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1)             \
01194               (*(FUNC))((ARG1))
01195 
01196 #endif
01197 
01198 /* NPN_IntFromIdentifier */
01199 
01200 #if _NPUPP_USE_UPP_
01201 
01202 typedef UniversalProcPtr NPN_IntFromIdentifierUPP;
01203 enum {
01204        uppNPN_IntFromIdentifierProcInfo = kThinkCStackBased
01205               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier)))
01206               | RESULT_SIZE(SIZE_CODE(sizeof(int32_t)))
01207 };
01208 
01209 #define NewNPN_IntFromIdentifierProc(FUNC)              \
01210               (NPN_IntFromIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_IntFromIdentifierProcInfo, GetCurrentArchitecture())
01211 #define CallNPN_IntFromIdentifierProc(FUNC, ARG1)              \
01212               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_IntFromIdentifierProcInfo, (ARG1))       
01213 
01214 #else
01215 
01216 typedef int32_t (* NP_LOADDS NPN_IntFromIdentifierUPP)(NPIdentifier identifier);
01217 #define NewNPN_IntFromIdentifierProc(FUNC)              \
01218               ((NPN_IntFromIdentifierUPP) (FUNC))
01219 #define CallNPN_IntFromIdentifierProc(FUNC, ARG1)              \
01220               (*(FUNC))((ARG1))
01221 
01222 #endif
01223 
01224 /* NPN_CreateObject */
01225 
01226 #if _NPUPP_USE_UPP_
01227 
01228 typedef UniversalProcPtr NPN_CreateObjectUPP;
01229 enum {
01230        uppNPN_CreateObjectProcInfo = kThinkCStackBased
01231               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01232               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPClass*)))
01233               | RESULT_SIZE(SIZE_CODE(sizeof(NPObject*)))
01234 };
01235 
01236 #define NewNPN_CreateObjectProc(FUNC)            \
01237               (NPN_CreateObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_CreateObjectProcInfo, GetCurrentArchitecture())
01238 #define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2)             \
01239               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_CreateObjectProcInfo, (ARG1), (ARG2))    
01240 
01241 #else
01242 
01243 typedef NPObject* (* NP_LOADDS NPN_CreateObjectUPP)(NPP npp, NPClass *aClass);
01244 #define NewNPN_CreateObjectProc(FUNC)            \
01245               ((NPN_CreateObjectUPP) (FUNC))
01246 #define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2)             \
01247               (*(FUNC))((ARG1), (ARG2))
01248 
01249 #endif
01250 
01251 /* NPN_RetainObject */
01252 
01253 #if _NPUPP_USE_UPP_
01254 
01255 typedef UniversalProcPtr NPN_RetainObjectUPP;
01256 enum {
01257        uppNPN_RetainObjectProcInfo = kThinkCStackBased
01258               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
01259               | RESULT_SIZE(SIZE_CODE(sizeof(NPObject*)))
01260 };
01261 
01262 #define NewNPN_RetainObjectProc(FUNC)            \
01263               (NPN_RetainObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RetainObjectProcInfo, GetCurrentArchitecture())
01264 #define CallNPN_RetainObjectProc(FUNC, ARG1)            \
01265               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RetainObjectProcInfo, (ARG1))     
01266 
01267 #else
01268 
01269 typedef NPObject* (* NP_LOADDS NPN_RetainObjectUPP)(NPObject *obj);
01270 #define NewNPN_RetainObjectProc(FUNC)            \
01271               ((NPN_RetainObjectUPP) (FUNC))
01272 #define CallNPN_RetainObjectProc(FUNC, ARG1)            \
01273               (*(FUNC))((ARG1))
01274 
01275 #endif
01276 
01277 /* NPN_ReleaseObject */
01278 
01279 #if _NPUPP_USE_UPP_
01280 
01281 typedef UniversalProcPtr NPN_ReleaseObjectUPP;
01282 enum {
01283        uppNPN_ReleaseObjectProcInfo = kThinkCStackBased
01284               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
01285               | RESULT_SIZE(SIZE_CODE(0))
01286 };
01287 
01288 #define NewNPN_ReleaseObjectProc(FUNC)           \
01289               (NPN_ReleaseObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReleaseObjectProcInfo, GetCurrentArchitecture())
01290 #define CallNPN_ReleaseObjectProc(FUNC, ARG1)           \
01291               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReleaseObjectProcInfo, (ARG1))
01292 
01293 #else
01294 
01295 typedef void (* NP_LOADDS NPN_ReleaseObjectUPP)(NPObject *obj);
01296 #define NewNPN_ReleaseObjectProc(FUNC)           \
01297               ((NPN_ReleaseObjectUPP) (FUNC))
01298 #define CallNPN_ReleaseObjectProc(FUNC, ARG1)           \
01299               (*(FUNC))((ARG1))
01300 
01301 #endif
01302 
01303 /* NPN_Invoke */
01304 
01305 #if _NPUPP_USE_UPP_
01306 
01307 typedef UniversalProcPtr NPN_InvokeUPP;
01308 enum {
01309        uppNPN_InvokeProcInfo = kThinkCStackBased
01310               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01311               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
01312               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
01313               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
01314               | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint32_t)))
01315               | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPVariant*)))
01316               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01317 };
01318 
01319 #define NewNPN_InvokeProc(FUNC)           \
01320               (NPN_InvokeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvokeProcInfo, GetCurrentArchitecture())
01321 #define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)         \
01322               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvokeProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
01323 
01324 #else
01325 
01326 typedef bool (* NP_LOADDS NPN_InvokeUPP)(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result);
01327 #define NewNPN_InvokeProc(FUNC)           \
01328               ((NPN_InvokeUPP) (FUNC))
01329 #define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)         \
01330               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
01331 
01332 #endif
01333 
01334 /* NPN_InvokeDefault */
01335 
01336 #if _NPUPP_USE_UPP_
01337 
01338 typedef UniversalProcPtr NPN_InvokeDefaultUPP;
01339 enum {
01340        uppNPN_InvokeDefaultProcInfo = kThinkCStackBased
01341               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01342               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
01343               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
01344               | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint32_t)))
01345               | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPVariant*)))
01346               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01347 };
01348 
01349 #define NewNPN_InvokeDefaultProc(FUNC)           \
01350               (NPN_InvokeDefaultUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvokeDefaultProcInfo, GetCurrentArchitecture())
01351 #define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5)        \
01352               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvokeDefaultProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
01353 
01354 #else
01355 
01356 typedef bool (* NP_LOADDS NPN_InvokeDefaultUPP)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
01357 #define NewNPN_InvokeDefaultProc(FUNC)           \
01358               ((NPN_InvokeDefaultUPP) (FUNC))
01359 #define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5)        \
01360               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
01361 
01362 #endif
01363 
01364 /* NPN_Evaluate */
01365 
01366 #if _NPUPP_USE_UPP_
01367 
01368 typedef UniversalProcPtr NPN_EvaluateUPP;
01369 enum {
01370        uppNPN_EvaluateProcInfo = kThinkCStackBased
01371               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01372               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
01373               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPString*)))
01374               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPVariant*)))
01375               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01376 };
01377 
01378 #define NewNPN_EvaluateProc(FUNC)         \
01379               (NPN_EvaluateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_EvaluateProcInfo, GetCurrentArchitecture())
01380 #define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4)            \
01381               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_EvaluateProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
01382 
01383 #else
01384 
01385 typedef bool (* NP_LOADDS NPN_EvaluateUPP)(NPP npp, NPObject *obj, NPString *script, NPVariant *result);
01386 #define NewNPN_EvaluateProc(FUNC)         \
01387               ((NPN_EvaluateUPP) (FUNC))
01388 #define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4)            \
01389               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
01390 
01391 #endif
01392 
01393 /* NPN_GetProperty */
01394 
01395 #if _NPUPP_USE_UPP_
01396 
01397 typedef UniversalProcPtr NPN_GetPropertyUPP;
01398 enum {
01399        uppNPN_GetPropertyProcInfo = kThinkCStackBased
01400               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01401               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
01402               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
01403               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPVariant*)))
01404               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01405 };
01406 
01407 #define NewNPN_GetPropertyProc(FUNC)             \
01408               (NPN_GetPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetPropertyProcInfo, GetCurrentArchitecture())
01409 #define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4)         \
01410               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetPropertyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
01411 
01412 #else
01413 
01414 typedef bool (* NP_LOADDS NPN_GetPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
01415 #define NewNPN_GetPropertyProc(FUNC)             \
01416               ((NPN_GetPropertyUPP) (FUNC))
01417 #define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4)         \
01418               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
01419 
01420 #endif
01421 
01422 /* NPN_SetProperty */
01423 
01424 #if _NPUPP_USE_UPP_
01425 
01426 typedef UniversalProcPtr NPN_SetPropertyUPP;
01427 enum {
01428        uppNPN_SetPropertyProcInfo = kThinkCStackBased
01429               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01430               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
01431               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
01432               | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
01433               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01434 };
01435 
01436 #define NewNPN_SetPropertyProc(FUNC)             \
01437               (NPN_SetPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetPropertyProcInfo, GetCurrentArchitecture())
01438 #define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4)         \
01439               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetPropertyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
01440 
01441 #else
01442 
01443 typedef bool (* NP_LOADDS NPN_SetPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
01444 #define NewNPN_SetPropertyProc(FUNC)             \
01445               ((NPN_SetPropertyUPP) (FUNC))
01446 #define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4)         \
01447               (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
01448 
01449 #endif
01450 
01451 /* NPN_RemoveProperty */
01452 
01453 #if _NPUPP_USE_UPP_
01454 
01455 typedef UniversalProcPtr NPN_RemovePropertyUPP;
01456 enum {
01457        uppNPN_RemovePropertyProcInfo = kThinkCStackBased
01458               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01459               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
01460               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
01461               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01462 };
01463 
01464 #define NewNPN_RemovePropertyProc(FUNC)          \
01465               (NPN_RemovePropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RemovePropertyProcInfo, GetCurrentArchitecture())
01466 #define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3)            \
01467               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RemovePropertyProcInfo, (ARG1), (ARG2), (ARG3))
01468 
01469 #else
01470 
01471 typedef bool (* NP_LOADDS NPN_RemovePropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
01472 #define NewNPN_RemovePropertyProc(FUNC)          \
01473               ((NPN_RemovePropertyUPP) (FUNC))
01474 #define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3)            \
01475               (*(FUNC))((ARG1), (ARG2), (ARG3))
01476 
01477 #endif
01478 
01479 /* NPN_HasProperty */
01480 
01481 #if _NPUPP_USE_UPP_
01482 
01483 typedef UniversalProcPtr NPN_HasPropertyUPP;
01484 enum {
01485        uppNPN_HasPropertyProcInfo = kThinkCStackBased
01486               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01487               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
01488               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
01489               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01490 };
01491 
01492 #define NewNPN_HasPropertyProc(FUNC)             \
01493               (NPN_HasPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_HasPropertyProcInfo, GetCurrentArchitecture())
01494 #define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3)        \
01495               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_HasPropertyProcInfo, (ARG1), (ARG2), (ARG3))
01496 
01497 #else
01498 
01499 typedef bool (* NP_LOADDS NPN_HasPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
01500 #define NewNPN_HasPropertyProc(FUNC)             \
01501               ((NPN_HasPropertyUPP) (FUNC))
01502 #define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3)        \
01503               (*(FUNC))((ARG1), (ARG2), (ARG3))
01504 
01505 #endif
01506 
01507 /* NPN_HasMethod */
01508 
01509 #if _NPUPP_USE_UPP_
01510 
01511 typedef UniversalProcPtr NPN_HasMethodUPP;
01512 enum {
01513        uppNPN_HasMethodProcInfo = kThinkCStackBased
01514               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01515               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
01516               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
01517               | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
01518 };
01519 
01520 #define NewNPN_HasMethodProc(FUNC)        \
01521               (NPN_HasMethodUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_HasMethodProcInfo, GetCurrentArchitecture())
01522 #define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3)          \
01523               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_HasMethodProcInfo, (ARG1), (ARG2), (ARG3))
01524 
01525 #else
01526 
01527 typedef bool (* NP_LOADDS NPN_HasMethodUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
01528 #define NewNPN_HasMethodProc(FUNC)        \
01529               ((NPN_HasMethodUPP) (FUNC))
01530 #define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3)          \
01531               (*(FUNC))((ARG1), (ARG2), (ARG3))
01532 
01533 #endif
01534 
01535 /* NPN_ReleaseVariantValue */
01536 
01537 #if _NPUPP_USE_UPP_
01538 
01539 typedef UniversalProcPtr NPN_ReleaseVariantValue;
01540 enum {
01541        uppNPN_ReleaseVariantValueProcInfo = kThinkCStackBased
01542               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPVariant*)))
01543               | RESULT_SIZE(SIZE_CODE(0))
01544 };
01545 
01546 #define NewNPN_ReleaseVariantValueProc(FUNC)            \
01547               (NPN_ReleaseVariantValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReleaseVariantValueProcInfo, GetCurrentArchitecture())
01548 #define CallNPN_ReleaseVariantValueProc(FUNC, ARG1)            \
01549               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReleaseVariantValueProcInfo, (ARG1))     
01550 
01551 #else
01552 
01553 typedef void (* NP_LOADDS NPN_ReleaseVariantValueUPP)(NPVariant *variant);
01554 #define NewNPN_ReleaseVariantValueProc(FUNC)            \
01555               ((NPN_ReleaseVariantValueUPP) (FUNC))
01556 #define CallNPN_ReleaseVariantValueProc(FUNC, ARG1)            \
01557               (*(FUNC))((ARG1))
01558 
01559 #endif
01560 
01561 /* NPN_SetException */
01562 
01563 #if _NPUPP_USE_UPP_
01564 
01565 typedef UniversalProcPtr NPN_SetExceptionUPP;
01566 enum {
01567        uppNPN_SetExceptionProcInfo = kThinkCStackBased
01568               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
01569               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const NPUTF8*)))
01570               | RESULT_SIZE(SIZE_CODE(0))
01571 };
01572 
01573 #define NewNPN_SetExceptionProc(FUNC)            \
01574               (NPN_SetExceptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetExceptionProcInfo, GetCurrentArchitecture())
01575 #define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2)             \
01576               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetExceptionProcInfo, (ARG1), (ARG2))    
01577 
01578 #else
01579 
01580 typedef void (* NP_LOADDS NPN_SetExceptionUPP)(NPObject *obj, const NPUTF8 *message);
01581 #define NewNPN_SetExceptionProc(FUNC)            \
01582               ((NPN_SetExceptionUPP) (FUNC))
01583 #define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2)             \
01584               (*(FUNC))((ARG1), (ARG2))   
01585 
01586 #endif
01587 
01588 /* NPN_PushPopupsEnabledStateUPP */
01589 
01590 #if _NPUPP_USE_UPP_
01591 
01592 typedef UniversalProcPtr NPN_PushPopupsEnabledStateUPP;
01593 enum {
01594        uppNPN_PushPopupsEnabledStateProcInfo = kThinkCStackBased
01595               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01596         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPBool)))
01597               | RESULT_SIZE(SIZE_CODE(0))
01598 };
01599 
01600 #define NewNPN_PushPopupsEnabledStateProc(FUNC)         \
01601               (NPN_PushPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, GetCurrentArchitecture())
01602 #define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2)          \
01603               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, (ARG1), (ARG2))
01604 
01605 #else
01606 
01607 typedef bool (* NP_LOADDS NPN_PushPopupsEnabledStateUPP)(NPP npp, NPBool enabled);
01608 #define NewNPN_PushPopupsEnabledStateProc(FUNC)         \
01609               ((NPN_PushPopupsEnabledStateUPP) (FUNC))
01610 #define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2)          \
01611               (*(FUNC))((ARG1), (ARG2))
01612 
01613 #endif
01614 
01615 /* NPN_PopPopupsEnabledState */
01616 
01617 #if _NPUPP_USE_UPP_
01618 
01619 typedef UniversalProcPtr NPN_PopPopupsEnabledStateUPP;
01620 enum {
01621        uppNPN_PopPopupsEnabledStateProcInfo = kThinkCStackBased
01622               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
01623               | RESULT_SIZE(SIZE_CODE(0))
01624 };
01625 
01626 #define NewNPN_PopPopupsEnabledStateProc(FUNC)          \
01627               (NPN_PopPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, GetCurrentArchitecture())
01628 #define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1)          \
01629               (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, (ARG1))
01630 
01631 #else
01632 
01633 typedef bool (* NP_LOADDS NPN_PopPopupsEnabledStateUPP)(NPP npp);
01634 #define NewNPN_PopPopupsEnabledStateProc(FUNC)          \
01635               ((NPN_PopPopupsEnabledStateUPP) (FUNC))
01636 #define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1)          \
01637               (*(FUNC))((ARG1))
01638 
01639 #endif
01640 
01641 
01642 
01643 /******************************************************************************************
01644  * The actual plugin function table definitions
01645  *******************************************************************************************/
01646 
01647 #ifdef XP_MAC
01648 #if PRAGMA_STRUCT_ALIGN
01649 #pragma options align=mac68k
01650 #endif
01651 #endif
01652 
01653 typedef struct _NPPluginFuncs {
01654     uint16 size;
01655     uint16 version;
01656     NPP_NewUPP newp;
01657     NPP_DestroyUPP destroy;
01658     NPP_SetWindowUPP setwindow;
01659     NPP_NewStreamUPP newstream;
01660     NPP_DestroyStreamUPP destroystream;
01661     NPP_StreamAsFileUPP asfile;
01662     NPP_WriteReadyUPP writeready;
01663     NPP_WriteUPP write;
01664     NPP_PrintUPP print;
01665     NPP_HandleEventUPP event;
01666     NPP_URLNotifyUPP urlnotify;
01667     JRIGlobalRef javaClass;
01668     NPP_GetValueUPP getvalue;
01669     NPP_SetValueUPP setvalue;
01670 } NPPluginFuncs;
01671 
01672 typedef struct _NPNetscapeFuncs {
01673     uint16 size;
01674     uint16 version;
01675     NPN_GetURLUPP geturl;
01676     NPN_PostURLUPP posturl;
01677     NPN_RequestReadUPP requestread;
01678     NPN_NewStreamUPP newstream;
01679     NPN_WriteUPP write;
01680     NPN_DestroyStreamUPP destroystream;
01681     NPN_StatusUPP status;
01682     NPN_UserAgentUPP uagent;
01683     NPN_MemAllocUPP memalloc;
01684     NPN_MemFreeUPP memfree;
01685     NPN_MemFlushUPP memflush;
01686     NPN_ReloadPluginsUPP reloadplugins;
01687     NPN_GetJavaEnvUPP getJavaEnv;
01688     NPN_GetJavaPeerUPP getJavaPeer;
01689     NPN_GetURLNotifyUPP geturlnotify;
01690     NPN_PostURLNotifyUPP posturlnotify;
01691     NPN_GetValueUPP getvalue;
01692     NPN_SetValueUPP setvalue;
01693     NPN_InvalidateRectUPP invalidaterect;
01694     NPN_InvalidateRegionUPP invalidateregion;
01695     NPN_ForceRedrawUPP forceredraw;
01696     NPN_GetStringIdentifierUPP getstringidentifier;
01697     NPN_GetStringIdentifiersUPP getstringidentifiers;
01698     NPN_GetIntIdentifierUPP getintidentifier;
01699     NPN_IdentifierIsStringUPP identifierisstring;
01700     NPN_UTF8FromIdentifierUPP utf8fromidentifier;
01701     NPN_IntFromIdentifierUPP intfromidentifier;
01702     NPN_CreateObjectUPP createobject;
01703     NPN_RetainObjectUPP retainobject;
01704     NPN_ReleaseObjectUPP releaseobject;
01705     NPN_InvokeUPP invoke;
01706     NPN_InvokeDefaultUPP invokeDefault;
01707     NPN_EvaluateUPP evaluate;
01708     NPN_GetPropertyUPP getproperty;
01709     NPN_SetPropertyUPP setproperty;
01710     NPN_RemovePropertyUPP removeproperty;
01711     NPN_HasPropertyUPP hasproperty;
01712     NPN_HasMethodUPP hasmethod;
01713     NPN_ReleaseVariantValueUPP releasevariantvalue;
01714     NPN_SetExceptionUPP setexception;
01715     NPN_PushPopupsEnabledStateUPP pushpopupsenabledstate;
01716     NPN_PopPopupsEnabledStateUPP poppopupsenabledstate;
01717 } NPNetscapeFuncs;
01718 
01719 #ifdef XP_MAC
01720 #if PRAGMA_STRUCT_ALIGN
01721 #pragma options align=reset
01722 #endif
01723 #endif
01724 
01725 
01726 #if defined(XP_MAC) || defined(XP_MACOSX)
01727 /******************************************************************************************
01728  * Mac platform-specific plugin glue stuff
01729  *******************************************************************************************/
01730 
01731 /*
01732  * Main entry point of the plugin.
01733  * This routine will be called when the plugin is loaded. The function
01734  * tables are passed in and the plugin fills in the NPPluginFuncs table
01735  * and NPPShutdownUPP for Netscape's use.
01736  */
01737 
01738 #if _NPUPP_USE_UPP_
01739 
01740 typedef UniversalProcPtr NPP_MainEntryUPP;
01741 enum {
01742        uppNPP_MainEntryProcInfo = kThinkCStackBased
01743               | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*)))
01744               | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*)))
01745               | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*)))
01746               | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
01747 };
01748 #define NewNPP_MainEntryProc(FUNC)        \
01749               (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture())
01750 #define CallNPP_MainEntryProc(FUNC,  netscapeFunc, pluginFunc, shutdownUPP)         \
01751               CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP))
01752 
01753 #else
01754 
01755 typedef NPError (* NP_LOADDS NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*);
01756 #define NewNPP_MainEntryProc(FUNC)        \
01757               ((NPP_MainEntryUPP) (FUNC))
01758 #define CallNPP_MainEntryProc(FUNC,  netscapeFunc, pluginFunc, shutdownUPP)         \
01759               (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP))
01760 
01761 #endif
01762 
01763 
01764 /*
01765  * Mac version(s) of NP_GetMIMEDescription(const char *)
01766  * These can be called to retreive MIME information from the plugin dynamically
01767  *
01768  * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
01769  *       to get mime info from the plugin only on OSX and may not be supported 
01770  *       in furture version--use NP_GetMIMEDescription instead
01771  */
01772 
01773 enum
01774 {
01775  kBPSupportedMIMETypesStructVers_1    = 1
01776 };
01777 
01778 typedef struct _BPSupportedMIMETypes
01779 {
01780  SInt32    structVersion;      /* struct version */
01781  Handle    typeStrings;        /* STR# formated handle, allocated by plug-in */
01782  Handle    infoStrings;        /* STR# formated handle, allocated by plug-in */
01783 } BPSupportedMIMETypes;
01784 OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
01785 
01786 #if _NPUPP_USE_UPP_
01787 
01788 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescriptionRD"
01789 typedef UniversalProcPtr NP_GetMIMEDescriptionUPP;
01790 enum {
01791        uppNP_GetMIMEDescEntryProc = kThinkCStackBased
01792               | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
01793 };
01794 #define NewNP_GetMIMEDescEntryProc(FUNC)         \
01795               (NP_GetMIMEDescriptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP_GetMIMEDescEntryProc, GetCurrentArchitecture())
01796 #define CallNP_GetMIMEDescEntryProc(FUNC)        \
01797               (const char *)CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNP_GetMIMEDescEntryProc)
01798 
01799 
01800 #else  /* !_NPUPP_USE_UPP_ */
01801 
01802  /* NP_GetMIMEDescription */
01803 #define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
01804 typedef const char* (* NP_LOADDS NP_GetMIMEDescriptionUPP)();
01805 #define NewNP_GetMIMEDescEntryProc(FUNC)         \
01806               ((NP_GetMIMEDescriptionUPP) (FUNC))
01807 #define CallNP_GetMIMEDescEntryProc(FUNC)        \
01808               (*(FUNC))()
01809 /* BP_GetSupportedMIMETypes */
01810 typedef OSErr (* NP_LOADDS BP_GetSupportedMIMETypesUPP)(BPSupportedMIMETypes*, UInt32);
01811 #define NewBP_GetSupportedMIMETypesEntryProc(FUNC)             \
01812               ((BP_GetSupportedMIMETypesUPP) (FUNC))
01813 #define CallBP_GetMIMEDescEntryProc(FUNC,  mimeInfo, flags)           \
01814               (*(FUNC))((mimeInfo), (flags))
01815 
01816 #endif
01817 #endif /* MAC */
01818 
01819 #if defined(_WINDOWS)
01820 #define OSCALL WINAPI
01821 #else
01822 #if defined(__OS2__)
01823 #define OSCALL _System
01824 #else
01825 #define OSCALL
01826 #endif
01827 #endif
01828 
01829 #if defined( _WINDOWS ) || defined (__OS2__)
01830 
01831 #ifdef __cplusplus
01832 extern "C" {
01833 #endif
01834 
01835 /* plugin meta member functions */
01836 #if defined(__OS2__)
01837 
01838 typedef struct _NPPluginData {   /* Alternate OS2 Plugin interface */
01839     char *pMimeTypes;
01840     char *pFileExtents;
01841     char *pFileOpenTemplate;
01842     char *pProductName;
01843     char *pProductDescription;
01844     unsigned long dwProductVersionMS;
01845     unsigned long dwProductVersionLS;
01846 } NPPluginData;
01847 
01848 NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
01849 
01850 #endif
01851 
01852 NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
01853 
01854 NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs);
01855 
01856 NPError OSCALL NP_Shutdown();
01857 
01858 char*  NP_GetMIMEDescription();
01859 
01860 #ifdef __cplusplus
01861 }
01862 #endif
01863 
01864 #endif /* _WINDOWS || __OS2__ */
01865 
01866 #if defined(__OS2__)
01867 #pragma pack()
01868 #endif
01869 
01870 #ifdef XP_UNIX
01871 
01872 #ifdef __cplusplus
01873 extern "C" {
01874 #endif
01875 
01876 /* plugin meta member functions */
01877 
01878 char*  NP_GetMIMEDescription(void);
01879 NPError       NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*);
01880 NPError       NP_Shutdown(void);
01881 NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
01882 
01883 #ifdef __cplusplus
01884 }
01885 #endif
01886 
01887 #endif /* XP_UNIX */
01888 
01889 #endif /* _NPUPP_H_ */