diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-12-14 20:54:58 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-12-14 20:54:58 -0500 |
commit | 99c220c921ef24bfea7a1fe425753caf20db7c30 (patch) | |
tree | b60f73e455cd0c7b681fc8ea8b5d7e421b64cc88 | |
parent | a7478f42519382507939db409563753b76cfe140 (diff) | |
download | egawk-99c220c921ef24bfea7a1fe425753caf20db7c30.tar.gz egawk-99c220c921ef24bfea7a1fe425753caf20db7c30.tar.bz2 egawk-99c220c921ef24bfea7a1fe425753caf20db7c30.zip |
Remove the errno extension, since it is now part of gawkextlib.
-rw-r--r-- | extension/ChangeLog | 8 | ||||
-rw-r--r-- | extension/Makefile.am | 6 | ||||
-rw-r--r-- | extension/Makefile.in | 45 | ||||
-rw-r--r-- | extension/errlist.h | 455 | ||||
-rw-r--r-- | extension/errno.c | 143 |
5 files changed, 23 insertions, 634 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog index 1561adfb..053ba50b 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,11 @@ +2014-12-14 Andrew J. Schorr <aschorr@telemetry-investments.com> + + Remove the errno extension, since it is now part of gawkextlib. + * errno.c, errlist.h: Deleted. + * Makefile.am (pkgextension_LTLIBRARIES): Remove errno.la. + (errno_la_SOURCES, errno_la_LDFLAGS, errno_la_LIBADD): Remove. + (EXTRA_DIST): Remove errlist.h. + 2014-11-23 Arnold D. Robbins <arnold@skeeve.com> * inplace.c (do_inplace_begin): Jump through hoops to silence diff --git a/extension/Makefile.am b/extension/Makefile.am index 32603734..5c0df894 100644 --- a/extension/Makefile.am +++ b/extension/Makefile.am @@ -35,7 +35,6 @@ RM = rm -f # Note: rwarray does not currently compile. pkgextension_LTLIBRARIES = \ - errno.la \ filefuncs.la \ fnmatch.la \ fork.la \ @@ -54,10 +53,6 @@ MY_MODULE_FLAGS = -module -avoid-version -no-undefined # on Cygwin, gettext requires that we link with -lintl MY_LIBS = $(LTLIBINTL) -errno_la_SOURCES = errno.c -errno_la_LDFLAGS = $(MY_MODULE_FLAGS) -errno_la_LIBADD = $(MY_LIBS) - filefuncs_la_SOURCES = filefuncs.c stack.h stack.c gawkfts.h \ gawkfts.c gawkdirfd.h filefuncs_la_LDFLAGS = $(MY_MODULE_FLAGS) @@ -128,7 +123,6 @@ uninstall-recursive: uninstall-so EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ - errlist.h \ fts.3 \ README.fts \ siglist.h diff --git a/extension/Makefile.in b/extension/Makefile.in index 5feca509..015bc118 100644 --- a/extension/Makefile.in +++ b/extension/Makefile.in @@ -167,19 +167,13 @@ am__installdirs = "$(DESTDIR)$(pkgextensiondir)" \ LTLIBRARIES = $(pkgextension_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -errno_la_DEPENDENCIES = $(am__DEPENDENCIES_2) -am_errno_la_OBJECTS = errno.lo -errno_la_OBJECTS = $(am_errno_la_OBJECTS) +filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_filefuncs_la_OBJECTS = filefuncs.lo stack.lo gawkfts.lo +filefuncs_la_OBJECTS = $(am_filefuncs_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -errno_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(errno_la_LDFLAGS) $(LDFLAGS) -o $@ -filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2) -am_filefuncs_la_OBJECTS = filefuncs.lo stack.lo gawkfts.lo -filefuncs_la_OBJECTS = $(am_filefuncs_la_OBJECTS) filefuncs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(filefuncs_la_LDFLAGS) $(LDFLAGS) -o $@ @@ -289,18 +283,18 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(errno_la_SOURCES) $(filefuncs_la_SOURCES) \ - $(fnmatch_la_SOURCES) $(fork_la_SOURCES) $(inplace_la_SOURCES) \ - $(ordchr_la_SOURCES) $(readdir_la_SOURCES) \ - $(readfile_la_SOURCES) $(revoutput_la_SOURCES) \ - $(revtwoway_la_SOURCES) $(rwarray_la_SOURCES) \ - $(select_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) -DIST_SOURCES = $(errno_la_SOURCES) $(filefuncs_la_SOURCES) \ - $(fnmatch_la_SOURCES) $(fork_la_SOURCES) $(inplace_la_SOURCES) \ - $(ordchr_la_SOURCES) $(readdir_la_SOURCES) \ - $(readfile_la_SOURCES) $(revoutput_la_SOURCES) \ - $(revtwoway_la_SOURCES) $(rwarray_la_SOURCES) \ - $(select_la_SOURCES) $(testext_la_SOURCES) $(time_la_SOURCES) +SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ + $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ + $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ + $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ + $(rwarray_la_SOURCES) $(select_la_SOURCES) \ + $(testext_la_SOURCES) $(time_la_SOURCES) +DIST_SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \ + $(fork_la_SOURCES) $(inplace_la_SOURCES) $(ordchr_la_SOURCES) \ + $(readdir_la_SOURCES) $(readfile_la_SOURCES) \ + $(revoutput_la_SOURCES) $(revtwoway_la_SOURCES) \ + $(rwarray_la_SOURCES) $(select_la_SOURCES) \ + $(testext_la_SOURCES) $(time_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -532,7 +526,6 @@ RM = rm -f # Note: rwarray does not currently compile. pkgextension_LTLIBRARIES = \ - errno.la \ filefuncs.la \ fnmatch.la \ fork.la \ @@ -550,9 +543,6 @@ pkgextension_LTLIBRARIES = \ MY_MODULE_FLAGS = -module -avoid-version -no-undefined # on Cygwin, gettext requires that we link with -lintl MY_LIBS = $(LTLIBINTL) -errno_la_SOURCES = errno.c -errno_la_LDFLAGS = $(MY_MODULE_FLAGS) -errno_la_LIBADD = $(MY_LIBS) filefuncs_la_SOURCES = filefuncs.c stack.h stack.c gawkfts.h \ gawkfts.c gawkdirfd.h @@ -597,7 +587,6 @@ testext_la_LIBADD = $(MY_LIBS) EXTRA_DIST = build-aux/config.rpath \ ChangeLog \ ChangeLog.0 \ - errlist.h \ fts.3 \ README.fts \ siglist.h @@ -700,9 +689,6 @@ clean-pkgextensionLTLIBRARIES: rm -f $${locs}; \ } -errno.la: $(errno_la_OBJECTS) $(errno_la_DEPENDENCIES) $(EXTRA_errno_la_DEPENDENCIES) - $(AM_V_CCLD)$(errno_la_LINK) -rpath $(pkgextensiondir) $(errno_la_OBJECTS) $(errno_la_LIBADD) $(LIBS) - filefuncs.la: $(filefuncs_la_OBJECTS) $(filefuncs_la_DEPENDENCIES) $(EXTRA_filefuncs_la_DEPENDENCIES) $(AM_V_CCLD)$(filefuncs_la_LINK) -rpath $(pkgextensiondir) $(filefuncs_la_OBJECTS) $(filefuncs_la_LIBADD) $(LIBS) @@ -748,7 +734,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errno.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filefuncs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork.Plo@am__quote@ diff --git a/extension/errlist.h b/extension/errlist.h deleted file mode 100644 index caa6d63b..00000000 --- a/extension/errlist.h +++ /dev/null @@ -1,455 +0,0 @@ -/* - * errlist.h - List of errno values. - */ - -/* - * Copyright (C) 2013 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifdef E2BIG -init_errno (E2BIG, "E2BIG") -#endif -#ifdef EACCES -init_errno (EACCES, "EACCES") -#endif -#ifdef EADDRINUSE -init_errno (EADDRINUSE, "EADDRINUSE") -#endif -#ifdef EADDRNOTAVAIL -init_errno (EADDRNOTAVAIL, "EADDRNOTAVAIL") -#endif -#ifdef EADV -init_errno (EADV, "EADV") -#endif -#ifdef EAFNOSUPPORT -init_errno (EAFNOSUPPORT, "EAFNOSUPPORT") -#endif -#ifdef EAGAIN -init_errno (EAGAIN, "EAGAIN") -#endif -#ifdef EALREADY -init_errno (EALREADY, "EALREADY") -#endif -#ifdef EAUTH -init_errno (EAUTH, "EAUTH") -#endif -#ifdef EBADE -init_errno (EBADE, "EBADE") -#endif -#ifdef EBADF -init_errno (EBADF, "EBADF") -#endif -#ifdef EBADFD -init_errno (EBADFD, "EBADFD") -#endif -#ifdef EBADMSG -init_errno (EBADMSG, "EBADMSG") -#endif -#ifdef EBADR -init_errno (EBADR, "EBADR") -#endif -#ifdef EBADRPC -init_errno (EBADRPC, "EBADRPC") -#endif -#ifdef EBADRQC -init_errno (EBADRQC, "EBADRQC") -#endif -#ifdef EBADSLT -init_errno (EBADSLT, "EBADSLT") -#endif -#ifdef EBFONT -init_errno (EBFONT, "EBFONT") -#endif -#ifdef EBUSY -init_errno (EBUSY, "EBUSY") -#endif -#ifdef ECANCELED -init_errno (ECANCELED, "ECANCELED") -#endif -#ifdef ECHILD -init_errno (ECHILD, "ECHILD") -#endif -#ifdef ECHRNG -init_errno (ECHRNG, "ECHRNG") -#endif -#ifdef ECOMM -init_errno (ECOMM, "ECOMM") -#endif -#ifdef ECONNABORTED -init_errno (ECONNABORTED, "ECONNABORTED") -#endif -#ifdef ECONNREFUSED -init_errno (ECONNREFUSED, "ECONNREFUSED") -#endif -#ifdef ECONNRESET -init_errno (ECONNRESET, "ECONNRESET") -#endif -#ifdef EDEADLK -init_errno (EDEADLK, "EDEADLK") -#endif -#ifdef EDEADLOCK -#if !defined(EDEADLK) || (EDEADLK != EDEADLOCK) -init_errno (EDEADLOCK, "EDEADLOCK") -#endif -#endif -#ifdef EDESTADDRREQ -init_errno (EDESTADDRREQ, "EDESTADDRREQ") -#endif -#ifdef EDOM -init_errno (EDOM, "EDOM") -#endif -#ifdef EDOTDOT -init_errno (EDOTDOT, "EDOTDOT") -#endif -#ifdef EDQUOT -init_errno (EDQUOT, "EDQUOT") -#endif -#ifdef EEXIST -init_errno (EEXIST, "EEXIST") -#endif -#ifdef EFAULT -init_errno (EFAULT, "EFAULT") -#endif -#ifdef EFBIG -init_errno (EFBIG, "EFBIG") -#endif -#ifdef EFTYPE -init_errno (EFTYPE, "EFTYPE") -#endif -#ifdef EHOSTDOWN -init_errno (EHOSTDOWN, "EHOSTDOWN") -#endif -#ifdef EHOSTUNREACH -init_errno (EHOSTUNREACH, "EHOSTUNREACH") -#endif -#ifdef EIDRM -init_errno (EIDRM, "EIDRM") -#endif -#ifdef EILSEQ -init_errno (EILSEQ, "EILSEQ") -#endif -#ifdef EINPROGRESS -init_errno (EINPROGRESS, "EINPROGRESS") -#endif -#ifdef EINTR -init_errno (EINTR, "EINTR") -#endif -#ifdef EINVAL -init_errno (EINVAL, "EINVAL") -#endif -#ifdef EIO -init_errno (EIO, "EIO") -#endif -#ifdef EISCONN -init_errno (EISCONN, "EISCONN") -#endif -#ifdef EISDIR -init_errno (EISDIR, "EISDIR") -#endif -#ifdef EISNAM -init_errno (EISNAM, "EISNAM") -#endif -#ifdef EKEYEXPIRED -init_errno (EKEYEXPIRED, "EKEYEXPIRED") -#endif -#ifdef EKEYREJECTED -init_errno (EKEYREJECTED, "EKEYREJECTED") -#endif -#ifdef EKEYREVOKED -init_errno (EKEYREVOKED, "EKEYREVOKED") -#endif -#ifdef EL2HLT -init_errno (EL2HLT, "EL2HLT") -#endif -#ifdef EL2NSYNC -init_errno (EL2NSYNC, "EL2NSYNC") -#endif -#ifdef EL3HLT -init_errno (EL3HLT, "EL3HLT") -#endif -#ifdef EL3RST -init_errno (EL3RST, "EL3RST") -#endif -#ifdef ELAST -init_errno (ELAST, "ELAST") -#endif -#ifdef ELIBACC -init_errno (ELIBACC, "ELIBACC") -#endif -#ifdef ELIBBAD -init_errno (ELIBBAD, "ELIBBAD") -#endif -#ifdef ELIBEXEC -init_errno (ELIBEXEC, "ELIBEXEC") -#endif -#ifdef ELIBMAX -init_errno (ELIBMAX, "ELIBMAX") -#endif -#ifdef ELIBSCN -init_errno (ELIBSCN, "ELIBSCN") -#endif -#ifdef ELNRNG -init_errno (ELNRNG, "ELNRNG") -#endif -#ifdef ELOOP -init_errno (ELOOP, "ELOOP") -#endif -#ifdef EMEDIUMTYPE -init_errno (EMEDIUMTYPE, "EMEDIUMTYPE") -#endif -#ifdef EMFILE -init_errno (EMFILE, "EMFILE") -#endif -#ifdef EMLINK -init_errno (EMLINK, "EMLINK") -#endif -#ifdef EMSGSIZE -init_errno (EMSGSIZE, "EMSGSIZE") -#endif -#ifdef EMULTIHOP -init_errno (EMULTIHOP, "EMULTIHOP") -#endif -#ifdef ENAMETOOLONG -init_errno (ENAMETOOLONG, "ENAMETOOLONG") -#endif -#ifdef ENAVAIL -init_errno (ENAVAIL, "ENAVAIL") -#endif -#ifdef ENEEDAUTH -init_errno (ENEEDAUTH, "ENEEDAUTH") -#endif -#ifdef ENETDOWN -init_errno (ENETDOWN, "ENETDOWN") -#endif -#ifdef ENETRESET -init_errno (ENETRESET, "ENETRESET") -#endif -#ifdef ENETUNREACH -init_errno (ENETUNREACH, "ENETUNREACH") -#endif -#ifdef ENFILE -init_errno (ENFILE, "ENFILE") -#endif -#ifdef ENOANO -init_errno (ENOANO, "ENOANO") -#endif -#ifdef ENOBUFS -init_errno (ENOBUFS, "ENOBUFS") -#endif -#ifdef ENOCSI -init_errno (ENOCSI, "ENOCSI") -#endif -#ifdef ENODATA -init_errno (ENODATA, "ENODATA") -#endif -#ifdef ENODEV -init_errno (ENODEV, "ENODEV") -#endif -#ifdef ENOENT -init_errno (ENOENT, "ENOENT") -#endif -#ifdef ENOEXEC -init_errno (ENOEXEC, "ENOEXEC") -#endif -#ifdef ENOKEY -init_errno (ENOKEY, "ENOKEY") -#endif -#ifdef ENOLCK -init_errno (ENOLCK, "ENOLCK") -#endif -#ifdef ENOLINK -init_errno (ENOLINK, "ENOLINK") -#endif -#ifdef ENOMEDIUM -init_errno (ENOMEDIUM, "ENOMEDIUM") -#endif -#ifdef ENOMEM -init_errno (ENOMEM, "ENOMEM") -#endif -#ifdef ENOMSG -init_errno (ENOMSG, "ENOMSG") -#endif -#ifdef ENONET -init_errno (ENONET, "ENONET") -#endif -#ifdef ENOPKG -init_errno (ENOPKG, "ENOPKG") -#endif -#ifdef ENOPROTOOPT -init_errno (ENOPROTOOPT, "ENOPROTOOPT") -#endif -#ifdef ENOSPC -init_errno (ENOSPC, "ENOSPC") -#endif -#ifdef ENOSR -init_errno (ENOSR, "ENOSR") -#endif -#ifdef ENOSTR -init_errno (ENOSTR, "ENOSTR") -#endif -#ifdef ENOSYS -init_errno (ENOSYS, "ENOSYS") -#endif -#ifdef ENOTBLK -init_errno (ENOTBLK, "ENOTBLK") -#endif -#ifdef ENOTCONN -init_errno (ENOTCONN, "ENOTCONN") -#endif -#ifdef ENOTDIR -init_errno (ENOTDIR, "ENOTDIR") -#endif -#ifdef ENOTEMPTY -init_errno (ENOTEMPTY, "ENOTEMPTY") -#endif -#ifdef ENOTNAM -init_errno (ENOTNAM, "ENOTNAM") -#endif -#ifdef ENOTRECOVERABLE -init_errno (ENOTRECOVERABLE, "ENOTRECOVERABLE") -#endif -#ifdef ENOTSOCK -init_errno (ENOTSOCK, "ENOTSOCK") -#endif -#ifdef ENOTTY -init_errno (ENOTTY, "ENOTTY") -#endif -#ifdef ENOTUNIQ -init_errno (ENOTUNIQ, "ENOTUNIQ") -#endif -#ifdef ENXIO -init_errno (ENXIO, "ENXIO") -#endif -#ifdef EOPNOTSUPP -init_errno (EOPNOTSUPP, "EOPNOTSUPP") -#endif -#ifdef EOVERFLOW -init_errno (EOVERFLOW, "EOVERFLOW") -#endif -#ifdef EOWNERDEAD -init_errno (EOWNERDEAD, "EOWNERDEAD") -#endif -#ifdef EPERM -init_errno (EPERM, "EPERM") -#endif -#ifdef EPFNOSUPPORT -init_errno (EPFNOSUPPORT, "EPFNOSUPPORT") -#endif -#ifdef EPIPE -init_errno (EPIPE, "EPIPE") -#endif -#ifdef EPROCLIM -init_errno (EPROCLIM, "EPROCLIM") -#endif -#ifdef EPROCUNAVAIL -init_errno (EPROCUNAVAIL, "EPROCUNAVAIL") -#endif -#ifdef EPROGMISMATCH -init_errno (EPROGMISMATCH, "EPROGMISMATCH") -#endif -#ifdef EPROGUNAVAIL -init_errno (EPROGUNAVAIL, "EPROGUNAVAIL") -#endif -#ifdef EPROTO -init_errno (EPROTO, "EPROTO") -#endif -#ifdef EPROTONOSUPPORT -init_errno (EPROTONOSUPPORT, "EPROTONOSUPPORT") -#endif -#ifdef EPROTOTYPE -init_errno (EPROTOTYPE, "EPROTOTYPE") -#endif -#ifdef ERANGE -init_errno (ERANGE, "ERANGE") -#endif -#ifdef EREMCHG -init_errno (EREMCHG, "EREMCHG") -#endif -#ifdef EREMOTE -init_errno (EREMOTE, "EREMOTE") -#endif -#ifdef EREMOTEIO -init_errno (EREMOTEIO, "EREMOTEIO") -#endif -#ifdef ERESTART -init_errno (ERESTART, "ERESTART") -#endif -#ifdef ERFKILL -init_errno (ERFKILL, "ERFKILL") -#endif -#ifdef EROFS -init_errno (EROFS, "EROFS") -#endif -#ifdef ERPCMISMATCH -init_errno (ERPCMISMATCH, "ERPCMISMATCH") -#endif -#ifdef ESHUTDOWN -init_errno (ESHUTDOWN, "ESHUTDOWN") -#endif -#ifdef ESOCKTNOSUPPORT -init_errno (ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT") -#endif -#ifdef ESPIPE -init_errno (ESPIPE, "ESPIPE") -#endif -#ifdef ESRCH -init_errno (ESRCH, "ESRCH") -#endif -#ifdef ESRMNT -init_errno (ESRMNT, "ESRMNT") -#endif -#ifdef ESTALE -init_errno (ESTALE, "ESTALE") -#endif -#ifdef ESTRPIPE -init_errno (ESTRPIPE, "ESTRPIPE") -#endif -#ifdef ETIME -init_errno (ETIME, "ETIME") -#endif -#ifdef ETIMEDOUT -init_errno (ETIMEDOUT, "ETIMEDOUT") -#endif -#ifdef ETOOMANYREFS -init_errno (ETOOMANYREFS, "ETOOMANYREFS") -#endif -#ifdef ETXTBSY -init_errno (ETXTBSY, "ETXTBSY") -#endif -#ifdef EUCLEAN -init_errno (EUCLEAN, "EUCLEAN") -#endif -#ifdef EUNATCH -init_errno (EUNATCH, "EUNATCH") -#endif -#ifdef EUSERS -init_errno (EUSERS, "EUSERS") -#endif -#ifdef EWOULDBLOCK -#if !defined(EAGAIN) || (EWOULDBLOCK != EAGAIN) -init_errno (EWOULDBLOCK, "EWOULDBLOCK") -#endif -#endif -#ifdef EXDEV -init_errno (EXDEV, "EXDEV") -#endif -#ifdef EXFULL -init_errno (EXFULL, "EXFULL") -#endif diff --git a/extension/errno.c b/extension/errno.c deleted file mode 100644 index 5dc15d79..00000000 --- a/extension/errno.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * errno.c - Builtin functions to map errno values. - */ - -/* - * Copyright (C) 2013 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <assert.h> -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include <sys/types.h> -#include <sys/stat.h> - -#include "gawkapi.h" - -#include "gettext.h" -#define _(msgid) gettext(msgid) -#define N_(msgid) msgid - -static const gawk_api_t *api; /* for convenience macros to work */ -static awk_ext_id_t *ext_id; -static const char *ext_version = "errno extension: version 1.0"; -static awk_bool_t (*init_func)(void) = NULL; - -int plugin_is_GPL_compatible; - -static const char *const errno2name[] = { -#define init_errno(A, B) [A] = B, -#include "errlist.h" -#undef init_errno -}; -#define NUMERR sizeof(errno2name)/sizeof(errno2name[0]) - -/* do_strerror --- call strerror */ - -static awk_value_t * -do_strerror(int nargs, awk_value_t *result) -{ - awk_value_t errnum; - - if (do_lint && nargs > 1) - lintwarn(ext_id, _("strerror: called with too many arguments")); - - if (get_argument(0, AWK_NUMBER, & errnum)) { - const char *str = gettext(strerror(errnum.num_value)); - return make_const_string(str, strlen(str), result); - } - if (do_lint) { - if (nargs == 0) - lintwarn(ext_id, _("strerror: called with no arguments")); - else - lintwarn(ext_id, _("strerror: called with inappropriate argument(s)")); - } - return make_null_string(result); -} - -/* do_errno2name --- convert an integer errno value to it's symbolic name */ - -static awk_value_t * -do_errno2name(int nargs, awk_value_t *result) -{ - awk_value_t errnum; - - if (do_lint && nargs > 1) - lintwarn(ext_id, _("errno2name: called with too many arguments")); - - if (get_argument(0, AWK_NUMBER, & errnum)) { - int i = errnum.num_value; - - if ((i == errnum.num_value) && (i >= 0) && ((size_t)i < NUMERR) && errno2name[i]) - return make_const_string(errno2name[i], strlen(errno2name[i]), result); - warning(ext_id, _("errno2name: called with invalid argument")); - } else if (do_lint) { - if (nargs == 0) - lintwarn(ext_id, _("errno2name: called with no arguments")); - else - lintwarn(ext_id, _("errno2name: called with inappropriate argument(s)")); - } - return make_null_string(result); -} - -/* do_name2errno --- convert a symbolic errno name to an integer */ - -static awk_value_t * -do_name2errno(int nargs, awk_value_t *result) -{ - awk_value_t err; - - if (do_lint && nargs > 1) - lintwarn(ext_id, _("name2errno: called with too many arguments")); - - if (get_argument(0, AWK_STRING, & err)) { - size_t i; - - for (i = 0; i < NUMERR; i++) { - if (errno2name[i] && ! strcasecmp(err.str_value.str, errno2name[i])) - return make_number(i, result); - } - warning(ext_id, _("name2errno: called with invalid argument")); - } else if (do_lint) { - if (nargs == 0) - lintwarn(ext_id, _("name2errno: called with no arguments")); - else - lintwarn(ext_id, _("name2errno: called with inappropriate argument(s)")); - } - return make_number(-1, result); -} - -static awk_ext_func_t func_table[] = { - { "strerror", do_strerror, 1 }, - { "errno2name", do_errno2name, 1 }, - { "name2errno", do_name2errno, 1 }, -}; - -/* define the dl_load function using the boilerplate macro */ - -dl_load_func(func_table, errno, "") |