NSPR Reference Previous Contents Next |
System Information Types
System Information and Environment Variable Functions
PRSysInfo
is defined to represent system information.
typedef enum {
PR_SI_HOSTNAME, /* name of the host */
PR_SI_SYSNAME, /* name of the system */
PR_SI_RELEASE, /* release number of the system */
PR_SI_ARCHITECTURE /* architecture of the system */
} PRSysInfo;
PR_GetSystemInfo
function.
PR_GetSystemInfo
PR_GetPageSize
PR_GetPageShift
The function for obtaining the values of environment variables is:
#include <prsystem.h>
PRStatus PR_GetSystemInfo (
PRSysInfo cmd,
char *buf,
PRUint32 buflen);
PR_SUCCESS
; otherwise, PR_FAILURE
.
cmd
. The type of
information is as follows:
PR_SI_HOSTNAME
|
Name of the host
|
PR_SI_SYSNAME
|
Name of the system
|
PR_SI_RELEASE
|
Release number of the system
|
PR_SI_ARCHITECTURE
|
Architecture of the system
|
Upon a successful return the system information is contained in a NULL
-terminated
string in the specified buffer. The buffer must be pre-allocated by the caller and
should be at least SYS_INFO_BUFFER_LENGTH
bytes in length.
#include <prsystem.h>
PRInt32 PR_GetPageSize(void);
#include <prsystem.h>
PRInt32 PR_GetPageShift(void);
#include <prenv.h
char* PR_GetEnv(const char *name);
name
|
A pointer to a NULL -terminated string containing the name of the
environment variable.
|
NULL
.
name=
value. If a match is found, the function returns a pointer to
the value. If the environment variable is not defined, the function returns NULL
.
Caution: The returned pointer should be treated as a const char*
.
Last Updated May 18, 2001