nsprpub/pr/include/prsystem.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef prsystem_h___
     7 #define prsystem_h___
     9 /*
    10 ** API to NSPR functions returning system info.
    11 */
    12 #include "prtypes.h"
    14 PR_BEGIN_EXTERN_C
    16 /*
    17 ** Get the host' directory separator.
    18 **  Pathnames are then assumed to be of the form:
    19 **      [<sep><root_component><sep>]*(<component><sep>)<leaf_name>
    20 */
    22 NSPR_API(char) PR_GetDirectorySeparator(void);
    24 /*
    25 ** OBSOLETE -- the function name is misspelled.
    26 ** Use PR_GetDirectorySeparator instead.
    27 */
    29 NSPR_API(char) PR_GetDirectorySepartor(void);
    31 /*
    32 ** Get the host' path separator.
    33 **  Paths are assumed to be of the form:
    34 **      <directory>[<sep><directory>]*
    35 */
    37 NSPR_API(char) PR_GetPathSeparator(void);
    39 /* Types of information available via PR_GetSystemInfo(...) */
    40 typedef enum {
    41     PR_SI_HOSTNAME,  /* the hostname with the domain name (if any)
    42                       * removed */
    43     PR_SI_SYSNAME,
    44     PR_SI_RELEASE,
    45     PR_SI_ARCHITECTURE,
    46     PR_SI_HOSTNAME_UNTRUNCATED  /* the hostname exactly as configured
    47                                  * on the system */
    48 } PRSysInfo;
    51 /*
    52 ** If successful returns a null termintated string in 'buf' for
    53 ** the information indicated in 'cmd'. If unseccussful the reason for
    54 ** the failure can be retrieved from PR_GetError().
    55 **
    56 ** The buffer is allocated by the caller and should be at least
    57 ** SYS_INFO_BUFFER_LENGTH bytes in length.
    58 */
    60 #define SYS_INFO_BUFFER_LENGTH 256
    62 NSPR_API(PRStatus) PR_GetSystemInfo(PRSysInfo cmd, char *buf, PRUint32 buflen);
    64 /*
    65 ** Return the number of bytes in a page
    66 */
    67 NSPR_API(PRInt32) PR_GetPageSize(void);
    69 /*
    70 ** Return log2 of the size of a page
    71 */
    72 NSPR_API(PRInt32) PR_GetPageShift(void);
    74 /*
    75 ** PR_GetNumberOfProcessors() -- returns the number of CPUs
    76 **
    77 ** Description:
    78 ** PR_GetNumberOfProcessors() extracts the number of processors
    79 ** (CPUs available in an SMP system) and returns the number.
    80 ** 
    81 ** Parameters:
    82 **   none
    83 **
    84 ** Returns:
    85 **   The number of available processors or -1 on error
    86 ** 
    87 */
    88 NSPR_API(PRInt32) PR_GetNumberOfProcessors( void );
    90 /*
    91 ** PR_GetPhysicalMemorySize() -- returns the amount of system RAM
    92 **
    93 ** Description:
    94 ** PR_GetPhysicalMemorySize() determines the amount of physical RAM
    95 ** in the system and returns the size in bytes.
    96 **
    97 ** Parameters:
    98 **   none
    99 **
   100 ** Returns:
   101 **   The amount of system RAM, or 0 on failure.
   102 **
   103 */
   104 NSPR_API(PRUint64) PR_GetPhysicalMemorySize(void);
   106 PR_END_EXTERN_C
   108 #endif /* prsystem_h___ */

mercurial