#include "nptypes.h"
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | _NPString |
struct | _NPVariant |
struct | NPClass |
struct | NPObject |
Defines | |
#define | NP_BEGIN_MACRO do { |
#define | NP_END_MACRO } while (0) |
#define | NPVARIANT_IS_VOID(_v) ((_v).type == NPVariantType_Void) |
#define | NPVARIANT_IS_NULL(_v) ((_v).type == NPVariantType_Null) |
#define | NPVARIANT_IS_BOOLEAN(_v) ((_v).type == NPVariantType_Bool) |
#define | NPVARIANT_IS_INT32(_v) ((_v).type == NPVariantType_Int32) |
#define | NPVARIANT_IS_DOUBLE(_v) ((_v).type == NPVariantType_Double) |
#define | NPVARIANT_IS_STRING(_v) ((_v).type == NPVariantType_String) |
#define | NPVARIANT_IS_OBJECT(_v) ((_v).type == NPVariantType_Object) |
#define | NPVARIANT_TO_BOOLEAN(_v) ((_v).value.boolValue) |
#define | NPVARIANT_TO_INT32(_v) ((_v).value.intValue) |
#define | NPVARIANT_TO_DOUBLE(_v) ((_v).value.doubleValue) |
#define | NPVARIANT_TO_STRING(_v) ((_v).value.stringValue) |
#define | NPVARIANT_TO_OBJECT(_v) ((_v).value.objectValue) |
#define | VOID_TO_NPVARIANT(_v) |
#define | NULL_TO_NPVARIANT(_v) |
#define | BOOLEAN_TO_NPVARIANT(_val, _v) |
#define | INT32_TO_NPVARIANT(_val, _v) |
#define | DOUBLE_TO_NPVARIANT(_val, _v) |
#define | STRINGZ_TO_NPVARIANT(_val, _v) |
#define | STRINGN_TO_NPVARIANT(_val, _len, _v) |
#define | OBJECT_TO_NPVARIANT(_val, _v) |
#define | NP_CLASS_STRUCT_VERSION 3 |
#define | NP_CLASS_STRUCT_VERSION_ENUM 2 |
#define | NP_CLASS_STRUCT_VERSION_CTOR 3 |
#define | NP_CLASS_STRUCT_VERSION_HAS_ENUM(npclass) ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_ENUM) |
#define | NP_CLASS_STRUCT_VERSION_HAS_CTOR(npclass) ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_CTOR) |
Typedefs | |
typedef struct NPObject | NPObject |
typedef struct NPClass | NPClass |
typedef char | NPUTF8 |
typedef struct _NPString | NPString |
typedef struct _NPVariant | NPVariant |
typedef void * | NPIdentifier |
typedef NPObject *(* | NPAllocateFunctionPtr )(NPP npp, NPClass *aClass) |
typedef void(* | NPDeallocateFunctionPtr )(NPObject *npobj) |
typedef void(* | NPInvalidateFunctionPtr )(NPObject *npobj) |
typedef bool(* | NPHasMethodFunctionPtr )(NPObject *npobj, NPIdentifier name) |
typedef bool(* | NPInvokeFunctionPtr )(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result) |
typedef bool(* | NPInvokeDefaultFunctionPtr )(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) |
typedef bool(* | NPHasPropertyFunctionPtr )(NPObject *npobj, NPIdentifier name) |
typedef bool(* | NPGetPropertyFunctionPtr )(NPObject *npobj, NPIdentifier name, NPVariant *result) |
typedef bool(* | NPSetPropertyFunctionPtr )(NPObject *npobj, NPIdentifier name, const NPVariant *value) |
typedef bool(* | NPRemovePropertyFunctionPtr )(NPObject *npobj, NPIdentifier name) |
typedef bool(* | NPEnumerationFunctionPtr )(NPObject *npobj, NPIdentifier **value, uint32_t *count) |
typedef bool(* | NPConstructFunctionPtr )(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) |
Enumerations | |
enum | NPVariantType { NPVariantType_Void, NPVariantType_Null, NPVariantType_Bool, NPVariantType_Int32, NPVariantType_Double, NPVariantType_String, NPVariantType_Object } |
Functions | |
void | NPN_ReleaseVariantValue (NPVariant *variant) |
NPIdentifier | NPN_GetStringIdentifier (const NPUTF8 *name) |
void | NPN_GetStringIdentifiers (const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers) |
NPIdentifier | NPN_GetIntIdentifier (int32_t intid) |
bool | NPN_IdentifierIsString (NPIdentifier identifier) |
NPUTF8 * | NPN_UTF8FromIdentifier (NPIdentifier identifier) |
int32_t | NPN_IntFromIdentifier (NPIdentifier identifier) |
NPObject * | NPN_CreateObject (NPP npp, NPClass *aClass) |
NPObject * | NPN_RetainObject (NPObject *npobj) |
void | NPN_ReleaseObject (NPObject *npobj) |
bool | NPN_Invoke (NPP npp, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result) |
bool | NPN_InvokeDefault (NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) |
bool | NPN_Evaluate (NPP npp, NPObject *npobj, NPString *script, NPVariant *result) |
bool | NPN_GetProperty (NPP npp, NPObject *npobj, NPIdentifier propertyName, NPVariant *result) |
bool | NPN_SetProperty (NPP npp, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value) |
bool | NPN_RemoveProperty (NPP npp, NPObject *npobj, NPIdentifier propertyName) |
bool | NPN_HasProperty (NPP npp, NPObject *npobj, NPIdentifier propertyName) |
bool | NPN_HasMethod (NPP npp, NPObject *npobj, NPIdentifier methodName) |
bool | NPN_Enumerate (NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count) |
bool | NPN_Construct (NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) |
void | NPN_SetException (NPObject *npobj, const NPUTF8 *message) |
#define BOOLEAN_TO_NPVARIANT | ( | _val, | |||
_v | ) |
NP_BEGIN_MACRO \ (_v).type = NPVariantType_Bool; \ (_v).value.boolValue = !!(_val); \ NP_END_MACRO
Definition at line 181 of file npruntime.h.
#define DOUBLE_TO_NPVARIANT | ( | _val, | |||
_v | ) |
NP_BEGIN_MACRO \ (_v).type = NPVariantType_Double; \ (_v).value.doubleValue = _val; \ NP_END_MACRO
Definition at line 193 of file npruntime.h.
#define INT32_TO_NPVARIANT | ( | _val, | |||
_v | ) |
NP_BEGIN_MACRO \ (_v).type = NPVariantType_Int32; \ (_v).value.intValue = _val; \ NP_END_MACRO
Definition at line 187 of file npruntime.h.
#define NP_BEGIN_MACRO do { |
Definition at line 105 of file npruntime.h.
#define NP_CLASS_STRUCT_VERSION 3 |
Definition at line 342 of file npruntime.h.
#define NP_CLASS_STRUCT_VERSION_CTOR 3 |
Definition at line 345 of file npruntime.h.
#define NP_CLASS_STRUCT_VERSION_ENUM 2 |
Definition at line 344 of file npruntime.h.
#define NP_CLASS_STRUCT_VERSION_HAS_CTOR | ( | npclass | ) | ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_CTOR) |
Definition at line 350 of file npruntime.h.
#define NP_CLASS_STRUCT_VERSION_HAS_ENUM | ( | npclass | ) | ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_ENUM) |
Definition at line 347 of file npruntime.h.
#define NP_END_MACRO } while (0) |
Definition at line 106 of file npruntime.h.
#define NPVARIANT_IS_BOOLEAN | ( | _v | ) | ((_v).type == NPVariantType_Bool) |
Definition at line 157 of file npruntime.h.
#define NPVARIANT_IS_DOUBLE | ( | _v | ) | ((_v).type == NPVariantType_Double) |
Definition at line 159 of file npruntime.h.
#define NPVARIANT_IS_INT32 | ( | _v | ) | ((_v).type == NPVariantType_Int32) |
Definition at line 158 of file npruntime.h.
#define NPVARIANT_IS_NULL | ( | _v | ) | ((_v).type == NPVariantType_Null) |
Definition at line 156 of file npruntime.h.
#define NPVARIANT_IS_OBJECT | ( | _v | ) | ((_v).type == NPVariantType_Object) |
Definition at line 161 of file npruntime.h.
#define NPVARIANT_IS_STRING | ( | _v | ) | ((_v).type == NPVariantType_String) |
Definition at line 160 of file npruntime.h.
#define NPVARIANT_IS_VOID | ( | _v | ) | ((_v).type == NPVariantType_Void) |
Definition at line 155 of file npruntime.h.
#define NPVARIANT_TO_BOOLEAN | ( | _v | ) | ((_v).value.boolValue) |
Definition at line 163 of file npruntime.h.
#define NPVARIANT_TO_DOUBLE | ( | _v | ) | ((_v).value.doubleValue) |
Definition at line 165 of file npruntime.h.
#define NPVARIANT_TO_INT32 | ( | _v | ) | ((_v).value.intValue) |
Definition at line 164 of file npruntime.h.
#define NPVARIANT_TO_OBJECT | ( | _v | ) | ((_v).value.objectValue) |
Definition at line 167 of file npruntime.h.
#define NPVARIANT_TO_STRING | ( | _v | ) | ((_v).value.stringValue) |
Definition at line 166 of file npruntime.h.
#define NULL_TO_NPVARIANT | ( | _v | ) |
NP_BEGIN_MACRO \ (_v).type = NPVariantType_Null; \ (_v).value.objectValue = NULL; \ NP_END_MACRO
Definition at line 175 of file npruntime.h.
#define OBJECT_TO_NPVARIANT | ( | _val, | |||
_v | ) |
NP_BEGIN_MACRO \ (_v).type = NPVariantType_Object; \ (_v).value.objectValue = _val; \ NP_END_MACRO
Definition at line 213 of file npruntime.h.
#define STRINGN_TO_NPVARIANT | ( | _val, | |||
_len, | |||||
_v | ) |
NP_BEGIN_MACRO \ (_v).type = NPVariantType_String; \ NPString str = { _val, _len }; \ (_v).value.stringValue = str; \ NP_END_MACRO
Definition at line 206 of file npruntime.h.
#define STRINGZ_TO_NPVARIANT | ( | _val, | |||
_v | ) |
NP_BEGIN_MACRO \ (_v).type = NPVariantType_String; \ NPString str = { _val, strlen(_val) }; \ (_v).value.stringValue = str; \ NP_END_MACRO
Definition at line 199 of file npruntime.h.
#define VOID_TO_NPVARIANT | ( | _v | ) |
NP_BEGIN_MACRO \ (_v).type = NPVariantType_Void; \ (_v).value.objectValue = NULL; \ NP_END_MACRO
Definition at line 169 of file npruntime.h.
typedef NPObject*(* NPAllocateFunctionPtr)(NPP npp, NPClass *aClass) |
Definition at line 277 of file npruntime.h.
Definition at line 114 of file npruntime.h.
typedef bool(* NPConstructFunctionPtr)(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) |
Definition at line 297 of file npruntime.h.
typedef void(* NPDeallocateFunctionPtr)(NPObject *npobj) |
Definition at line 278 of file npruntime.h.
typedef bool(* NPEnumerationFunctionPtr)(NPObject *npobj, NPIdentifier **value, uint32_t *count) |
Definition at line 295 of file npruntime.h.
typedef bool(* NPGetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name, NPVariant *result) |
Definition at line 289 of file npruntime.h.
typedef bool(* NPHasMethodFunctionPtr)(NPObject *npobj, NPIdentifier name) |
Definition at line 280 of file npruntime.h.
typedef bool(* NPHasPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name) |
Definition at line 288 of file npruntime.h.
typedef void* NPIdentifier |
Definition at line 242 of file npruntime.h.
typedef void(* NPInvalidateFunctionPtr)(NPObject *npobj) |
Definition at line 279 of file npruntime.h.
typedef bool(* NPInvokeDefaultFunctionPtr)(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) |
Definition at line 284 of file npruntime.h.
typedef bool(* NPInvokeFunctionPtr)(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result) |
Definition at line 281 of file npruntime.h.
Definition at line 113 of file npruntime.h.
typedef bool(* NPRemovePropertyFunctionPtr)(NPObject *npobj, NPIdentifier name) |
Definition at line 293 of file npruntime.h.
typedef bool(* NPSetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name, const NPVariant *value) |
Definition at line 291 of file npruntime.h.
typedef char NPUTF8 |
Definition at line 116 of file npruntime.h.
typedef struct _NPVariant NPVariant |
enum NPVariantType |
NPVariantType_Void | |
NPVariantType_Null | |
NPVariantType_Bool | |
NPVariantType_Int32 | |
NPVariantType_Double | |
NPVariantType_String | |
NPVariantType_Object |
Definition at line 122 of file npruntime.h.
00122 { 00123 NPVariantType_Void, 00124 NPVariantType_Null, 00125 NPVariantType_Bool, 00126 NPVariantType_Int32, 00127 NPVariantType_Double, 00128 NPVariantType_String, 00129 NPVariantType_Object 00130 } NPVariantType;
bool NPN_Construct | ( | NPP | npp, | |
NPObject * | npobj, | |||
const NPVariant * | args, | |||
uint32_t | argCount, | |||
NPVariant * | result | |||
) |
Definition at line 290 of file npunix.c.
00291 { 00292 return CallNPN_CreateObjectProc(gNetscapeFuncs.createobject, npp, aClass); 00293 }
bool NPN_Enumerate | ( | NPP | npp, | |
NPObject * | npobj, | |||
NPIdentifier ** | identifier, | |||
uint32_t * | count | |||
) |
Definition at line 319 of file npunix.c.
00321 { 00322 return CallNPN_EvaluateProc(gNetscapeFuncs.evaluate, npp, obj, script, result); 00323 }
NPIdentifier NPN_GetIntIdentifier | ( | int32_t | intid | ) |
Definition at line 267 of file npunix.c.
00268 { 00269 return CallNPN_GetIntIdentifierProc(gNetscapeFuncs.getintidentifier, intid); 00270 }
bool NPN_GetProperty | ( | NPP | npp, | |
NPObject * | npobj, | |||
NPIdentifier | propertyName, | |||
NPVariant * | result | |||
) |
Definition at line 325 of file npunix.c.
00327 { 00328 return CallNPN_GetPropertyProc(gNetscapeFuncs.getproperty, npp, obj, 00329 propertyName, result); 00330 }
NPIdentifier NPN_GetStringIdentifier | ( | const NPUTF8 * | name | ) |
Definition at line 254 of file npunix.c.
00255 { 00256 return CallNPN_GetStringIdentifierProc(gNetscapeFuncs.getstringidentifier, 00257 name); 00258 }
void NPN_GetStringIdentifiers | ( | const NPUTF8 ** | names, | |
int32_t | nameCount, | |||
NPIdentifier * | identifiers | |||
) |
Definition at line 260 of file npunix.c.
00262 { 00263 CallNPN_GetStringIdentifiersProc(gNetscapeFuncs.getstringidentifiers, 00264 names, nameCount, identifiers); 00265 }
bool NPN_HasMethod | ( | NPP | npp, | |
NPObject * | npobj, | |||
NPIdentifier | methodName | |||
) |
Definition at line 351 of file npunix.c.
00352 { 00353 return CallNPN_HasMethodProc(gNetscapeFuncs.hasmethod, npp, obj, methodName); 00354 }
bool NPN_HasProperty | ( | NPP | npp, | |
NPObject * | npobj, | |||
NPIdentifier | propertyName | |||
) |
Definition at line 345 of file npunix.c.
00346 { 00347 return CallNPN_HasPropertyProc(gNetscapeFuncs.hasproperty, npp, obj, 00348 propertyName); 00349 }
bool NPN_IdentifierIsString | ( | NPIdentifier | identifier | ) |
Definition at line 272 of file npunix.c.
00273 { 00274 return CallNPN_IdentifierIsStringProc(gNetscapeFuncs.identifierisstring, 00275 identifier); 00276 }
int32_t NPN_IntFromIdentifier | ( | NPIdentifier | identifier | ) |
Definition at line 284 of file npunix.c.
00285 { 00286 return CallNPN_IntFromIdentifierProc(gNetscapeFuncs.intfromidentifier, 00287 identifier); 00288 }
bool NPN_Invoke | ( | NPP | npp, | |
NPObject * | npobj, | |||
NPIdentifier | methodName, | |||
const NPVariant * | args, | |||
uint32_t | argCount, | |||
NPVariant * | result | |||
) |
Definition at line 305 of file npunix.c.
00307 { 00308 return CallNPN_InvokeProc(gNetscapeFuncs.invoke, npp, obj, methodName, 00309 args, argCount, result); 00310 }
bool NPN_InvokeDefault | ( | NPP | npp, | |
NPObject * | npobj, | |||
const NPVariant * | args, | |||
uint32_t | argCount, | |||
NPVariant * | result | |||
) |
Definition at line 312 of file npunix.c.
00314 { 00315 return CallNPN_InvokeDefaultProc(gNetscapeFuncs.invokeDefault, npp, obj, 00316 args, argCount, result); 00317 }
void NPN_ReleaseObject | ( | NPObject * | npobj | ) |
Definition at line 300 of file npunix.c.
00301 { 00302 CallNPN_ReleaseObjectProc(gNetscapeFuncs.releaseobject, obj); 00303 }
void NPN_ReleaseVariantValue | ( | NPVariant * | variant | ) |
Definition at line 356 of file npunix.c.
00357 { 00358 CallNPN_ReleaseVariantValueProc(gNetscapeFuncs.releasevariantvalue, variant); 00359 }
bool NPN_RemoveProperty | ( | NPP | npp, | |
NPObject * | npobj, | |||
NPIdentifier | propertyName | |||
) |
Definition at line 339 of file npunix.c.
00340 { 00341 return CallNPN_RemovePropertyProc(gNetscapeFuncs.removeproperty, npp, obj, 00342 propertyName); 00343 }
Definition at line 295 of file npunix.c.
00296 { 00297 return CallNPN_RetainObjectProc(gNetscapeFuncs.retainobject, obj); 00298 }
Definition at line 361 of file npunix.c.
00362 { 00363 CallNPN_SetExceptionProc(gNetscapeFuncs.setexception, obj, message); 00364 }
bool NPN_SetProperty | ( | NPP | npp, | |
NPObject * | npobj, | |||
NPIdentifier | propertyName, | |||
const NPVariant * | value | |||
) |
Definition at line 332 of file npunix.c.
00334 { 00335 return CallNPN_SetPropertyProc(gNetscapeFuncs.setproperty, npp, obj, 00336 propertyName, value); 00337 }
NPUTF8* NPN_UTF8FromIdentifier | ( | NPIdentifier | identifier | ) |
Definition at line 278 of file npunix.c.
00279 { 00280 return CallNPN_UTF8FromIdentifierProc(gNetscapeFuncs.utf8fromidentifier, 00281 identifier); 00282 }