Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
_pcos.h File Reference
#include <stdlib.h>
#include <sys/stat.h>
#include <io.h>
#include <fcntl.h>

Go to the source code of this file.

Defines

#define PR_DLL_SUFFIX   ".dll"
#define DIRECTORY_SEPARATOR   '\\'
#define DIRECTORY_SEPARATOR_STR   "\\"
#define PATH_SEPARATOR   ';'
#define GCPTR
#define _MD_GETHOSTNAME   _MD_WindowsGetHostName
#define _MD_GETSYSINFO   _MD_WindowsGetSysInfo

Functions

int getopt (int argc, char **argv, char *spec)
PR_END_EXTERN_C PRStatus _MD_WindowsGetHostName (char *name, PRUint32 namelen)
PRStatus _MD_WindowsGetSysInfo (PRSysInfo cmd, char *name, PRUint32 namelen)

Variables

PR_BEGIN_EXTERN_C char * optarg
int optind

Define Documentation

Definition at line 84 of file _pcos.h.

Definition at line 86 of file _pcos.h.

Definition at line 45 of file _pcos.h.

Definition at line 46 of file _pcos.h.

Definition at line 52 of file _pcos.h.

Definition at line 47 of file _pcos.h.

#define PR_DLL_SUFFIX   ".dll"

Definition at line 41 of file _pcos.h.


Function Documentation

PR_END_EXTERN_C PRStatus _MD_WindowsGetHostName ( char *  name,
PRUint32  namelen 
)

Definition at line 490 of file ntmisc.c.

{
    PRIntn rv;
    PRInt32 syserror;

    rv = gethostname(name, (PRInt32) namelen);
    if (0 == rv) {
        return PR_SUCCESS;
    }
    syserror = WSAGetLastError();
    PR_ASSERT(WSANOTINITIALISED != syserror);
       _PR_MD_MAP_GETHOSTNAME_ERROR(syserror);
    return PR_FAILURE;
}

Here is the call graph for this function:

PRStatus _MD_WindowsGetSysInfo ( PRSysInfo  cmd,
char *  name,
PRUint32  namelen 
)

Definition at line 505 of file ntmisc.c.

{
       OSVERSIONINFO osvi;

       PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE));

       ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
       osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);

       if (! GetVersionEx (&osvi) ) {
              _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
       return PR_FAILURE;
       }

       switch (osvi.dwPlatformId) {
              case VER_PLATFORM_WIN32_NT:
                     if (PR_SI_SYSNAME == cmd)
                            (void)PR_snprintf(name, namelen, "Windows_NT");
                     else if (PR_SI_RELEASE == cmd)
                            (void)PR_snprintf(name, namelen, "%d.%d",osvi.dwMajorVersion, 
                                                        osvi.dwMinorVersion);
                     break;
              case VER_PLATFORM_WIN32_WINDOWS:
                     if (PR_SI_SYSNAME == cmd) {
                            if ((osvi.dwMajorVersion > 4) || 
                                   ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0)))
                                   (void)PR_snprintf(name, namelen, "Windows_98");
                            else
                                   (void)PR_snprintf(name, namelen, "Windows_95");
                     } else if (PR_SI_RELEASE == cmd) {
                            (void)PR_snprintf(name, namelen, "%d.%d",osvi.dwMajorVersion, 
                                                        osvi.dwMinorVersion);
                     }
                     break;
              default:
                     if (PR_SI_SYSNAME == cmd)
                            (void)PR_snprintf(name, namelen, "Windows_Unknown");
                     else if (PR_SI_RELEASE == cmd)
                            (void)PR_snprintf(name, namelen, "%d.%d",0,0);
                     break;
       }
       return PR_SUCCESS;
}

Here is the call graph for this function:

int getopt ( int  argc,
char **  argv,
char *  spec 
)

Definition at line 77 of file getopt.c.

{
       static char *place = EMSG;              /* option letter processing */
       register char *oli;                     /* option letter list index */
       char *p;

       if (!*place) {                          /* update scanning pointer */
              if (optind >= nargc || *(place = nargv[optind]) != '-') {
                     place = EMSG;
                     return(EOF);
              }
              if (place[1] && *++place == '-') {      /* found "--" */
                     ++optind;
                     place = EMSG;
                     return(EOF);
              }
       }                                       /* option letter okay? */
       if ((optopt = (int)*place++) == (int)':' ||
           !(oli = index(ostr, optopt))) {
              /*
               * if the user didn't specify '-' as an option,
               * assume it means EOF.
               */
              if (optopt == (int)'-')
                     return(EOF);
              if (!*place)
                     ++optind;
              if (opterr) {
                     if (!(p = rindex(*nargv, '/')))
                            p = *nargv;
                     else
                            ++p;
                     (void)fprintf(stderr, "%s: illegal option -- %c\n",
                         p, optopt);
              }
              return(BADCH);
       }
       if (*++oli != ':') {                    /* don't need argument */
              optarg = NULL;
              if (!*place)
                     ++optind;
       }
       else {                                  /* need an argument */
              if (*place)                     /* no white space */
                     optarg = place;
              else if (nargc <= ++optind) {   /* no arg */
                     place = EMSG;
                     if (!(p = rindex(*nargv, '/')))
                            p = *nargv;
                     else
                            ++p;
                     if (opterr)
                            (void)fprintf(stderr,
                                "%s: option requires an argument -- %c\n",
                                p, optopt);
                     return(BADCH);
              }
              else                            /* white space */
                     optarg = nargv[optind];
              place = EMSG;
              ++optind;
       }
       return(optopt);                         /* dump back option letter */
}

Variable Documentation

Definition at line 72 of file getopt.c.

Definition at line 70 of file getopt.c.