Replace EVP_MAC_CTX_copy() by EVP_MAC_CTX_dup()
[openssl.git] / util / find-unused-errs
index 68cf66b15f884802311f1fd8fc248223b97448f0..467ef253b51969c4544c0a68c6a03051290d3003 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/bash
 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
 #
-# Licensed under the OpenSSL license (the "License").  You may not use
+# 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
 export X1=/tmp/f.1.$$
 export X2=/tmp/f.2.$$
 
+case "$1" in
+    -f)
+        PAT='_F_'
+        echo Functions only
+        ;;
+    -[er])
+        PAT='_R_'
+        echo Reason codes only
+        ;;
+    "")
+        PAT='_[FR]_'
+        echo Function and reasons
+        ;;
+    *)
+        echo "Usage error; one of -[efr] required."
+        exit 1;
+        ;;
+esac
+
 cd include/openssl || exit 1
-grep '_[RF]_' * | awk '{print $3;}' | sort -u >$X1
+grep "$PAT" *  | grep -v ERR_FATAL_ERROR | awk '{print $3;}' | sort -u >$X1
 cd ../..
 
 for F in `cat $X1` ; do