Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
errset.c File Reference
#include "prerror.h"
#include "plgetopt.h"
#include "prlog.h"
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Classes

struct  errinfo

Functions

int main (int argc, char **argv)
 The Xalan testcases app.

Variables

static int _debug_on = 0

Class Documentation

struct errinfo

Definition at line 52 of file errcodes.c.

Class Members
PRErrorCode errcode
char * errname

Function Documentation

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 142 of file errset.c.

{

       int count, errnum;

    /*
     * -d           debug mode
     */

    PLOptStatus os;
    PLOptState *opt = PL_CreateOptState(argc, argv, "d");
    while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
    {
        if (PL_OPT_BAD == os) continue;
        switch (opt->option)
        {
        case 'd':  /* debug mode */
            _debug_on = 1;
            break;
        default:
            break;
        }
    }
    PL_DestroyOptState(opt);

       count = sizeof(errcodes)/sizeof(errcodes[0]);
       printf("\nNumber of error codes = %d\n\n",count);
       for (errnum = 0; errnum < count; errnum++) {
        PRInt32 len1, len2, err;
        char    msg[256];

        PR_SetError( errnum, -5 );
        err = PR_GetError();
        PR_ASSERT( err == errnum );
        err = PR_GetOSError();
        PR_ASSERT( err == -5 );
        PR_SetErrorText( strlen(errcodes[errnum].errname), errcodes[errnum].errname );
        len1 = PR_GetErrorTextLength();
        len2 = PR_GetErrorText( msg );
        PR_ASSERT( len1 == len2 );
        printf("%5.5d -- %s\n", errnum, msg );
    }

       return 0;
}

Variable Documentation

int _debug_on = 0 [static]

Definition at line 57 of file errset.c.