security/nss/lib/util/errstrs.c

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/util/errstrs.c	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +#include "prerror.h"
     1.8 +#include "secerr.h"
     1.9 +#include "secport.h"
    1.10 +#include "prinit.h"
    1.11 +#include "prprf.h"
    1.12 +#include "prtypes.h"
    1.13 +#include "prlog.h"
    1.14 +#include "plstr.h"
    1.15 +#include "nssutil.h"
    1.16 +#include <string.h>
    1.17 +
    1.18 +#define ER3(name, value, str) {#name, str},
    1.19 +
    1.20 +static const struct PRErrorMessage sectext[] = {
    1.21 +#include "SECerrs.h"
    1.22 +    {0,0}
    1.23 +};
    1.24 +
    1.25 +static const struct PRErrorTable sec_et = {
    1.26 +    sectext, "secerrstrings", SEC_ERROR_BASE, 
    1.27 +        (sizeof sectext)/(sizeof sectext[0]) 
    1.28 +};
    1.29 +
    1.30 +static PRStatus 
    1.31 +nss_InitializePRErrorTableOnce(void) {
    1.32 +    return PR_ErrorInstallTable(&sec_et);
    1.33 +}
    1.34 +
    1.35 +static PRCallOnceType once;
    1.36 +
    1.37 +SECStatus
    1.38 +NSS_InitializePRErrorTable(void)
    1.39 +{
    1.40 +    return (PR_SUCCESS == PR_CallOnce(&once, nss_InitializePRErrorTableOnce))
    1.41 +		? SECSuccess : SECFailure;
    1.42 +}
    1.43 +

mercurial