Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | #include "prerror.h" |
michael@0 | 5 | #include "secerr.h" |
michael@0 | 6 | #include "secport.h" |
michael@0 | 7 | #include "prinit.h" |
michael@0 | 8 | #include "prprf.h" |
michael@0 | 9 | #include "prtypes.h" |
michael@0 | 10 | #include "prlog.h" |
michael@0 | 11 | #include "plstr.h" |
michael@0 | 12 | #include "nssutil.h" |
michael@0 | 13 | #include <string.h> |
michael@0 | 14 | |
michael@0 | 15 | #define ER3(name, value, str) {#name, str}, |
michael@0 | 16 | |
michael@0 | 17 | static const struct PRErrorMessage sectext[] = { |
michael@0 | 18 | #include "SECerrs.h" |
michael@0 | 19 | {0,0} |
michael@0 | 20 | }; |
michael@0 | 21 | |
michael@0 | 22 | static const struct PRErrorTable sec_et = { |
michael@0 | 23 | sectext, "secerrstrings", SEC_ERROR_BASE, |
michael@0 | 24 | (sizeof sectext)/(sizeof sectext[0]) |
michael@0 | 25 | }; |
michael@0 | 26 | |
michael@0 | 27 | static PRStatus |
michael@0 | 28 | nss_InitializePRErrorTableOnce(void) { |
michael@0 | 29 | return PR_ErrorInstallTable(&sec_et); |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | static PRCallOnceType once; |
michael@0 | 33 | |
michael@0 | 34 | SECStatus |
michael@0 | 35 | NSS_InitializePRErrorTable(void) |
michael@0 | 36 | { |
michael@0 | 37 | return (PR_SUCCESS == PR_CallOnce(&once, nss_InitializePRErrorTableOnce)) |
michael@0 | 38 | ? SECSuccess : SECFailure; |
michael@0 | 39 | } |
michael@0 | 40 |