diff options
-rw-r--r-- | Makefile.in | 6 | ||||
-rw-r--r-- | aclocal.m4 | 2 | ||||
-rw-r--r-- | awklib/Makefile.in | 6 | ||||
-rw-r--r-- | configh.in | 1 | ||||
-rwxr-xr-x | configure | 58 | ||||
-rw-r--r-- | doc/Makefile.in | 6 | ||||
-rw-r--r-- | extension/Makefile.in | 6 | ||||
-rw-r--r-- | extension/filefuncs2.c | 99 | ||||
-rw-r--r-- | test/Makefile.in | 6 |
9 files changed, 83 insertions, 107 deletions
diff --git a/Makefile.in b/Makefile.in index 7420d3bb..f20c61ff 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,9 +89,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \ $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \ @@ -997,11 +997,11 @@ m4_include([m4/lib-prefix.m4]) m4_include([m4/libsigsegv.m4]) m4_include([m4/libtool.m4]) m4_include([m4/longlong.m4]) -m4_include([m4/mpfr.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) +m4_include([m4/mpfr.m4]) m4_include([m4/nls.m4]) m4_include([m4/noreturn.m4]) m4_include([m4/po.m4]) diff --git a/awklib/Makefile.in b/awklib/Makefile.in index 0ac79af6..2c421b3f 100644 --- a/awklib/Makefile.in +++ b/awklib/Makefile.in @@ -85,9 +85,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \ $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \ @@ -321,7 +321,6 @@ /* systems should define this type here */ #undef HAVE_WINT_T - /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL @@ -1426,8 +1426,10 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-lint Disable gawk lint checking - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] @@ -5749,7 +5751,7 @@ do for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -5828,7 +5830,7 @@ do for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -6084,7 +6086,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6128,7 +6130,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6541,7 +6543,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6581,7 +6583,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6887,7 +6889,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6927,7 +6929,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7030,7 +7032,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7074,7 +7076,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7199,7 +7201,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7239,7 +7241,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7298,7 +7300,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7338,7 +7340,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7987,7 +7989,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8027,7 +8029,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8107,7 +8109,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8147,7 +8149,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8199,7 +8201,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8239,7 +8241,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8291,7 +8293,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8331,7 +8333,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8383,7 +8385,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8423,7 +8425,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8475,7 +8477,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8515,7 +8517,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 diff --git a/doc/Makefile.in b/doc/Makefile.in index 70a498ad..15670b9e 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -85,9 +85,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \ $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \ diff --git a/extension/Makefile.in b/extension/Makefile.in index c766d898..72c75b02 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -85,9 +85,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \ $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \ diff --git a/extension/filefuncs2.c b/extension/filefuncs2.c index 73bea0c2..67b14185 100644 --- a/extension/filefuncs2.c +++ b/extension/filefuncs2.c @@ -7,7 +7,8 @@ */ /* - * Copyright (C) 2001, 2004, 2005, 2010, 2011 the Free Software Foundation, Inc. + * Copyright (C) 2001, 2004, 2005, 2010, 2011, 2012 + * the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -54,14 +55,14 @@ do_chdir(int nargs) if (do_lint && nargs != 1) lintwarn(ext_id, "chdir: called with incorrect number of arguments"); - newdir = get_curfunc_param(ext_id, 0, AWK_PARAM_STRING); + newdir = get_curfunc_param(0, AWK_PARAM_STRING); ret = chdir(newdir->str_value.str); if (ret < 0) - update_ERRNO_int(ext_id, errno); + update_ERRNO_int(errno); result.val_type = AWK_NUMBER; result.num_value = ret; - set_return_value(ext_id, & result); + set_return_value(& result); return 1; } @@ -220,10 +221,10 @@ array_set(awk_array_t array, const char *sub, awk_value_t *value) memset(& element, 0, sizeof(element)); - element.index = dup_string(ext_id, sub, strlen(sub))->str_value; + element.index = dup_string(sub, strlen(sub))->str_value; element.value = *value; - set_array_element(ext_id, array, & element); + set_array_element(array, & element); } /* do_stat --- provide a stat() function for gawk */ @@ -246,8 +247,8 @@ do_stat(int nargs) } /* file is first arg, array to hold results is second */ - file_param = get_curfunc_param(ext_id, 0, AWK_PARAM_STRING); - array_param = get_curfunc_param(ext_id, 0, AWK_PARAM_ARRAY); + file_param = get_curfunc_param(0, AWK_PARAM_STRING); + array_param = get_curfunc_param(0, AWK_PARAM_ARRAY); if (file_param == NULL || array_param == NULL) { warning(ext_id, "stat: bad paramaters"); @@ -259,43 +260,43 @@ do_stat(int nargs) array = array_param->array_cookie; /* empty out the array */ - clear_array(ext_id, array); + clear_array(array); /* lstat the file, if error, set ERRNO and return */ ret = lstat(name, & sbuf); if (ret < 0) { - update_ERRNO_int(ext_id, errno); + update_ERRNO_int(errno); ret = 0; goto out; } /* fill in the array */ - array_set(array, "name", make_string(ext_id, name, file_param->str_value.len)); - array_set(array, "dev", make_number(ext_id, (double) sbuf.st_dev)); - array_set(array, "ino", make_number(ext_id, (double) sbuf.st_ino)); - array_set(array, "mode", make_number(ext_id, (double) sbuf.st_mode)); - array_set(array, "nlink", make_number(ext_id, (double) sbuf.st_nlink)); - array_set(array, "uid", make_number(ext_id, (double) sbuf.st_uid)); - array_set(array, "gid", make_number(ext_id, (double) sbuf.st_gid)); - array_set(array, "size", make_number(ext_id, (double) sbuf.st_size)); - array_set(array, "blocks", make_number(ext_id, (double) sbuf.st_blocks)); - array_set(array, "atime", make_number(ext_id, (double) sbuf.st_atime)); - array_set(array, "mtime", make_number(ext_id, (double) sbuf.st_mtime)); - array_set(array, "ctime", make_number(ext_id, (double) sbuf.st_ctime)); + array_set(array, "name", make_string(name, file_param->str_value.len)); + array_set(array, "dev", make_number((double) sbuf.st_dev)); + array_set(array, "ino", make_number((double) sbuf.st_ino)); + array_set(array, "mode", make_number((double) sbuf.st_mode)); + array_set(array, "nlink", make_number((double) sbuf.st_nlink)); + array_set(array, "uid", make_number((double) sbuf.st_uid)); + array_set(array, "gid", make_number((double) sbuf.st_gid)); + array_set(array, "size", make_number((double) sbuf.st_size)); + array_set(array, "blocks", make_number((double) sbuf.st_blocks)); + array_set(array, "atime", make_number((double) sbuf.st_atime)); + array_set(array, "mtime", make_number((double) sbuf.st_mtime)); + array_set(array, "ctime", make_number((double) sbuf.st_ctime)); /* for block and character devices, add rdev, major and minor numbers */ if (S_ISBLK(sbuf.st_mode) || S_ISCHR(sbuf.st_mode)) { - array_set(array, "rdev", make_number(ext_id, (double) sbuf.st_rdev)); - array_set(array, "major", make_number(ext_id, (double) major(sbuf.st_rdev))); - array_set(array, "minor", make_number(ext_id, (double) minor(sbuf.st_rdev))); + array_set(array, "rdev", make_number((double) sbuf.st_rdev)); + array_set(array, "major", make_number((double) major(sbuf.st_rdev))); + array_set(array, "minor", make_number((double) minor(sbuf.st_rdev))); } #ifdef HAVE_ST_BLKSIZE - array_set(array, "blksize", make_number(ext_id, (double) sbuf.st_blksize)); + array_set(array, "blksize", make_number((double) sbuf.st_blksize)); #endif /* HAVE_ST_BLKSIZE */ pmode = format_mode(sbuf.st_mode); - array_set(array, "pmode", make_string(ext_id, pmode, strlen(pmode))); + array_set(array, "pmode", make_string(pmode, strlen(pmode))); /* for symbolic links, add a linkval field */ if (S_ISLNK(sbuf.st_mode)) { @@ -304,7 +305,7 @@ do_stat(int nargs) if ((buf = read_symlink(name, sbuf.st_size, &linksize)) != NULL) - array_set(array, "linkval", make_string(ext_id, buf, linksize)); + array_set(array, "linkval", make_string(buf, linksize)); else warning(ext_id, "unable to read symbolic link `%s'", name); } @@ -345,46 +346,20 @@ do_stat(int nargs) #endif } - array_set(array, "type", make_string(ext_id, type, strlen(type))); + array_set(array, "type", make_string(type, strlen(type))); ret = 1; /* success */ out: - set_return_value(ext_id, make_number(ext_id, (double) ret)); + set_return_value(make_number((double) ret)); } +static awk_ext_func_t func_table[] = { + { "chdir", do_chdir, 1 }, + { "stat", do_stat, 2 }, +}; -/* dl_load --- load new builtins in this library */ -int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) -{ - static awk_ext_func_t func_table[] = { - { "chdir", do_chdir, 1 }, - { "stat", do_stat, 2 }, - }; - size_t i, j; - int errors = 0; - - if (api->major_version != GAWK_API_MAJOR_VERSION - || api->minor_version < GAWK_API_MINOR_VERSION) { - fprintf(stderr, "filefuncs: version mismatch with gawk!\n"); - fprintf(stderr, "\tmy version (%d, %d), gawk version (%d, %d)\n", - GAWK_API_MAJOR_VERSION, GAWK_API_MINOR_VERSION, - api->major_version, api->minor_version); - exit(1); - } - - api = api_p; - ext_id = id; +/* define the dl_load function using the boilerplate macro */ - /* load functions */ - for (i = 0, j = sizeof(func_table) / sizeof(func_table[0]); i < j; i++) { - if (! add_ext_func(ext_id, & func_table[i], "")) { - warning(ext_id, "filefuncs: could not add %s\n", - func_table[i].name); - errors++; - } - } - - return (errors == 0); -} +dl_load_func(api, ext_id, func_table, filefuncs, "") diff --git a/test/Makefile.in b/test/Makefile.in index d6ffc309..0fabf7b4 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -84,9 +84,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \ $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \ |