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