xref: /freebsd/crypto/openssl/util/err-to-raise (revision e1d31d0685f0b430f385023b7de49f47be6c7de0)
1#! /usr/bin/env perl
2# Copyright 2019-2020 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-raise files...
11# or
12#       git ls-files | grep '\.c$' | xargs perl -pi util/err-to-raise
13# Consider running util/merge-err-lines first, to catch most (all?) of the
14# cases where the XXXerr() call is split into two lines.
15
16# Do not use this in engines/, they have their own error reporting functions,
17# which do call ERR_raise().
18
19use strict;
20use warnings;
21
22s/\b([_A-Z0-9]+)err\(\s*\w+\s*,/ERR_raise(ERR_LIB_$1,/;
23