aboutsummaryrefslogtreecommitdiffstats
path: root/util/err-to-raise
blob: 4eb9159536b2c4a7a07e370f8605254dd17edfaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env perl
# Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License").  You may not use
# this file except in compliance with the License.  You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html

# Run this program like this:
#       perl -pi util/err-to-raise files...
# or
#       git ls-files | grep '\.c$' | xargs perl -pi util/err-to-raise
# Consider running util/merge-err-lines first, to catch most (all?) of the
# cases where the XXXerr() call is split into two lines.

use strict;
use warnings;

s/\b([_A-Z0-9]+)err\(\s*\w+\s*,/ERR_raise(ERR_LIB_$1,/;