Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions | Variables
sslerror.h File Reference
#include <stdio.h>
#include <string.h>
#include "nspr.h"
#include "secerr.h"
#include "sslerr.h"
#include "SSLerrs.h"
#include "SECerrs.h"
#include "NSPRerrs.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  tuple_str


#define ER2(a, b)   {a, b},
#define ER3(a, b, c)   {a, c},


typedef struct tuple_str


const char * SSL_Strerror (PRErrorCode errNum)


const tuple_str errStrings []
const PRInt32 numStrings = sizeof(errStrings) / sizeof(tuple_str)

Class Documentation

struct tuple_str

Definition at line 105 of file errormap.c.

Class Members
CK_RV errNum
PRErrorCode errNum
const char * errString

Define Documentation

#define ER2 (   a,
)    {a, b},

Definition at line 48 of file sslerror.h.

#define ER3 (   a,
)    {a, c},

Definition at line 49 of file sslerror.h.

Typedef Documentation

typedef struct tuple_str

Definition at line 46 of file sslerror.h.

Function Documentation

const char* SSL_Strerror ( PRErrorCode  errNum)

Definition at line 69 of file sslerror.h.

    PRInt32 low  = 0;
    PRInt32 high = numStrings - 1;
    PRInt32 i;
    PRErrorCode num;
    static int initDone;

    /* make sure table is in ascending order.
     * binary search depends on it.
    if (!initDone) {
       PRErrorCode lastNum = (PRInt32)0x80000000;
       for (i = low; i <= high; ++i) {
           num = errStrings[i].errNum;
           if (num <= lastNum) {
"sequence error in error strings at item %d\n"
"error %d (%s)\n"
"should come after \n"
"error %d (%s)\n",
                      i, lastNum, errStrings[i-1].errString, 
                     num, errStrings[i].errString);
           lastNum = num;
       initDone = 1;

    /* Do binary search of table. */
    while (low + 1 < high) {
       i = (low + high) / 2;
       num = errStrings[i].errNum;
       if (errNum == num) 
           return errStrings[i].errString;
        if (errNum < num)
           high = i;
           low = i;
    if (errNum == errStrings[low].errNum)
       return errStrings[low].errString;
    if (errNum == errStrings[high].errNum)
       return errStrings[high].errString;
    return NULL;

Here is the call graph for this function:

Variable Documentation

Initial value:


Definition at line 54 of file sslerror.h.

Definition at line 63 of file sslerror.h.