Identity and Versioning Name and Version Constants Syntax #include <prinit.h> #define PR_NAME "NSPR" #define PR_VERSION "2.1 yyyymmdd" typedef PRBool (*PRVersionCheck)(const char*); Description The format of the version string is MajorVersion.MinorVersion BuildDate. PR_VersionCheck Compares the version of NSPR assumed by the caller (the imported version) with the version being offered by the runtime (the exported version). Syntax #include <prinit.h> PRBool PR_VersionCheck(const char *importedVersion); Parameter PR_VersionCheck has one parameter:
#include <prinit.h>
#define PR_NAME "NSPR"
#define PR_VERSION "2.1 yyyymmdd"
typedef PRBool (*PRVersionCheck)(const char*);
PRBool PR_VersionCheck(const char *importedVersion);
PR_VersionCheck
importedVersion
If the version of the shared library is compatible with that expected by the caller, PR_TRUE.
PR_TRUE
If the versions are not compatible, PR_FALSE.
PR_FALSE
PR_Init
PR_Initialize
PR_Initialized
PR_Cleanup
PR_DisableClockInterrupts
PR_BlockClockInterrupts
PR_UnblockClockInterrupts
PR_SetConcurrency
PR_ProcessExit
PR_Abort
PR_Init Initializes the runtime. Syntax #include <prinit.h> void PR_Init( PRThreadType type, PRThreadPriority priority, PRUintn maxPTDs); Parameters PR_Init has these parameters:
void PR_Init( PRThreadType type, PRThreadPriority priority, PRUintn maxPTDs);
type
priority
maxPTDs
PRIntn PR_Initialize( PRPrimordialFn prmain, PRIntn argc, char **argv, PRUintn maxPTDs);
prmain
argc
main
argv
typedef PRIntn (PR_CALLBACK *PRPrimordialFn)(PRIntn argc, char **argv);
PR_PRIORITY_NORMAL
PR_SetThreadPriority
PR_Initialized Checks whether the runtime has been initialized. Syntax #include <prinit.h> PRBool PR_Initialized(void); Returns The function returns one of the following values:
PRBool PR_Initialized(void);
If PR_Init has already been called, PR_TRUE
If PR_Init has not already been called, PR_FALSE.
PRStatus PR_Cleanup(void);
If NSPR has been shut down successfully, PR_SUCCESS.
PR_SUCCESS
If the calling thread of this function is not the primordial thread, PR_FAILURE.
PR_FAILURE
void PR_DisableClockInterrupts(void);
void PR_BlockClockInterrupts(void);
void PR_UnblockClockInterrupts(void);
void PR_SetConcurrency(PRUintn numCPUs);
numCPUs
void PR_ProcessExit(PRIntn status);
status
void PR_Abort(void);
PR_CallOnce
PRCallOnce
PRCallOnceFN
PRCallOnce Structure for tracking initialization. Syntax #include <prinit.h> typedef struct PRCallOnceType { PRIntn initialized; PRInt32 inProgress; PRStatus status;} PRCallOnceType; Fields The structure has these fields:
typedef struct PRCallOnceType { PRIntn initialized; PRInt32 inProgress; PRStatus status;} PRCallOnceType;
initialized
inProgress
PRCallOnceType
typedef PRStatus (PR_CALLBACK *PRCallOnceFN)(void);
PRStatus
PRStatus PR_CallOnce( PRCallOnceType *once, PRCallOnceFN func);
once
func
Last Updated: Mon Jul 13 17:28:35 PDT 1998