|
|
[Next] [Last]
NSPR Reference
The Netscape Portable Runtime (NSPR) API allows compliant applications
to use system facilities such as threads, thread synchronization, I/O,
interval timing, atomic operations, and several other low-level services
in a platform-independent manner. This chapter introduces key NSPR programming
concepts and illustrates them with sample code.
-
NSPR Naming Conventions
-
NSPR Threads
-
Thread Scheduling
-
Setting Thread Priorities
-
Preempting Threads
-
Interrupting Threads
-
NSPR Thread Synchronization
-
Locks and Monitors
-
Condition Variables
-
NSPR Sample Code
-
I/O Layering Sample
-
Thread Synchronization Sample
This chapter describes the most common NSPR types. Other chapters
describe more specialized types when describing the functions that use
them.
-
Calling Convention Types
-
PR_EXTERN
-
PR_IMPLEMENT
-
PR_CALLBACK
-
Algebraic Types
-
8-, 16-, and 32-bit Integer Types
-
Signed Integers
-
PRInt8
-
PRInt16
-
PRInt32
-
Unsigned Integers
-
PRUint
-
PRUint16
-
PRUint32
-
64-bit Integer Types
-
PRInt64
-
PRUint64
-
Floating-Point Integer Type
-
Native OS Integer Types
-
Miscellaneous Types
-
Size Type
-
PRSize
-
Pointer Difference Types
-
PRPtrdiff
-
PRUptrdiff
-
Boolean Types
-
PRBool
-
PRPackedBool
-
Status Type for Return Values
-
PRStatus
NSPR provides an execution environment that promotes the use
of lightweight threads. Each thread is an execution entity that is scheduled
independently from other threads in the same process. This chapter describes
the basic NSPR threading API.
-
Threading Types and Constants
-
PRThread
-
PRThreadType
-
PRThreadScope
-
PRThreadState
-
PRThreadPriority
-
PRThreadPrivateDTOR
-
Threading Functions
-
Creating, Joining, and Identifying Threads
-
PR_CreateThread
-
PR_JoinThread
-
PR_GetCurrentThread
-
Controlling Thread Priorities
-
PR_GetThreadPriority
-
PR_SetThreadPriority
-
Controlling Per-Thread Private Data
-
PR_NewThreadPrivateIndex
-
PR_SetThreadPrivate
-
PR_GetThreadPrivate
-
Interrupting and Yielding
-
PR_Interrupt
-
PR_ClearInterrupt
-
PR_Sleep
-
Setting Global Thread Concurrency
-
PR_SetConcurrency
-
Getting a Thread's Scope
-
PR_GetThreadScope
This chapter describes the NSPR API for versioning, process
initialization, and shutdown of NSPR.
-
Identity and Versioning
-
Name and Version Constants
-
PR_VersionCheck
-
Initialization and Cleanup
-
PR_Init
-
PR_Initialize
-
PR_Initialized
-
PR_Cleanup
-
PR_DisableClockInterrupts
-
PR_BlockClockInterrupts
-
PR_UnblockClockInterrupts
-
PR_SetConcurrency
-
PR_ProcessExit
-
PR_Abort
-
Module Initialization
-
PRCallOnce
-
PRCallOnceFN
-
PR_CallOnce
This chapter describes the NSPR API for creation and manipulation
of a mutex of type PRLock.
-
Lock Type
-
PRLock
-
Lock Functions
-
PR_NewLock
-
PR_DestroyLock
-
PR_Lock
-
PR_Unlock
This chapter describes the API for creating and destroying
condition variables, notifying condition variables of changes in monitored
data, and making a thread wait on such notification.
-
Condition Variable Type
-
PRCondVar
-
Condition Variable Functions
-
PR_NewCondVar
-
PR_DestroyCondVar
-
PR_WaitCondVar
-
PR_NotifyCondVar
-
PR_NotifyAllCondVar
In addition to the mutex type PRLock, NSPR provides a special
type, PRMonitor, for use in Java programming. This chapter describes the
NSPR API for creation and manipulation of a mutex of type PRMonitor.
-
Monitor Type
-
PRMonitor
-
Monitor Functions
-
PR_NewMonitor
-
PR_DestroyMonitor
-
PR_EnterMonitor
-
PR_ExitMonitor
-
PR_Wait
-
PR_Notify
-
PR_NotifyAll
This chapter describes the functions you use when you work
with cached monitors. Unlike a plain monitor, a cached monitor is associated
with the address of a protected object, and the association is maintained
only while the protection is needed. This arrangement allows a cached monitor
to be associated with another object without preallocating a monitor for
all objects. A hash table is used to quickly map addresses to their respective
monitors. The system automatically enlarges the hash table as needed.
-
Cached Monitors Functions
-
PR_CEnterMonitor
-
PR_CExitMonitor
-
PR_CWait
-
PR_CNotify
-
PR_CNotifyAll
This chapter describes the most common NSPR types, enumerations,
and structures used with the functions described in Chapter 10, "I/O Functions"
and Chapter 11, "Network Addresses." These include the types used for system
access, normal file I/O, and socket (network) I/O.
-
Directory Type
-
PRDir
-
File Descriptor Types
-
PRFileDesc
-
PRIOMethods
-
PRFilePrivate
-
PRDescIdentity
-
File Info Types
-
PRFileInfo
-
PRFileInfo64
-
PRFileType
-
Network Address Types
-
PRNetAddr
-
PRIPv6Addr
-
Types Used with Socket Options Functions
-
PRSocketOptionData
-
PRSockOption
-
PRLinger
-
PRMcastRequest
-
Type Used with Memory-Mapped I/O
-
PRFileMap
-
Offset Interpretation for Seek Functions
-
PRSeekWhence
This chapter describes the NSPR functions used to perform operations
such as system access, normal file I/O, and socket (network) I/O.
-
Functions that Operate on Pathnames
-
PR_Open
-
PR_Delete
-
PR_GetFileInfo
-
PR_GetFileInfo64
-
PR_Rename
-
PR_Access
-
Functions that Act on File Descriptors
-
PR_Close
-
PR_Read
-
PR_Write
-
PR_Writev
-
PR_GetOpenFileInfo
-
PR_GetOpenFileInfo64
-
PR_Seek
-
PR_Seek64
-
PR_Available
-
PR_Available64
-
PR_Sync
-
PR_GetDescType
-
PR_GetSpecialFD
-
Directory I/O Functions
-
PR_OpenDir
-
PR_ReadDir
-
PR_CloseDir
-
PR_MkDir
-
PR_RmDir
-
Socket Manipulation Functions
-
PR_NewUDPSocket
-
PR_NewTCPSocket
-
PR_Connect
-
PR_Accept
-
PR_Bind
-
PR_Listen
-
PR_Shutdown
-
PR_Recv
-
PR_Send
-
PR_RecvFrom
-
PR_SendTo
-
PR_TransmitFile
-
PR_AcceptRead
-
PR_GetSockName
-
PR_GetPeerName
-
PR_GetSocketOption
-
PR_SetSocketOption
-
Converting Between Host and Network Addresses
-
PR_ntohs
-
PR_ntohl
-
PR_htons
-
PR_htonl
-
PR_FamilyInet
-
Memory-Mapped I/O Functions
-
PR_CreateFileMap
-
PR_MemMap
-
PR_MemUnmap
-
PR_CloseFileMap
-
Anonymous Pipe Function
-
PR_CreatePipe
-
Polling Function
-
PR_Poll
-
Manipulating Layers
-
PR_GetUniqueIdentity
-
PR_GetNameForIdentity
-
PR_GetLayersIdentity
-
PR_GetIdentitiesLayer
-
PR_CreateIOLayerStub
-
PR_PushIOLayer
-
PR_PopIOLayer
-
PR_GetDefaultIOMethods
This chapter describes the NSPR types and functions used to
manipulate network addresses.
-
Network Address Types and Constants
-
PRHostEnt
-
PRProtoEnt
-
PR_NETDB_BUF_SIZE
-
Network Address Functions
-
Initializing a Network Address
-
PR_InitializeNetAddr
-
Converting Between a String and a Network
Address
-
PR_StringToNetAddr
-
PR_NetAddrToString
-
Getting Host Names and Addresses
-
PR_GetHostByName
-
PR_GetHostByAddr
-
PR_EnumerateHostEnt
-
Getting Protocol Entries
-
PR_GetProtoByName
-
PR_GetProtoByNumber
-
Enabling IP v6
-
PR_SetIPv6Enable
This chapter describes the global functions you use to perform
atomic operations. The functions define a portable API that may be reliably
used in any environment. Since not all operating environments provide access
to such functions, their performance may vary considerably.
-
Atomic Operations Functions
-
PR_AtomicIncrement
-
PR_AtomicDecrement
-
PR_AtomicSet
NSPR defines a platform-dependent type, PRIntervalTime, for
timing intervals of fewer than 14 hours. This chapter describes PRIntervalTime
and the functions that allow you to use it for timing purposes:
-
Interval Time Type and Constants
-
PRIntervalTime
-
Interval Functions
-
Getting the Current Interval and Ticks Per
Second
-
PR_IntervalNow
-
PR_TicksPerSecond
-
Converting Standard Clock Units to Platform-Dependent
Intervals
-
PR_SecondsToInterval
-
PR_MillisecondsToInterval
-
PR_MicrosecondsToInterval
-
Converting Platform-Dependent Intervals to
Standard Clock Units
-
PR_IntervalToSeconds
-
PR_IntervalToMilliseconds
-
PR_IntervalToMicroseconds
This chapter describes the functions for retrieving and setting
errors and the error codes set by NSPR.
-
Error Type
-
PRErrorCode
-
Error Functions
-
PR_SetError
-
PR_SetErrorText
-
PR_GetError
-
PR_GetOSError
-
PR_GetErrorTextLength
-
PR_GetErrorText
-
Error Codes
-
This chapter describes NSPR's platform independent 64 bit integer operations.
-
Initialization and Limits
-
LL_MaxInt
-
LL_MinInt
-
LL_Zero
-
LL_INIT
-
Relational Operators
-
LL_IS_ZERO
-
LL_EQ
-
LL_NE
-
LL_GE_ZERO
-
LL_CMP
-
LL_UCMP
-
Logical Operators
-
LL_AND
-
LL_OR
-
LL_XOR
-
LL_OR2
-
LL_NOT
-
Arithmetic Operators
-
LL_NEG
-
LL_ADD
-
LL_SUB
-
LL_MUL
-
LL_DIV
-
LL_MOD
-
Shift Operators
-
LL_SHL
-
LL_SHR
-
LL_USHR
-
LL_ISHL
-
Conversion Operators
-
LL_L2I
-
LL_L2UI
-
LL_L2F
-
LL_L2D
-
LL_I2L
-
LL_UI2L
-
LL_F2L
-
LL_D2L
-
LL_UDIVMOD
-
BitMap Type
-
prbitmap_t
-
BitMap Functions
-
PR_TEST_BIT
-
PR_SET_BIT
-
PR_CLEAR_BIT
-
PR_CeilingLog2
-
PR_FloorLog2
-
PR_CEILING_LOG2
PR_FLOOR_LOG2
-
Formatting specification
-
Output functions
-
PR_snprintf
-
PR_smprintf
-
PR_sprintf_append
-
PR_sxprintf
-
PR_fprintf
-
va_list versions
-
Scanning function
-
PR_sscanf
-
Conditional Compilation and Execution
-
Log Types
-
PRLogModuleInfo
-
PRLogModuleLevel
-
Environment Variables
-
NSPR_LOG_MODULES
-
NSPR_LOG_FILE
-
Functions and Macros
-
PR_NewLogModule
-
PR_SetLogFile
-
PR_SetLogBuffering
-
PR_LogPrint
-
PR_LogFlush
-
PR_LOG_TEST
-
PR_LOG
-
PR_Assert
-
PR_ASSERT
-
PR_NOT_REACHED
-
Use Example
-
Types
-
PRLibrary
-
PRStaticLinkTable
-
Functions
-
PR_SetLibraryPath
-
PR_GetLibraryPath
-
PR_GetLibraryName
-
PR_FreeLibraryName
-
PR_LoadLibrary
-
PR_UnloadLibrary
-
PR_FindSymbol
-
PR_FindSymbolAndLibrary
-
PR_LoadStaticLibrary
-
Types
-
PRSysInfo
-
Functions
-
PR_GetSystemInfo
-
PR_GetPageSize
-
PR_GetPageShift
-
Functions
-
PR_GetEnv
-
Types
-
PRCList
-
Macros
-
PR-INIT_CLIST
-
PR_INIT_STATIC_CLIST
-
PR_APPEND_LINK
-
PR_INSERT_LINK
PR_NEXT_LINK
-
PR_PREV_LINK
-
PR_REMOVE_LINK
-
PR_REMOVE_AND_INIT_LINK
-
PR_INSERT_BEFORE
-
PR_INSERT_AFTER
-
PR_CLIST_IS_EMPTY
-
PR_LIST_HEAD
-
PR_LIST_TAIL
-
Heap Functions and Macros
-
PR_Malloc
-
PR_Calloc
-
PR_Realloc
-
PR_Free
-
PR_MALLOC
-
PR_NEW
-
PR_REALLOC
-
PR_CALLOC
-
PR_NEWZAP
-
PR_DELETE
-
PR_FREEIF
-
Multiwait types
-
PRWaitGroup
-
PWMWStatus
-
PRMemoryDescriptor
-
PRRecvWait
-
Multiwait functions
-
PR_CreateWaitGroup
-
PR_DestroyWaitGroup
-
PR_AddWaitFileDesc
-
PR_WaitRecvReady
-
PR_CancelWaitFileDesc
-
PR_CancelWaitGroup
-
Handling stdio for command line
applications
-
PR_STDIO_INIT
-
Callback functions for application
programs using NSPR 2.0
-
Callback
Method Registration Structure
-
PRMethodCallbackStr
-
Callback
Functions
-
PR_INIT_CALLBACKS
-
_PL_W16CallBackMalloc
-
_PL_W16CallBackCalloc
-
_PL_W16CallBackRealloc
-
_PL_W16CallBackFrees
-
_PL_W16CallBackGetenv
-
_PL_W16CallBackPutenv
-
_PL_W16CallBackStrftim
-
C++ Exception Context
PR_W16SetExceptionContext
PR_W16GetExceptionContext
Last updated: Wed Jul 15 12:31:10 PDT 1998
Copyright © 1998 Netscape
Communications Corporation
|