From be8efac78d067c138ad8dda03df4336e73f94887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Jan 2022 11:51:07 +0100 Subject: New upstream version 1.0 --- lib/declared.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lib/declared.sh') diff --git a/lib/declared.sh b/lib/declared.sh index fbd5996c..ae697b2e 100755 --- a/lib/declared.sh +++ b/lib/declared.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2006-2022 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # # This script determines the declared global symbols in a C header file. @@ -24,6 +24,8 @@ # - All declarations end in ';' on the same line. # - Not more than one symbol is declared in a declaration. +# This script requires GNU sed. + # func_usage # outputs to stdout the --help usage message. func_usage () @@ -44,9 +46,9 @@ Report bugs to ." # outputs to stdout the --version message. func_version () { - echo "declared.sh (GNU libunistring)" - echo "Copyright (C) 2006, 2009 Free Software Foundation, Inc. -License GPLv3+: GNU GPL version 3 or later + echo "declared.sh (GNU gnulib)" + echo "Copyright (C) 2021 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law." echo "Written by" "Bruno Haible" @@ -70,7 +72,7 @@ while test $# -gt 0; do --version | --versio | --versi | --vers | --ver | --ve | --v ) func_version exit 0 ;; - -- ) # Stop option prcessing + -- ) # Stop option processing shift; break ;; -* ) func_fatal_error "unrecognized option: $option" @@ -118,17 +120,17 @@ test "$sed_result" = 'aaa' \ # A sed expression that joins 'extern' declarations that are broken over # several lines. sed_join_multiline_externs=' -/^extern [^;]*$/{ +/^extern [^;"]*$/{ :a N s/\n/ /g - /^extern [^;]*$/{ + /^extern [^;"]*$/{ ba } }' # A sed expression that extracts the identifier of each 'extern' declaration. -sed_extract_extern_declared='s/^extern [^()]* \([A-Za-z_][A-Za-z0-9_]*\) *[;(].*$/\1/p' +sed_extract_extern_declared='s/^extern [^()]*[ *]\([A-Za-z_][A-Za-z0-9_]*\) *[;(].*$/\1/p' sed -e "$sed_remove_comments" \ | sed -e "$sed_join_multiline_externs" \ -- cgit v1.2.3