00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef prtypes_h___
00053 #define prtypes_h___
00054
00055 #ifdef MDCPUCFG
00056 #include MDCPUCFG
00057 #else
00058 #include "prcpucfg.h"
00059 #endif
00060
00061 #include <stddef.h>
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 #if defined(WIN32)
00084
00085 #define PR_EXPORT(__type) extern __declspec(dllexport) __type
00086 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
00087 #define PR_IMPORT(__type) __declspec(dllimport) __type
00088 #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type
00089
00090 #define PR_EXTERN(__type) extern __declspec(dllexport) __type
00091 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
00092 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
00093 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
00094
00095 #define PR_CALLBACK
00096 #define PR_CALLBACK_DECL
00097 #define PR_STATIC_CALLBACK(__x) static __x
00098
00099 #elif defined(XP_BEOS)
00100
00101 #define PR_EXPORT(__type) extern __declspec(dllexport) __type
00102 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
00103 #define PR_IMPORT(__type) extern __declspec(dllexport) __type
00104 #define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type
00105
00106 #define PR_EXTERN(__type) extern __declspec(dllexport) __type
00107 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
00108 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
00109 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
00110
00111 #define PR_CALLBACK
00112 #define PR_CALLBACK_DECL
00113 #define PR_STATIC_CALLBACK(__x) static __x
00114
00115 #elif defined(WIN16)
00116
00117 #define PR_CALLBACK_DECL __cdecl
00118
00119 #if defined(_WINDLL)
00120 #define PR_EXPORT(__type) extern __type _cdecl _export _loadds
00121 #define PR_IMPORT(__type) extern __type _cdecl _export _loadds
00122 #define PR_EXPORT_DATA(__type) extern __type _export
00123 #define PR_IMPORT_DATA(__type) extern __type _export
00124
00125 #define PR_EXTERN(__type) extern __type _cdecl _export _loadds
00126 #define PR_IMPLEMENT(__type) __type _cdecl _export _loadds
00127 #define PR_EXTERN_DATA(__type) extern __type _export
00128 #define PR_IMPLEMENT_DATA(__type) __type _export
00129
00130 #define PR_CALLBACK __cdecl __loadds
00131 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
00132
00133 #else
00134 #define PR_EXPORT(__type) extern __type _cdecl _export
00135 #define PR_IMPORT(__type) extern __type _cdecl _export
00136 #define PR_EXPORT_DATA(__type) extern __type _export
00137 #define PR_IMPORT_DATA(__type) extern __type _export
00138
00139 #define PR_EXTERN(__type) extern __type _cdecl _export
00140 #define PR_IMPLEMENT(__type) __type _cdecl _export
00141 #define PR_EXTERN_DATA(__type) extern __type _export
00142 #define PR_IMPLEMENT_DATA(__type) __type _export
00143
00144 #define PR_CALLBACK __cdecl __loadds
00145 #define PR_STATIC_CALLBACK(__x) __x PR_CALLBACK
00146 #endif
00147
00148 #elif defined(XP_MAC)
00149
00150 #define PR_EXPORT(__type) extern __declspec(export) __type
00151 #define PR_EXPORT_DATA(__type) extern __declspec(export) __type
00152 #define PR_IMPORT(__type) extern __declspec(export) __type
00153 #define PR_IMPORT_DATA(__type) extern __declspec(export) __type
00154
00155 #define PR_EXTERN(__type) extern __declspec(export) __type
00156 #define PR_IMPLEMENT(__type) __declspec(export) __type
00157 #define PR_EXTERN_DATA(__type) extern __declspec(export) __type
00158 #define PR_IMPLEMENT_DATA(__type) __declspec(export) __type
00159
00160 #define PR_CALLBACK
00161 #define PR_CALLBACK_DECL
00162 #define PR_STATIC_CALLBACK(__x) static __x
00163
00164 #elif defined(XP_OS2) && defined(__declspec)
00165
00166 #define PR_EXPORT(__type) extern __declspec(dllexport) __type
00167 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
00168 #define PR_IMPORT(__type) extern __declspec(dllimport) __type
00169 #define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type
00170
00171 #define PR_EXTERN(__type) extern __declspec(dllexport) __type
00172 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
00173 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
00174 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
00175
00176 #define PR_CALLBACK
00177 #define PR_CALLBACK_DECL
00178 #define PR_STATIC_CALLBACK(__x) static __x
00179
00180 #elif defined(XP_OS2_VACPP)
00181
00182 #define PR_EXPORT(__type) extern __type
00183 #define PR_EXPORT_DATA(__type) extern __type
00184 #define PR_IMPORT(__type) extern __type
00185 #define PR_IMPORT_DATA(__type) extern __type
00186
00187 #define PR_EXTERN(__type) extern __type
00188 #define PR_IMPLEMENT(__type) __type
00189 #define PR_EXTERN_DATA(__type) extern __type
00190 #define PR_IMPLEMENT_DATA(__type) __type
00191 #define PR_CALLBACK _Optlink
00192 #define PR_CALLBACK_DECL
00193 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
00194
00195 #else
00196
00197
00198 #if (__GNUC__ >= 4) || \
00199 (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
00200 #define PR_VISIBILITY_DEFAULT __attribute__((visibility("default")))
00201 #else
00202 #define PR_VISIBILITY_DEFAULT
00203 #endif
00204
00205 #define PR_EXPORT(__type) extern PR_VISIBILITY_DEFAULT __type
00206 #define PR_EXPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
00207 #define PR_IMPORT(__type) extern PR_VISIBILITY_DEFAULT __type
00208 #define PR_IMPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
00209
00210 #define PR_EXTERN(__type) extern PR_VISIBILITY_DEFAULT __type
00211 #define PR_IMPLEMENT(__type) PR_VISIBILITY_DEFAULT __type
00212 #define PR_EXTERN_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
00213 #define PR_IMPLEMENT_DATA(__type) PR_VISIBILITY_DEFAULT __type
00214 #define PR_CALLBACK
00215 #define PR_CALLBACK_DECL
00216 #define PR_STATIC_CALLBACK(__x) static __x
00217
00218 #endif
00219
00220 #if defined(_NSPR_BUILD_)
00221 #define NSPR_API(__type) PR_EXPORT(__type)
00222 #define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type)
00223 #else
00224 #define NSPR_API(__type) PR_IMPORT(__type)
00225 #define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type)
00226 #endif
00227
00228
00229
00230
00231
00232
00233
00234
00235 #define PR_BEGIN_MACRO do {
00236 #define PR_END_MACRO } while (0)
00237
00238
00239
00240
00241
00242
00243
00244 #ifdef __cplusplus
00245 #define PR_BEGIN_EXTERN_C extern "C" {
00246 #define PR_END_EXTERN_C }
00247 #else
00248 #define PR_BEGIN_EXTERN_C
00249 #define PR_END_EXTERN_C
00250 #endif
00251
00252
00253
00254
00255
00256
00257
00258 #define PR_BIT(n) ((PRUint32)1 << (n))
00259 #define PR_BITMASK(n) (PR_BIT(n) - 1)
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269 #define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
00270 #define PR_MIN(x,y) ((x)<(y)?(x):(y))
00271 #define PR_MAX(x,y) ((x)>(y)?(x):(y))
00272 #define PR_ABS(x) ((x)<0?-(x):(x))
00273
00274 PR_BEGIN_EXTERN_C
00275
00276
00277
00278
00279
00280
00281
00282
00283 #if PR_BYTES_PER_BYTE == 1
00284 typedef unsigned char PRUint8;
00285
00286
00287
00288
00289
00290
00291
00292 #if (defined(HPUX) && defined(__cplusplus) \
00293 && !defined(__GNUC__) && __cplusplus < 199707L) \
00294 || (defined(SCO) && defined(__cplusplus) \
00295 && !defined(__GNUC__) && __cplusplus == 1L)
00296 typedef char PRInt8;
00297 #else
00298 typedef signed char PRInt8;
00299 #endif
00300 #else
00301 #error No suitable type for PRInt8/PRUint8
00302 #endif
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312 #define PR_INT8_MAX 127
00313 #define PR_INT8_MIN (-128)
00314 #define PR_UINT8_MAX 255U
00315
00316
00317
00318
00319
00320
00321
00322 #if PR_BYTES_PER_SHORT == 2
00323 typedef unsigned short PRUint16;
00324 typedef short PRInt16;
00325 #else
00326 #error No suitable type for PRInt16/PRUint16
00327 #endif
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337 #define PR_INT16_MAX 32767
00338 #define PR_INT16_MIN (-32768)
00339 #define PR_UINT16_MAX 65535U
00340
00341
00342
00343
00344
00345
00346
00347 #if PR_BYTES_PER_INT == 4
00348 typedef unsigned int PRUint32;
00349 typedef int PRInt32;
00350 #define PR_INT32(x) x
00351 #define PR_UINT32(x) x ## U
00352 #elif PR_BYTES_PER_LONG == 4
00353 typedef unsigned long PRUint32;
00354 typedef long PRInt32;
00355 #define PR_INT32(x) x ## L
00356 #define PR_UINT32(x) x ## UL
00357 #else
00358 #error No suitable type for PRInt32/PRUint32
00359 #endif
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369 #define PR_INT32_MAX PR_INT32(2147483647)
00370 #define PR_INT32_MIN (-PR_INT32_MAX - 1)
00371 #define PR_UINT32_MAX PR_UINT32(4294967295)
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383 #ifdef HAVE_LONG_LONG
00384 #if PR_BYTES_PER_LONG == 8
00385 typedef long PRInt64;
00386 typedef unsigned long PRUint64;
00387 #elif defined(WIN16)
00388 typedef __int64 PRInt64;
00389 typedef unsigned __int64 PRUint64;
00390 #elif defined(WIN32) && !defined(__GNUC__)
00391 typedef __int64 PRInt64;
00392 typedef unsigned __int64 PRUint64;
00393 #else
00394 typedef long long PRInt64;
00395 typedef unsigned long long PRUint64;
00396 #endif
00397 #else
00398 typedef struct {
00399 #ifdef IS_LITTLE_ENDIAN
00400 PRUint32 lo, hi;
00401 #else
00402 PRUint32 hi, lo;
00403 #endif
00404 } PRInt64;
00405 typedef PRInt64 PRUint64;
00406 #endif
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417 #if PR_BYTES_PER_INT >= 2
00418 typedef int PRIntn;
00419 typedef unsigned int PRUintn;
00420 #else
00421 #error 'sizeof(int)' not sufficient for platform use
00422 #endif
00423
00424
00425
00426
00427
00428
00429 typedef double PRFloat64;
00430
00431
00432
00433
00434
00435
00436 typedef size_t PRSize;
00437
00438
00439
00440
00441
00442
00443
00444 typedef PRInt32 PROffset32;
00445 typedef PRInt64 PROffset64;
00446
00447
00448
00449
00450
00451
00452
00453 typedef ptrdiff_t PRPtrdiff;
00454
00455
00456
00457
00458
00459
00460
00461 #ifdef _WIN64
00462 typedef unsigned __int64 PRUptrdiff;
00463 #else
00464 typedef unsigned long PRUptrdiff;
00465 #endif
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475 typedef PRIntn PRBool;
00476 #define PR_TRUE 1
00477 #define PR_FALSE 0
00478
00479
00480
00481
00482
00483
00484
00485 typedef PRUint8 PRPackedBool;
00486
00487
00488
00489
00490
00491 typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus;
00492
00493 #ifndef __PRUNICHAR__
00494 #define __PRUNICHAR__
00495 #if defined(WIN32) || defined(XP_MAC)
00496 typedef wchar_t PRUnichar;
00497 #else
00498 typedef PRUint16 PRUnichar;
00499 #endif
00500 #endif
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513 #ifdef _WIN64
00514 typedef __int64 PRWord;
00515 typedef unsigned __int64 PRUword;
00516 #else
00517 typedef long PRWord;
00518 typedef unsigned long PRUword;
00519 #endif
00520
00521 #if defined(NO_NSPR_10_SUPPORT)
00522 #else
00523
00524
00525
00526
00527
00528
00529
00530 #define PR_PUBLIC_API PR_IMPLEMENT
00531
00532
00533
00534
00535
00536 #define NSPR_BEGIN_MACRO do {
00537 #define NSPR_END_MACRO } while (0)
00538
00539
00540
00541
00542 #ifdef NSPR_BEGIN_EXTERN_C
00543 #undef NSPR_BEGIN_EXTERN_C
00544 #endif
00545 #ifdef NSPR_END_EXTERN_C
00546 #undef NSPR_END_EXTERN_C
00547 #endif
00548
00549 #ifdef __cplusplus
00550 #define NSPR_BEGIN_EXTERN_C extern "C" {
00551 #define NSPR_END_EXTERN_C }
00552 #else
00553 #define NSPR_BEGIN_EXTERN_C
00554 #define NSPR_END_EXTERN_C
00555 #endif
00556
00557 #ifdef XP_MAC
00558 #include "protypes.h"
00559 #else
00560 #include "obsolete/protypes.h"
00561 #endif
00562
00563
00564 #endif
00565
00566 PR_END_EXTERN_C
00567
00568 #endif
00569