]> git.ipfire.org Git - thirdparty/openssl.git/blame - util/err-to-raise
Add script convert XXerr to ERR_raise
[thirdparty/openssl.git] / util / err-to-raise
CommitLineData
0f17ac26
RS
1#! /usr/bin/env perl
2# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
3#
4# Licensed under the Apache License 2.0 (the "License"). You may not use
5# this file except in compliance with the License. You can obtain a copy
6# in the file LICENSE in the source distribution or at
7# https://www.openssl.org/source/license.html
8
9# Run this program like this:
10# perl -pi util/err-to-error files...
11# or
12# git ls-files | grep '\.c$' | xargs perl -pi util/err-to-raise
13# There will be some hand-edits necessary, when the second arg was on a
14# separate line.
15
16use strict;
17use warnings;
18
19s/ASN1err\([0-9A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_ASN1, $1)/;
20s/ASYNCerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_ASYNC, $1)/;
21s/BIOerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_BIO, $1)/;
22s/BNerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_BN, $1)/;
23s/BUFerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_BUF, $1)/;
24s/CMPerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_CMP, $1)/;
25s/CMSerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_CMS, $1)/;
26s/COMPerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_COMP, $1)/;
27s/CONFerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_CONF, $1)/;
28s/CRMFerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_CRMF, $1)/;
29s/CRYPTOerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_CRYPTO, $1)/;
30s/CTerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_CT, $1)/;
31s/DHerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_DH, $1)/;
32s/DSAerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_DSA, $1)/;
33s/DSOerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_DSO, $1)/;
34s/ECDHerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_ECDH, $1)/;
35s/ECDSAerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_ECDSA, $1)/;
36s/ECerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_EC, $1)/;
37s/ENGINEerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_ENGINE, $1)/;
38s/ESSerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_ESS, $1)/;
39s/EVPerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_EVP, $1)/;
40s/FIPSerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_FIPS, $1)/;
41s/KDFerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_KDF, $1)/;
42s/OBJerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_OBJ, $1)/;
43s/OCSPerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_OCSP, $1)/;
44s/OSSL_STOREerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_OSSL_STORE, $1)/;
45s/PEMerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_PEM, $1)/;
46s/PKCS12err\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_PKCS12, $1)/;
47s/PKCS7err\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_PKCS7, $1)/;
48s/PROPerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_PROP, $1)/;
49s/PROVerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_PROV, $1)/;
50s/RANDerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_RAND, $1)/;
51s/RSAerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_RSA, $1)/;
52s/SM2err\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_SM2, $1)/;
53s/SSLerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_SSL, $1)/;
54s/SYSerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_SYS, $1)/;
55s/TSerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_TS, $1)/;
56s/UIerr\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_UI, $1)/;
57s/X509V3err\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_X509V3, $1)/;
58s/X509err\([A-Z_]+, *([0-9A-Z_]+)\)/ERR_raise(ERR_LIB_X509, $1)/;