2012-10-01 22:02:15 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-08-19 19:27:10 +04:00
|
|
|
#include "prerror.h"
|
|
|
|
#include "secerr.h"
|
|
|
|
#include "secport.h"
|
|
|
|
#include "prinit.h"
|
|
|
|
#include "prprf.h"
|
|
|
|
#include "prtypes.h"
|
|
|
|
#include "prlog.h"
|
|
|
|
#include "plstr.h"
|
|
|
|
#include "nssutil.h"
|
|
|
|
#include <string.h>
|
|
|
|
|
2016-09-08 18:03:14 +03:00
|
|
|
#define ER3(name, value, str) { #name, str },
|
2011-08-19 19:27:10 +04:00
|
|
|
|
|
|
|
static const struct PRErrorMessage sectext[] = {
|
|
|
|
#include "SECerrs.h"
|
2016-09-08 18:03:14 +03:00
|
|
|
{ 0, 0 }
|
2011-08-19 19:27:10 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct PRErrorTable sec_et = {
|
2016-09-08 18:03:14 +03:00
|
|
|
sectext, "secerrstrings", SEC_ERROR_BASE,
|
|
|
|
(sizeof sectext) / (sizeof sectext[0])
|
2011-08-19 19:27:10 +04:00
|
|
|
};
|
|
|
|
|
2016-09-08 18:03:14 +03:00
|
|
|
static PRStatus
|
|
|
|
nss_InitializePRErrorTableOnce(void)
|
|
|
|
{
|
2011-08-19 19:27:10 +04:00
|
|
|
return PR_ErrorInstallTable(&sec_et);
|
|
|
|
}
|
|
|
|
|
|
|
|
static PRCallOnceType once;
|
|
|
|
|
2011-10-08 00:37:26 +04:00
|
|
|
SECStatus
|
2011-08-19 19:27:10 +04:00
|
|
|
NSS_InitializePRErrorTable(void)
|
|
|
|
{
|
2011-10-08 00:37:26 +04:00
|
|
|
return (PR_SUCCESS == PR_CallOnce(&once, nss_InitializePRErrorTableOnce))
|
2016-09-08 18:03:14 +03:00
|
|
|
? SECSuccess
|
|
|
|
: SECFailure;
|
2011-08-19 19:27:10 +04:00
|
|
|
}
|