summaryrefslogtreecommitdiffstats
path: root/libidu
diff options
context:
space:
mode:
Diffstat (limited to 'libidu')
-rw-r--r--libidu/Makefile.am29
-rw-r--r--libidu/Makefile.in641
-rw-r--r--libidu/dynvec.c11
-rw-r--r--libidu/dynvec.h8
-rw-r--r--libidu/fnprint.c21
-rw-r--r--libidu/hash.c14
-rw-r--r--libidu/hash.h42
-rw-r--r--libidu/idfile.c18
-rw-r--r--libidu/idfile.h100
-rw-r--r--libidu/idread.c16
-rw-r--r--libidu/iduglobal.h71
-rw-r--r--libidu/idwrite.c9
-rw-r--r--libidu/scanners.c67
-rw-r--r--libidu/scanners.h20
-rw-r--r--libidu/walker.c136
-rw-r--r--libidu/xnls.h10
16 files changed, 689 insertions, 524 deletions
diff --git a/libidu/Makefile.am b/libidu/Makefile.am
index 1fc6202..ac18713 100644
--- a/libidu/Makefile.am
+++ b/libidu/Makefile.am
@@ -1,20 +1,25 @@
## Process this file with automake to create Makefile.in
-AUTOMAKE_OPTIONS = ../src/ansi2knr
-
noinst_LIBRARIES = libidu.a
-libidu_a_SOURCES = dynvec.c hash.c idfile.c idread.c idwrite.c fnprint.c \
- scanners.c walker.c
+libidu_a_SOURCES = dynvec.c dynvec.h \
+ hash.c hash.h \
+ idfile.c idfile.h \
+ idread.c \
+ idwrite.c \
+ fnprint.c \
+ scanners.c scanners.h \
+ walker.c \
+ tokflags.h \
+ iduglobal.h \
+ xnls.h
+
+AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/intl \
+ -DDATADIR=\"$(datadir)\" \
+ -DLOCALEDIR=\"$(datadir)/locale\" \
+ -DLANGUAGE_MAP_FILE=\"$(datadir)/id-lang.map\"
-idudir = $(prefix)/share
+idudir = $(datadir)
idu_DATA = id-lang.map
EXTRA_DIST = $(idu_DATA)
-noinst_HEADERS = dynvec.h hash.h idfile.h scanners.h tokflags.h xnls.h
-
-INCLUDES = -I. -I$(srcdir) \
- -I../lib -I$(top_srcdir)/lib \
- -I../intl -I$(top_srcdir)/intl \
- -I.. -I$(top_srcdir)
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
diff --git a/libidu/Makefile.in b/libidu/Makefile.in
index 801f80c..335e7bc 100644
--- a/libidu/Makefile.in
+++ b/libidu/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated by automake 1.9.4 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,390 +12,499 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-SHELL = @SHELL@
+@SET_MAKE@
+
+
+SOURCES = $(libidu_a_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_FLAG =
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-
-@SET_MAKE@
-AMDEP = @AMDEP@
+build_triplet = @build@
+host_triplet = @host@
+subdir = libidu
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/alloca.m4 \
+ $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/closeout.m4 \
+ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/d-ino.m4 \
+ $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exclude.m4 \
+ $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \
+ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
+ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/glibc2.m4 $(top_srcdir)/m4/glibc21.m4 \
+ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/intdiv0.m4 $(top_srcdir)/m4/intmax.m4 \
+ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lcmessage.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longdouble.m4 \
+ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \
+ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcpy.m4 \
+ $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memset.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/obstack.m4 \
+ $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/pathmax.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quotearg.m4 \
+ $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/restrict.m4 \
+ $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \
+ $(top_srcdir)/m4/stat-macros.m4 $(top_srcdir)/m4/stdbool.m4 \
+ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \
+ $(top_srcdir)/m4/strcspn.m4 $(top_srcdir)/m4/strdup.m4 \
+ $(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strsep.m4 \
+ $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \
+ $(top_srcdir)/m4/xgetcwd.m4 $(top_srcdir)/m4/xsize.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libidu_a_AR = $(AR) $(ARFLAGS)
+libidu_a_LIBADD =
+am_libidu_a_OBJECTS = dynvec.$(OBJEXT) hash.$(OBJEXT) idfile.$(OBJEXT) \
+ idread.$(OBJEXT) idwrite.$(OBJEXT) fnprint.$(OBJEXT) \
+ scanners.$(OBJEXT) walker.$(OBJEXT)
+libidu_a_OBJECTS = $(am_libidu_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libidu_a_SOURCES)
+DIST_SOURCES = $(libidu_a_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(idudir)"
+iduDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(idu_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
-CATALOGS = @CATALOGS@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EMACS = @EMACS@
+EMACSLOADPATH = @EMACSLOADPATH@
+EXEEXT = @EXEEXT@
+FNMATCH_H = @FNMATCH_H@
GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
+GETOPT_H = @GETOPT_H@
+GLIBC2 = @GLIBC2@
+GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+HAVE_ASPRINTF = @HAVE_ASPRINTF@
+HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
+HAVE_SNPRINTF = @HAVE_SNPRINTF@
+HAVE_WPRINTF = @HAVE_WPRINTF@
+HAVE__BOOL = @HAVE__BOOL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
+INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
-LANGUAGE_MAP_FILE = @LANGUAGE_MAP_FILE@
+INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
-POFILES = @POFILES@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
-README_ALPHA = @README_ALPHA@
-U = @U@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STDBOOL_H = @STDBOOL_H@
+STRIP = @STRIP@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
install_sh = @install_sh@
-l = @l@
+libdir = @libdir@
+libexecdir = @libexecdir@
lispdir = @lispdir@
-
-
-AUTOMAKE_OPTIONS = ../src/ansi2knr
-
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
noinst_LIBRARIES = libidu.a
-
-libidu_a_SOURCES = dynvec.c hash.c idfile.c idread.c idwrite.c fnprint.c \
- scanners.c walker.c
-
-
-idudir = $(prefix)/share
+libidu_a_SOURCES = dynvec.c dynvec.h \
+ hash.c hash.h \
+ idfile.c idfile.h \
+ idread.c \
+ idwrite.c \
+ fnprint.c \
+ scanners.c scanners.h \
+ walker.c \
+ tokflags.h \
+ iduglobal.h \
+ xnls.h
+
+AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/intl \
+ -DDATADIR=\"$(datadir)\" \
+ -DLOCALEDIR=\"$(datadir)/locale\" \
+ -DLANGUAGE_MAP_FILE=\"$(datadir)/id-lang.map\"
+
+idudir = $(datadir)
idu_DATA = id-lang.map
EXTRA_DIST = $(idu_DATA)
+all: all-am
-noinst_HEADERS = dynvec.h hash.h idfile.h scanners.h tokflags.h xnls.h
-
-INCLUDES = -I. -I$(srcdir) \
- -I../lib -I$(top_srcdir)/lib \
- -I../intl -I$(top_srcdir)/intl \
- -I.. -I$(top_srcdir)
-
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
-subdir = libidu
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-
-CPPFLAGS = @CPPFLAGS@
-LIBS = @LIBS@
-ANSI2KNR = ../src/ansi2knr
-libidu_a_AR = $(AR) cru
-libidu_a_LIBADD =
-am_libidu_a_OBJECTS = dynvec$U.o hash$U.o idfile$U.o idread$U.o \
-idwrite$U.o fnprint$U.o scanners$U.o walker$U.o
-libidu_a_OBJECTS = $(am_libidu_a_OBJECTS)
-AR = ar
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(libidu_a_SOURCES)
-DATA = $(idu_DATA)
-
-HEADERS = $(noinst_HEADERS)
-
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = @AMDEP@ $(DEPDIR)/dynvec$U.Po $(DEPDIR)/fnprint$U.Po \
-$(DEPDIR)/hash$U.Po $(DEPDIR)/idfile$U.Po $(DEPDIR)/idread$U.Po \
-$(DEPDIR)/idwrite$U.Po $(DEPDIR)/scanners$U.Po $(DEPDIR)/walker$U.Po
-DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-GZIP_ENV = --best
-SOURCES = $(libidu_a_SOURCES)
-OBJECTS = $(am_libidu_a_OBJECTS)
-
-all: all-redirect
.SUFFIXES:
-.SUFFIXES: .c .o
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnits libidu/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-noinstLIBRARIES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libidu/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu libidu/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-
-distclean-noinstLIBRARIES:
-
-maintainer-clean-noinstLIBRARIES:
+libidu.a: $(libidu_a_OBJECTS) $(libidu_a_DEPENDENCIES)
+ -rm -f libidu.a
+ $(libidu_a_AR) libidu.a $(libidu_a_OBJECTS) $(libidu_a_LIBADD)
+ $(RANLIB) libidu.a
mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
+ -rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
-maintainer-clean-compile:
-../src/ansi2knr: ../src/ansi2knr.o
- cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr
-
-../src/ansi2knr.o:
- cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.o
-
-
-mostlyclean-kr:
- -rm -f *_.c
-
-clean-kr:
-
-distclean-kr:
-
-maintainer-clean-kr:
-
-libidu.a: $(libidu_a_OBJECTS) $(libidu_a_DEPENDENCIES)
- -rm -f libidu.a
- $(libidu_a_AR) libidu.a $(libidu_a_OBJECTS) $(libidu_a_LIBADD)
- $(RANLIB) libidu.a
-dynvec_.c: dynvec.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dynvec.c; then echo $(srcdir)/dynvec.c; else echo dynvec.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dynvec_.c
-fnprint_.c: fnprint.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnprint.c; then echo $(srcdir)/fnprint.c; else echo fnprint.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnprint_.c
-hash_.c: hash.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hash_.c
-idfile_.c: idfile.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/idfile.c; then echo $(srcdir)/idfile.c; else echo idfile.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > idfile_.c
-idread_.c: idread.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/idread.c; then echo $(srcdir)/idread.c; else echo idread.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > idread_.c
-idwrite_.c: idwrite.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/idwrite.c; then echo $(srcdir)/idwrite.c; else echo idwrite.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > idwrite_.c
-scanners_.c: scanners.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/scanners.c; then echo $(srcdir)/scanners.c; else echo scanners.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > scanners_.c
-walker_.c: walker.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/walker.c; then echo $(srcdir)/walker.c; else echo walker.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > walker_.c
-dynvec_.o fnprint_.o hash_.o idfile_.o idread_.o idwrite_.o scanners_.o \
-walker_.o : $(ANSI2KNR)
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynvec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnprint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idfile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idread.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idwrite.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanners.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/walker.Po@am__quote@
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+uninstall-info-am:
install-iduDATA: $(idu_DATA)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(idudir)
+ test -z "$(idudir)" || $(mkdir_p) "$(DESTDIR)$(idudir)"
@list='$(idu_DATA)'; for p in $$list; do \
- if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(idudir)/$$f"; \
- $(INSTALL_DATA) $$d$$p $(DESTDIR)$(idudir)/$$f; \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(iduDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idudir)/$$f'"; \
+ $(iduDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idudir)/$$f"; \
done
uninstall-iduDATA:
@$(NORMAL_UNINSTALL)
@list='$(idu_DATA)'; for p in $$list; do \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " rm -f $(DESTDIR)$(idudir)/$$f"; \
- rm -f $(DESTDIR)$(idudir)/$$f; \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(idudir)/$$f'"; \
+ rm -f "$(DESTDIR)$(idudir)/$$f"; \
done
-tags: TAGS
-
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- mkid -fID $$unique $(LISP)
+ mkid -fID $$unique
+tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
-
-mostlyclean-tags:
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-@AMDEP@include $(DEPDIR)/dynvec$U.Po
-@AMDEP@include $(DEPDIR)/fnprint$U.Po
-@AMDEP@include $(DEPDIR)/hash$U.Po
-@AMDEP@include $(DEPDIR)/idfile$U.Po
-@AMDEP@include $(DEPDIR)/idread$U.Po
-@AMDEP@include $(DEPDIR)/idwrite$U.Po
-@AMDEP@include $(DEPDIR)/scanners$U.Po
-@AMDEP@include $(DEPDIR)/walker$U.Po
-
-mostlyclean-depend:
-
-clean-depend:
-
-distclean-depend:
- -rm -rf $(DEPDIR)
-
-maintainer-clean-depend:
-
-@AMDEP@CCDEPMODE = @CCDEPMODE@
-
-.c.o:
-@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
-
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir) \
- || exit 1; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am:
+all-am: Makefile $(LIBRARIES) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(idudir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
install-exec: install-exec-am
-
-install-data-am: install-iduDATA
install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-iduDATA
-uninstall: uninstall-am
-all-am: Makefile $(LIBRARIES) $(DATA) $(HEADERS)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(idudir)
-
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -rm -f Makefile.in
-mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-depend \
- mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-clean-am: clean-noinstLIBRARIES clean-compile clean-kr clean-tags \
- clean-depend clean-generic mostlyclean-am
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
-clean: clean-am
+dvi: dvi-am
-distclean-am: distclean-noinstLIBRARIES distclean-compile distclean-kr \
- distclean-tags distclean-depend distclean-generic \
- clean-am
+dvi-am:
-distclean: distclean-am
+html: html-am
-maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
- maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-depend \
- maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-am
+
+info-am:
+
+install-data-am: install-iduDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
-.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
-clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
-maintainer-clean-kr uninstall-iduDATA install-iduDATA tags \
-mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-mostlyclean-depend distclean-depend clean-depend \
-maintainer-clean-depend distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+uninstall-am: uninstall-iduDATA uninstall-info-am
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-noinstLIBRARIES ctags distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-iduDATA \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-iduDATA uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libidu/dynvec.c b/libidu/dynvec.c
index 29844b0..b098214 100644
--- a/libidu/dynvec.c
+++ b/libidu/dynvec.c
@@ -18,14 +18,15 @@
*/
#include <config.h>
+#include <stdlib.h>
#include "dynvec.h"
-#include "xmalloc.h"
+#include "xalloc.h"
struct dynvec *
make_dynvec (int n)
{
- struct dynvec *dv = MALLOC (struct dynvec, 1);
- dv->dv_vec = MALLOC (void *, n);
+ struct dynvec *dv = xmalloc (sizeof(struct dynvec) * 1);
+ dv->dv_vec = xmalloc (sizeof(void *) * n);
dv->dv_capacity = n;
dv->dv_fill = 0;
return dv;
@@ -44,7 +45,7 @@ dynvec_freeze (struct dynvec *dv)
if (dv->dv_fill == dv->dv_capacity)
return;
dv->dv_capacity = dv->dv_fill;
- dv->dv_vec = REALLOC (dv->dv_vec, void *, dv->dv_capacity);
+ dv->dv_vec = xrealloc (dv->dv_vec, sizeof(void *) * dv->dv_capacity);
}
void
@@ -53,7 +54,7 @@ dynvec_append (struct dynvec *dv, void *element)
if (dv->dv_fill == dv->dv_capacity)
{
dv->dv_capacity *= 2;
- dv->dv_vec = REALLOC (dv->dv_vec, void *, dv->dv_capacity);
+ dv->dv_vec = xrealloc (dv->dv_vec, sizeof(void *) * dv->dv_capacity);
}
dv->dv_vec[dv->dv_fill++] = element;
}
diff --git a/libidu/dynvec.h b/libidu/dynvec.h
index 55fc0c2..f688920 100644
--- a/libidu/dynvec.h
+++ b/libidu/dynvec.h
@@ -27,9 +27,9 @@ struct dynvec
int dv_fill;
};
-struct dynvec *make_dynvec __P((int n));
-void dynvec_free __P((struct dynvec *dv));
-void dynvec_freeze __P((struct dynvec *dv));
-void dynvec_append __P((struct dynvec *dv, void *element));
+struct dynvec *make_dynvec (int n);
+void dynvec_free (struct dynvec *dv);
+void dynvec_freeze (struct dynvec *dv);
+void dynvec_append (struct dynvec *dv, void *element);
#endif /* not _dynvec_h_ */
diff --git a/libidu/fnprint.c b/libidu/fnprint.c
index 7716f05..1ba0159 100644
--- a/libidu/fnprint.c
+++ b/libidu/fnprint.c
@@ -18,20 +18,21 @@
#include <config.h>
#include <stdio.h>
-#include "xstdlib.h"
-#include "xalloca.h"
-#include "xunistd.h"
+#include <stdlib.h>
+#include <alloca.h>
+#include <unistd.h>
+#include <string.h>
+#include "pathmax.h"
#include "idfile.h"
-#include "xstring.h"
#include "xnls.h"
-#include "pathmax.h"
#include "error.h"
+#include "iduglobal.h"
-char const *root_name __P((char const *path));
-char const *suff_name __P((char const *path));
-int common_prefix_suffix __P((struct file_link const *flink_1, struct file_link const *flink_2));
+char const *root_name (char const *path);
+char const *suff_name (char const *path);
+int common_prefix_suffix (struct file_link const *flink_1, struct file_link const *flink_2);
-extern void usage __P((void));
+extern void usage (void);
extern struct file_link *cw_dlink;
/* Return the file name with the suffix stripped off. */
@@ -80,7 +81,7 @@ print_filenames (struct file_link **flinkv, enum separator_style separator_style
struct file_link const *arg;
struct file_link const *dlink;
int brace_is_open = 0;
- char *file_name = ALLOCA (char, PATH_MAX);
+ char *file_name = alloca (sizeof(char) * PATH_MAX);
while (*flinkv)
{
diff --git a/libidu/hash.c b/libidu/hash.c
index 3c091d4..ce93fa7 100644
--- a/libidu/hash.c
+++ b/libidu/hash.c
@@ -19,14 +19,14 @@
#include <config.h>
#include <stdio.h>
-#include "xstdlib.h"
+#include <stdlib.h>
#include "hash.h"
#include "xnls.h"
-#include "xmalloc.h"
+#include "xalloc.h"
#include "error.h"
-static void hash_rehash __P((struct hash_table* ht));
-static unsigned long round_up_2 __P((unsigned long rough));
+static void hash_rehash (struct hash_table* ht);
+static unsigned long round_up_2 (unsigned long rough);
/* Implement double hashing with open addressing. The table size is
always a power of two. The secondary (`increment') hash function
@@ -46,7 +46,7 @@ hash_init (struct hash_table* ht, unsigned long size,
{
ht->ht_size = round_up_2 (size);
ht->ht_empty_slots = ht->ht_size;
- ht->ht_vec = (void**) CALLOC (struct token *, ht->ht_size);
+ ht->ht_vec = (void**) xcalloc (ht->ht_size, sizeof(struct token *));
if (ht->ht_vec == 0)
error (1, 0, _("can't allocate %ld bytes for hash table: memory exhausted"),
ht->ht_size * sizeof(struct token *));
@@ -244,7 +244,7 @@ hash_rehash (struct hash_table* ht)
ht->ht_capacity = ht->ht_size - (ht->ht_size >> 4);
}
ht->ht_rehashes++;
- ht->ht_vec = (void **) CALLOC (struct token *, ht->ht_size);
+ ht->ht_vec = (void **) xcalloc (ht->ht_size, sizeof(struct token *));
for (ovp = old_vec; ovp < &old_vec[old_ht_size]; ovp++)
{
@@ -281,7 +281,7 @@ hash_dump (struct hash_table *ht, void **vector_0, qsort_cmp_t compare)
void **end = &ht->ht_vec[ht->ht_size];
if (vector_0 == 0)
- vector_0 = MALLOC (void *, ht->ht_fill + 1);
+ vector_0 = xmalloc (sizeof (void *) * (ht->ht_fill + 1));
vector = vector_0;
for (slot = ht->ht_vec; slot < end; slot++)
diff --git a/libidu/hash.h b/libidu/hash.h
index bc252fe..d1070aa 100644
--- a/libidu/hash.h
+++ b/libidu/hash.h
@@ -21,9 +21,9 @@
#include <stdio.h>
-typedef unsigned long (*hash_func_t) __P((void const *key));
-typedef int (*hash_cmp_func_t) __P((void const *x, void const *y));
-typedef void (*hash_map_func_t) __P((void const *item));
+typedef unsigned long (*hash_func_t) (void const *key);
+typedef int (*hash_cmp_func_t) (void const *x, void const *y);
+typedef void (*hash_map_func_t) (void const *item);
struct hash_table
{
@@ -40,24 +40,24 @@ struct hash_table
hash_cmp_func_t ht_compare; /* comparison function */
};
-typedef int (*qsort_cmp_t) __P((void const *, void const *));
-
-void hash_init __P((struct hash_table *ht, unsigned long size,
- hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp));
-void hash_load __P((struct hash_table *ht, void *item_table,
- unsigned long cardinality, unsigned long size));
-void **hash_find_slot __P((struct hash_table *ht, void const *key));
-void *hash_find_item __P((struct hash_table *ht, void const *key));
-void *hash_insert __P((struct hash_table *ht, void *item));
-void *hash_insert_at __P((struct hash_table *ht, void *item, void const *slot));
-void *hash_delete __P((struct hash_table *ht, void const *item));
-void *hash_delete_at __P((struct hash_table *ht, void const *slot));
-void hash_delete_items __P((struct hash_table *ht));
-void hash_free_items __P((struct hash_table *ht));
-void hash_free __P((struct hash_table *ht, int free_items));
-void hash_map __P((struct hash_table *ht, hash_map_func_t map));
-void hash_print_stats __P((struct hash_table *ht, FILE *out_FILE));
-void **hash_dump __P((struct hash_table *ht, void **vector_0, qsort_cmp_t compare));
+typedef int (*qsort_cmp_t) (void const *, void const *);
+
+void hash_init (struct hash_table *ht, unsigned long size,
+ hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp);
+void hash_load (struct hash_table *ht, void *item_table,
+ unsigned long cardinality, unsigned long size);
+void **hash_find_slot (struct hash_table *ht, void const *key);
+void *hash_find_item (struct hash_table *ht, void const *key);
+void *hash_insert (struct hash_table *ht, void *item);
+void *hash_insert_at (struct hash_table *ht, void *item, void const *slot);
+void *hash_delete (struct hash_table *ht, void const *item);
+void *hash_delete_at (struct hash_table *ht, void const *slot);
+void hash_delete_items (struct hash_table *ht);
+void hash_free_items (struct hash_table *ht);
+void hash_free (struct hash_table *ht, int free_items);
+void hash_map (struct hash_table *ht, hash_map_func_t map);
+void hash_print_stats (struct hash_table *ht, FILE *out_FILE);
+void **hash_dump (struct hash_table *ht, void **vector_0, qsort_cmp_t compare);
extern void *hash_deleted_item;
#define HASH_VACANT(item) ((item) == 0 || (void *) (item) == hash_deleted_item)
diff --git a/libidu/idfile.c b/libidu/idfile.c
index cabc18d..04afb16 100644
--- a/libidu/idfile.c
+++ b/libidu/idfile.c
@@ -20,24 +20,16 @@
#include <config.h>
#include <stdio.h>
#include <errno.h>
-#include "xstdlib.h"
-#include "xstring.h"
-#include "xsysstat.h"
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
#include "xnls.h"
-#include "xobstack.h"
+#include "obstack.h"
#include "idfile.h"
#include "error.h"
-#ifndef HAVE_DECL_STRSEP
-"this configure-time declaration test was not run"
-#endif
-#if !HAVE_DECL_STRSEP
-char *strsep ();
-#endif
+int io_size (FILE *, void *, unsigned int size, int);
-int io_size __P((FILE *, void *, unsigned int size, int));
-
-
/****************************************************************************/
/* Discover the name of the ID file. If ARG is NULL, consult $IDPATH.
diff --git a/libidu/idfile.h b/libidu/idfile.h
index d69fda1..8e2bfce 100644
--- a/libidu/idfile.h
+++ b/libidu/idfile.h
@@ -25,8 +25,8 @@
# include <sys/types.h>
#endif
#include <stdio.h>
-#include "xstring.h"
-#include "xobstack.h"
+#include <string.h>
+#include "obstack.h"
#include "hash.h"
#include "dynvec.h"
#include "tokflags.h"
@@ -146,9 +146,9 @@ extern struct hash_table dev_ino_table;
/* token flags (struct token is defined in scanners.h) */
#define token_string(buf) (buf)
-extern unsigned int token_flags __P((char const *buf));
-extern unsigned short token_count __P((char const *buf));
-extern unsigned char const *token_hits_addr __P((char const *buf));
+extern unsigned int token_flags (char const *buf);
+extern unsigned short token_count (char const *buf);
+extern unsigned char const *token_hits_addr (char const *buf);
#define MAYBE_RETURN_PREFIX_MATCH(arg, str, val) do { \
char const *_s_ = (str); \
@@ -169,52 +169,52 @@ enum separator_style
#define DEFAULT_SEPARATOR_STYLE ss_braces
#endif
-typedef int (*io_func_t) __P((FILE *, void *, unsigned int, int));
-
-extern struct file_link **read_id_file __P((char const *id_file_name, struct idhead *idhp));
-extern struct file_link **maybe_read_id_file __P((char const *id_file_name, struct idhead *idhp));
-extern int read_idhead __P((struct idhead *idhp));
-extern int write_idhead __P((struct idhead *idhp));
-extern int sizeof_idhead __P((void));
-struct file_link *init_walker __P((struct idhead *idhp));
-extern void init_idh_obstacks __P((struct idhead *idhp));
-extern void init_idh_tables __P((struct idhead *idhp));
-
-extern int io_write __P((FILE *output_FILE, void *addr, unsigned int size, int io_type));
-extern int io_read __P((FILE *input_FILE, void *addr, unsigned int size, int io_type));
-extern int io_idhead __P((FILE *fp, io_func_t iof, struct idhead *idhp));
-
-extern struct file_link *get_current_dir_link __P((void));
-extern struct file_link **deserialize_file_links __P((struct idhead *idhp));
-extern void serialize_file_links __P((struct idhead *idhp));
-
-extern void mark_member_file_links __P((struct idhead *idhp));
-extern int member_file_qsort_compare __P((void const *x, void const *y));
-extern struct file_link *parse_file_name __P((char *file_name,
- struct file_link *relative_dir_link));
-extern void print_filenames __P((struct file_link **flinkv,
- enum separator_style separator_style));
-extern enum separator_style parse_separator_style __P((char const *arg));
-
-extern void walk_flink __P((struct file_link *flink, struct dynvec *sub_dirs_vec));
-extern int chdir_to_link __P((struct file_link* dir_link));
-void prune_file_names __P((char *str, struct file_link *from_link));
-char **vectorize_string __P((char *string, char const *delimiter_class));
-void include_languages __P((char *lang_names));
-void exclude_languages __P((char *lang_names));
-
-extern char *absolute_file_name __P((char *buffer, struct file_link const *flink));
-extern char *maybe_relative_file_name __P((char *buffer, struct file_link const *to_link,
- struct file_link const *from_link));
-extern char const *locate_id_file_name __P((char const *arg));
-
-extern int tree8_count_levels __P((unsigned int cardinality));
-extern int gets_past_00 __P((char *tok, FILE *input_FILE));
-extern int skip_past_00 __P((FILE *input_FILE));
-
-extern int links_depth __P((struct file_link const *flink));
+typedef int (*io_func_t) (FILE *, void *, unsigned int, int);
+
+extern struct file_link **read_id_file (char const *id_file_name, struct idhead *idhp);
+extern struct file_link **maybe_read_id_file (char const *id_file_name, struct idhead *idhp);
+extern int read_idhead (struct idhead *idhp);
+extern int write_idhead (struct idhead *idhp);
+extern int sizeof_idhead (void);
+struct file_link *init_walker (struct idhead *idhp);
+extern void init_idh_obstacks (struct idhead *idhp);
+extern void init_idh_tables (struct idhead *idhp);
+
+extern int io_write (FILE *output_FILE, void *addr, unsigned int size, int io_type);
+extern int io_read (FILE *input_FILE, void *addr, unsigned int size, int io_type);
+extern int io_idhead (FILE *fp, io_func_t iof, struct idhead *idhp);
+
+extern struct file_link *get_current_dir_link (void);
+extern struct file_link **deserialize_file_links (struct idhead *idhp);
+extern void serialize_file_links (struct idhead *idhp);
+
+extern void mark_member_file_links (struct idhead *idhp);
+extern int member_file_qsort_compare (void const *x, void const *y);
+extern struct file_link *parse_file_name (char *file_name, struct file_link *relative_dir_link);
+extern void print_filenames (struct file_link **flinkv, enum separator_style separator_style);
+extern enum separator_style parse_separator_style (char const *arg);
+
+extern void walk_flink (struct file_link *flink, struct dynvec *sub_dirs_vec);
+extern int chdir_to_link (struct file_link* dir_link);
+void prune_file_names (char *str, struct file_link *from_link);
+char **vectorize_string (char *string, char const *delimiter_class);
+void include_languages (char *lang_names);
+void exclude_languages (char *lang_names);
+
+extern char *absolute_file_name (char *buffer, struct file_link const *flink);
+extern char *maybe_relative_file_name (char *buffer, struct file_link const *to_link, struct file_link const *from_link);
+extern char const *locate_id_file_name (char const *arg);
+
+extern int tree8_count_levels (unsigned int cardinality);
+extern int gets_past_00 (char *tok, FILE *input_FILE);
+extern int skip_past_00 (FILE *input_FILE);
+
+extern int links_depth (struct file_link const *flink);
+
#if HAVE_LINK
-extern struct member_file *find_member_file __P((struct file_link const *flink));
+
+extern struct member_file *find_member_file (struct file_link const *flink);
+
#endif
extern struct idhead idh;
diff --git a/libidu/idread.c b/libidu/idread.c
index b327a6a..4d4215f 100644
--- a/libidu/idread.c
+++ b/libidu/idread.c
@@ -19,15 +19,19 @@
#include <config.h>
#include <stdio.h>
+#include <stddef.h>
+#include <errno.h>
+#include <stdlib.h>
+
#include "idfile.h"
-#include "xstddef.h"
#include "hash.h"
#include "error.h"
-#include "xobstack.h"
-#include "xmalloc.h"
+#include "obstack.h"
+#include "xalloc.h"
#include "xnls.h"
+#include "iduglobal.h"
-int fgets0 __P((char *buf0, int size, FILE *in_FILE));
+int fgets0 (char *buf0, int size, FILE *in_FILE);
/****************************************************************************/
@@ -78,9 +82,9 @@ maybe_read_id_file (char const *id_file_name, struct idhead *idhp)
struct file_link **
deserialize_file_links (struct idhead *idhp)
{
- struct file_link **flinks_0 = MALLOC (struct file_link *, idhp->idh_file_links);
+ struct file_link **flinks_0 = xmalloc (sizeof(struct file_link *) * idhp->idh_file_links);
struct file_link **flinks = flinks_0;
- struct file_link **members_0 = MALLOC (struct file_link *, idhp->idh_files + 1);
+ struct file_link **members_0 = xmalloc (sizeof(struct file_link *) * idhp->idh_files + 1);
struct file_link **members = members_0;
struct file_link *flink;
struct file_link **slot;
diff --git a/libidu/iduglobal.h b/libidu/iduglobal.h
new file mode 100644
index 0000000..e7a2916
--- /dev/null
+++ b/libidu/iduglobal.h
@@ -0,0 +1,71 @@
+#ifndef _iduglobal_h
+#define _iduglobal_h
+
+/* iduglobal.h -- global definitions for libidu
+ Copyright (C) 1995, 1999, 2005 Free Software Foundation, Inc.
+ Written by Claudio Fontana <sick_soul@users.sourceforge.net>
+
+ 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
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program 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 (look for the file called COPYING).
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+#ifndef cardinalityof
+#define cardinalityof(ARRAY) (sizeof (ARRAY) / sizeof ((ARRAY)[0]))
+#endif
+
+#ifndef strequ
+#define strequ(s1, s2) (strcmp ((s1), (s2)) == 0)
+#define strnequ(s1, s2, n) (strncmp ((s1), (s2), (n)) == 0)
+#endif
+
+#ifndef obstack_chunk_alloc
+#define obstack_chunk_alloc xmalloc
+#endif
+#ifndef obstack_chunk_free
+#define obstack_chunk_free free
+#endif
+
+#define CLONE(o, t, n) ((t *) memcpy (xmalloc (sizeof(t) * (n)), (o), sizeof (t) * (n)))
+
+#define DEBUG(args) /* printf args */
+
+#ifndef FNM_FILE_NAME
+#define FNM_FILE_NAME FNM_PATHNAME
+#endif
+
+#if HAVE_LINK
+#define MAYBE_FNM_CASEFOLD 0
+#else
+#define MAYBE_FNM_CASEFOLD FNM_CASEFOLD
+#endif
+
+#if HAVE_LINK
+#define IS_ABSOLUTE(_dir_) ((_dir_)[0] == '/')
+#define SLASH_STRING "/"
+#define SLASH_CHAR '/'
+#define DOT_DOT_SLASH "../"
+#else
+/* NEEDSWORK: prefer forward-slashes as a user-configurable option. */
+#define IS_ABSOLUTE(_dir_) ((_dir_)[1] == ':')
+#define SLASH_STRING "\\/"
+#define SLASH_CHAR '\\'
+#define DOT_DOT_SLASH "..\\"
+#endif
+
+#endif /* _iduglobal_h */
diff --git a/libidu/idwrite.c b/libidu/idwrite.c
index 6257302..08aa480 100644
--- a/libidu/idwrite.c
+++ b/libidu/idwrite.c
@@ -18,14 +18,15 @@
*/
#include <config.h>
+#include <stdlib.h>
#include "idfile.h"
#include "hash.h"
-#include "xobstack.h"
-#include "xmalloc.h"
+#include "obstack.h"
+#include "xalloc.h"
#include "xnls.h"
#include "error.h"
-int file_link_qsort_compare __P((void const *x, void const *y));
+int file_link_qsort_compare (void const *x, void const *y);
/****************************************************************************/
@@ -45,7 +46,7 @@ serialize_file_links (struct idhead *idhp)
flinks_0 = (struct file_link **) hash_dump (&idhp->idh_file_link_table,
0, file_link_qsort_compare);
end = &flinks_0[idhp->idh_file_link_table.ht_fill];
- parents = parents_0 = MALLOC (struct file_link *, idhp->idh_file_link_table.ht_fill);
+ parents = parents_0 = xmalloc (sizeof(struct file_link *) * idhp->idh_file_link_table.ht_fill);
for (flinks = flinks_0; flinks < end; flinks++)
{
struct file_link *flink = *flinks;
diff --git a/libidu/scanners.c b/libidu/scanners.c
index 9c4331a..1890196 100644
--- a/libidu/scanners.c
+++ b/libidu/scanners.c
@@ -19,29 +19,20 @@
#include <config.h>
#include <stdio.h>
#include <ctype.h>
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
#include <getopt.h>
-#include "xstdlib.h"
-#include "xstddef.h"
-#include "xunistd.h"
-#include "xsysstat.h"
-#include "xstring.h"
-#include "xmalloc.h"
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+#include "xalloc.h"
#include "xnls.h"
#include "error.h"
#include "scanners.h"
#include "tokflags.h"
-
-#ifndef HAVE_DECL_STRSEP
-"this configure-time declaration test was not run"
-#endif
-#if !HAVE_DECL_STRSEP
-char *strsep ();
-#endif
-
-#define DEBUG(args) /* printf args */
+#include "iduglobal.h"
struct obstack lang_args_obstack;
struct lang_args *lang_args_default = 0;
@@ -49,26 +40,26 @@ struct lang_args *lang_args_list = 0;
struct obstack tokens_obstack;
int log_8_member_files = 0;
-extern void usage __P((void));
+extern void usage (void);
extern char *program_name;
/****************************************************************************/
-struct lang_args **parse_language_map_file __P((char const *file_name, struct lang_args **next_ptr));
-char *read_language_map_file __P((char const *file_name));
-void tokenize_args_string __P((char *args_string, int *argcp, char ***argvp));
+struct lang_args **parse_language_map_file (char const *file_name, struct lang_args **next_ptr);
+char *read_language_map_file (char const *file_name);
+void tokenize_args_string (char *args_string, int *argcp, char ***argvp);
-static struct token *get_token_c __P((FILE *in_FILE, void const *args, int *flags));
-static void *parse_args_c __P((char **argv, int argc));
-static void help_me_c __P((void));
+static struct token *get_token_c (FILE *in_FILE, void const *args, int *flags);
+static void *parse_args_c (char **argv, int argc);
+static void help_me_c (void);
-static struct token *get_token_asm __P((FILE *in_FILE, void const *args, int *flags));
-static void *parse_args_asm __P((char **argv, int argc));
-static void help_me_asm __P((void));
+static struct token *get_token_asm (FILE *in_FILE, void const *args, int *flags);
+static void *parse_args_asm (char **argv, int argc);
+static void help_me_asm (void);
-static struct token *get_token_text __P((FILE *in_FILE, void const *args, int *flags));
-static void *parse_args_text __P((char **argv, int argc));
-static void help_me_text __P((void));
+static struct token *get_token_text (FILE *in_FILE, void const *args, int *flags);
+static void *parse_args_text (char **argv, int argc);
+static void help_me_text (void);
struct language languages_0[] =
{
@@ -197,7 +188,7 @@ parse_language_map_file (char const *file_name, struct lang_args **next_ptr)
continue;
}
- new_args = OBSTACK_ALLOC (&lang_args_obstack, struct lang_args, 1);
+ new_args = obstack_alloc (&lang_args_obstack, sizeof(struct lang_args) * 1);
if (new_args == 0)
error (1, 0, _("can't allocate language args: memory exhausted"));
new_args->la_pattern = obstack_copy0 (&lang_args_obstack, lmp, pattern_size);
@@ -266,7 +257,7 @@ read_language_map_file (char const *file_name)
if (fstat (map_fd, &st) < 0)
error (1, errno, _("can't get size of map file `%s'"), file_name);
- lang_map_buffer = MALLOC (char, st.st_size + 2);
+ lang_map_buffer = xmalloc (sizeof(char) * (st.st_size + 2));
if (lang_map_buffer == 0)
error (1, 0, _("can't allocate language args: memory exhausted"));
lang_map_buffer[st.st_size] = '\n';
@@ -289,7 +280,7 @@ void
tokenize_args_string (char *args_string, int *argcp, char ***argvp)
{
static char horizontal_space[] = " \t";
- char **argv_0 = MALLOC (char *, strlen (args_string) / 2);
+ char **argv_0 = xmalloc (sizeof(char *) * strlen (args_string) / 2);
char **argv = argv_0;
char *arg;
@@ -301,7 +292,7 @@ tokenize_args_string (char *args_string, int *argcp, char ***argvp)
arg = strsep (&args_string, horizontal_space);
}
*argcp = argv - argv_0;
- *argvp = REALLOC (argv_0, char *, *argcp);
+ *argvp = xrealloc (argv_0, sizeof(char *) * (*argcp));
}
static void
@@ -445,7 +436,7 @@ parse_args_c (char **argv, int argc)
{
tmp_string = strdup (*argv);
tokenize_args_string (tmp_string, &argc, &argv);
- args = MALLOC (struct args_c, 1);
+ args = xmalloc (sizeof(struct args_c) * 1);
args->strip_underscore = 0;
args->ctype = ctype_c;
}
@@ -836,7 +827,7 @@ parse_args_asm (char **argv, int argc)
{
tmp_string = strdup (*argv);
tokenize_args_string (tmp_string, &argc, &argv);
- args = MALLOC (struct args_asm, 1);
+ args = xmalloc (sizeof(struct args_asm) * 1);
args->strip_underscore = 0;
args->ctype = ctype_asm;
args->handle_cpp = 1;
@@ -1104,7 +1095,7 @@ parse_args_text (char **argv, int argc)
{
tmp_string = strdup (*argv);
tokenize_args_string (tmp_string, &argc, &argv);
- args = MALLOC (struct args_text, 1);
+ args = xmalloc (sizeof(struct args_text) * 1);
args->ctype = ctype_text;
}
diff --git a/libidu/scanners.h b/libidu/scanners.h
index 7f49734..7ff7da1 100644
--- a/libidu/scanners.h
+++ b/libidu/scanners.h
@@ -19,7 +19,7 @@
#ifndef _scanners_h_
#define _scanners_h_
-#include "xobstack.h"
+#include "obstack.h"
extern int log_8_member_files; /* log base 8 of the # of files.
e.g., log_8 (32768) == 5 */
@@ -35,9 +35,9 @@ struct token
#define TOKEN_NAME(TOKEN) ((TOKEN)->tok_hits_name + log_8_member_files)
#define OFFSETOF_TOKEN_NAME (offsetof (struct token, tok_hits_name) + log_8_member_files)
-typedef struct token *(*get_token_func_t) __P((FILE *in_FILE, void const *args, int *flags));
-typedef void *(*parse_args_func_t) __P((char **argv, int argc));
-typedef void (*help_me_func_t) __P((void));
+typedef struct token *(*get_token_func_t) (FILE *in_FILE, void const *args, int *flags);
+typedef void *(*parse_args_func_t) (char **argv, int argc);
+typedef void (*help_me_func_t) (void);
struct language
{
@@ -59,12 +59,12 @@ struct lang_args
struct lang_args *la_next;
};
-extern void language_help_me __P((void));
-extern void language_getopt __P((void));
-extern void language_save_arg __P((char *arg));
-extern struct language *get_language __P((char const *lang_name));
-extern void parse_language_map __P((char const *file_name));
-extern void set_default_language __P((char const *lang_name));
+extern void language_help_me (void);
+extern void language_getopt (void);
+extern void language_save_arg (char *arg);
+extern struct language *get_language (char const *lang_name);
+extern void parse_language_map (char const *file_name);
+extern void set_default_language (char const *lang_name);
extern struct lang_args *lang_args_default;
extern struct lang_args *lang_args_list;
diff --git a/libidu/walker.c b/libidu/walker.c
index c1c5bb6..7b63e5d 100644
--- a/libidu/walker.c
+++ b/libidu/walker.c
@@ -18,67 +18,64 @@
*/
#include <config.h>
-#include "xsysstat.h"
+#include <sys/stat.h>
#include <stdio.h>
-#include "xstdlib.h"
-#include "xstddef.h"
-#include "xunistd.h"
-#include "xstring.h"
-#include "xfnmatch.h"
-#include "xdirent.h"
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <string.h>
+#include <fnmatch.h>
+#include <dirent.h>
+#include <errno.h>
#include "xnls.h"
#include "idfile.h"
#include "error.h"
-#include "xmalloc.h"
+#include "xalloc.h"
#include "dynvec.h"
#include "scanners.h"
#include "pathmax.h"
-#include "xalloca.h"
-
-#ifndef HAVE_DECL_STRSEP
-"this configure-time declaration test was not run"
-#endif
-#if !HAVE_DECL_STRSEP
-char *strsep ();
-#endif
+#include "xalloc.h"
+#include "iduglobal.h"
int walker_verbose_flag = 0;
off_t largest_member_file = 0;
-int walk_dir __P((struct file_link *dir_link));
-struct member_file *get_member_file __P((struct file_link *flink));
-struct lang_args *get_lang_args __P((struct file_link const *flink));
-void print_member_file __P((struct member_file *member));
-int walk_sub_dirs __P((struct dynvec *sub_dirs_vec));
-void reparent_children __P((struct file_link *dlink, struct file_link *slink));
-int classify_link __P((struct file_link *flink, struct stat *stp));
-struct file_link *get_link_from_dirent __P((struct dirent *dirent, struct file_link *parent));
-struct file_link *make_link_from_dirent __P((struct dirent *dirent, struct file_link *parent));
-struct file_link *get_link_from_string __P((char const *name, struct file_link *parent));
-struct file_link *make_link_from_string __P((char const *name, struct file_link *parent));
-int lang_wanted __P((char const *lang_name));
-char **append_strings_to_vector __P((char **vector_0, char *string, char const *delimiter_class));
-int vector_length __P((char **vector));
-int string_in_vector __P((char const *string, char **vector));
-static int same_as_dot __P((char const *cwd));
-struct file_link const **fill_link_vector __P((struct file_link const **vec_buf, struct file_link const *flink));
-struct file_link const **fill_link_vector_1 __P((struct file_link const **vec_buf, struct file_link const *flink));
-char *fill_dot_dots __P((char *buf, int levels));
-static char *absolute_file_name_1 __P((char *buffer, struct file_link const *flink));
-unsigned long member_file_hash_1 __P((void const *key));
-unsigned long member_file_hash_2 __P((void const *key));
-int member_file_hash_compare __P((void const *x, void const *y));
-unsigned long file_link_hash_1 __P((void const *key));
-unsigned long file_link_hash_2 __P((void const *key));
-int file_link_hash_compare __P((void const *x, void const *y));
-unsigned long dev_ino_hash_1 __P((void const *key));
-unsigned long dev_ino_hash_2 __P((void const *key));
-int dev_ino_hash_compare __P((void const *x, void const *y));
-int symlink_ancestry __P((struct file_link *flink));
+int walk_dir (struct file_link *dir_link);
+struct member_file *get_member_file (struct file_link *flink);
+struct lang_args *get_lang_args (struct file_link const *flink);
+void print_member_file (struct member_file *member);
+int walk_sub_dirs (struct dynvec *sub_dirs_vec);
+void reparent_children (struct file_link *dlink, struct file_link *slink);
+int classify_link (struct file_link *flink, struct stat *stp);
+struct file_link *get_link_from_dirent (struct dirent *dirent, struct file_link *parent);
+struct file_link *make_link_from_dirent (struct dirent *dirent, struct file_link *parent);
+struct file_link *get_link_from_string (char const *name, struct file_link *parent);
+struct file_link *make_link_from_string (char const *name, struct file_link *parent);
+int lang_wanted (char const *lang_name);
+char **append_strings_to_vector (char **vector_0, char *string, char const *delimiter_class);
+int vector_length (char **vector);
+int string_in_vector (char const *string, char **vector);
+static int same_as_dot (char const *cwd);
+struct file_link const **fill_link_vector (struct file_link const **vec_buf, struct file_link const *flink);
+struct file_link const **fill_link_vector_1 (struct file_link const **vec_buf, struct file_link const *flink);
+char *fill_dot_dots (char *buf, int levels);
+static char *absolute_file_name_1 (char *buffer, struct file_link const *flink);
+unsigned long member_file_hash_1 (void const *key);
+unsigned long member_file_hash_2 (void const *key);
+int member_file_hash_compare (void const *x, void const *y);
+unsigned long file_link_hash_1 (void const *key);
+unsigned long file_link_hash_2 (void const *key);
+int file_link_hash_compare (void const *x, void const *y);
+unsigned long dev_ino_hash_1 (void const *key);
+unsigned long dev_ino_hash_2 (void const *key);
+int dev_ino_hash_compare (void const *x, void const *y);
+int symlink_ancestry (struct file_link *flink);
#if HAVE_LINK
-struct file_link *find_alias_link __P((struct file_link *flink, struct stat *stp));
-struct member_file *maybe_get_member_file __P((struct file_link *flink, struct stat *stp));
+
+struct file_link *find_alias_link (struct file_link *flink, struct stat *stp);
+struct member_file *maybe_get_member_file (struct file_link *flink, struct stat *stp);
+
#endif
#define IS_DOT(s) ((s)[0] == '.' && (s)[1] == '\0')
@@ -90,7 +87,7 @@ static struct file_link *current_dir_link = 0;
static char const white_space[] = " \t\r\n\v\f";
-char* xgetcwd __P((void));
+char* xgetcwd (void);
/****************************************************************************/
@@ -109,7 +106,7 @@ walk_dir (struct file_link *dir_link)
dirp = opendir (".");
if (dirp == 0)
{
- char *file_name = ALLOCA (char, PATH_MAX);
+ char *file_name = alloca (PATH_MAX);
absolute_file_name (file_name, dir_link);
error (0, errno, _("can't read directory `%s' (`.' from `%s')"), file_name, xgetcwd ());
return 0;
@@ -176,7 +173,7 @@ walk_flink (struct file_link *flink, struct dynvec *sub_dirs_vec)
if ((old_flags & FL_TYPE_MASK)
&& (old_flags & FL_TYPE_MASK) != (new_flags & FL_TYPE_MASK))
{
- char *file_name = ALLOCA (char, PATH_MAX);
+ char *file_name = alloca (PATH_MAX);
absolute_file_name (file_name, flink);
error (0, 0, _("notice: `%s' was a %s, but is now a %s!"), file_name,
(FL_IS_FILE (old_flags) ? _("file") : _("directory")),
@@ -299,8 +296,8 @@ maybe_get_member_file (struct file_link *flink, struct stat *stp)
int alias_ancestry = symlink_ancestry (alias_link);
if (member->mf_lang_args != alias_member->mf_lang_args)
{
- char *file_name = ALLOCA (char, PATH_MAX);
- char *alias_file_name = ALLOCA (char, PATH_MAX);
+ char *file_name = alloca (PATH_MAX);
+ char *alias_file_name = alloca (PATH_MAX);
absolute_file_name (file_name, flink);
absolute_file_name (alias_file_name, alias_link);
error (0, 0, _("warning: `%s' and `%s' are the same file, but yield different scans!"),
@@ -395,7 +392,7 @@ get_member_file (struct file_link *flink)
#if 0
if (member->mf_lang_args != args)
{
- char *file_name = ALLOCA (char, PATH_MAX);
+ char *file_name = alloca (PATH_MAX);
absolute_file_name (file_name, flink);
error (0, 0, _("notice: scan parameters changed for `%s'"), file_name);
member->mf_old_index = -1;
@@ -428,7 +425,7 @@ struct lang_args *
get_lang_args (struct file_link const *flink)
{
struct lang_args *args = lang_args_list;
- char *file_name = ALLOCA (char, PATH_MAX);
+ char *file_name = alloca (PATH_MAX);
while (args)
{
@@ -452,7 +449,7 @@ get_lang_args (struct file_link const *flink)
void
print_member_file (struct member_file *member)
{
- char *file_name = ALLOCA (char, PATH_MAX);
+ char *file_name = alloca (PATH_MAX);
absolute_file_name (file_name, member->mf_link);
printf ("%ld: %s: %s\n", idh.idh_member_file_table.ht_fill - 1,
member->mf_lang_args->la_language->lg_name, file_name);
@@ -498,17 +495,16 @@ append_strings_to_vector (char **vector_0, char *string, char const *delimiter_c
if (vector_0)
{
int length = vector_length (vector_0);
- vector_0 = REALLOC (vector_0, char *,
- length + 2 + strlen (string) / 2);
+ vector_0 = xrealloc (vector_0, sizeof(char *) * (length + 2 + strlen (string) / 2));
vector = &vector_0[length];
}
else
- vector = vector_0 = MALLOC (char *, 2 + strlen (string) / 2);
+ vector = vector_0 = xmalloc (sizeof(char *) * (2 + strlen (string) / 2));
do
*vector = strsep (&string, delimiter_class);
while (*vector++);
- return REALLOC (vector_0, char *, vector - vector_0);
+ return xrealloc (vector_0, sizeof(char *) * (vector - vector_0));
}
int
@@ -646,7 +642,7 @@ same_as_dot (char const *cwd)
int
chdir_to_link (struct file_link *dir_link)
{
- char *to_dir_name = ALLOCA (char, PATH_MAX);
+ char *to_dir_name = alloca (PATH_MAX);
if (current_dir_link == dir_link)
return 1;
@@ -661,7 +657,7 @@ chdir_to_link (struct file_link *dir_link)
error (0, errno, _("can't chdir to `%s'"), to_dir_name);
else
{
- char *from_dir_name = ALLOCA (char, PATH_MAX);
+ char *from_dir_name = alloca (PATH_MAX);
absolute_file_name (from_dir_name, current_dir_link);
error (0, errno, _("can't chdir to `%s' from `%s'"), to_dir_name, from_dir_name);
}
@@ -677,7 +673,7 @@ chdir_to_link (struct file_link *dir_link)
char **
vectorize_string (char *string, char const *delimiter_class)
{
- char **vector_0 = MALLOC (char *, 2 + strlen (string) / 2);
+ char **vector_0 = xmalloc (sizeof(char *) * (2 + strlen (string) / 2));
char **vector = vector_0;
*vector++ = strsep (&string, delimiter_class);
@@ -690,7 +686,7 @@ vectorize_string (char *string, char const *delimiter_class)
*vector = strsep (&string, delimiter_class);
while (*vector++);
}
- return REALLOC (vector_0, char *, vector - vector_0);
+ return xrealloc (vector_0, sizeof(char *) * (vector - vector_0));
}
void
@@ -846,8 +842,8 @@ fill_link_vector_1 (struct file_link const **vec_buf, struct file_link const *fl
char *
maybe_relative_file_name (char *buf_0, struct file_link const *to_link, struct file_link const *from_link)
{
- struct file_link const **to_link_vec_0 = ALLOCA (struct file_link const *, PATH_MAX/2);
- struct file_link const **from_link_vec_0 = ALLOCA (struct file_link const *, PATH_MAX/2);
+ struct file_link const **to_link_vec_0 = alloca (sizeof (struct file_link const *) * (PATH_MAX/2));
+ struct file_link const **from_link_vec_0 = alloca (sizeof (struct file_link const *) * (PATH_MAX/2));
struct file_link const **to_link_vec = to_link_vec_0;
struct file_link const **from_link_vec = from_link_vec_0;
struct file_link const **from_link_end;
@@ -860,7 +856,7 @@ maybe_relative_file_name (char *buf_0, struct file_link const *to_link, struct f
from_link = current_dir_link;
if (alloc_me)
- buf_0 = MALLOC (char, PATH_MAX);
+ buf_0 = xmalloc (PATH_MAX);
/* Optimize common cases. */
if (to_link == from_link)
@@ -919,7 +915,7 @@ maybe_relative_file_name (char *buf_0, struct file_link const *to_link, struct f
}
out:
if (alloc_me)
- buf_0 = REALLOC (buf_0, char, 1 + strlen (buf_0));
+ buf_0 = xrealloc (buf_0, (1 + strlen (buf_0)));
return buf_0;
}
@@ -948,7 +944,7 @@ absolute_file_name (char *buf_0, struct file_link const *flink)
int alloc_me = (buf_0 == 0);
if (alloc_me)
- buf_0 = MALLOC (char, PATH_MAX);
+ buf_0 = xmalloc (PATH_MAX);
end = absolute_file_name_1 (buf_0, flink);
/* Clip the trailing slash. */
#if HAVE_LINK
@@ -960,7 +956,7 @@ absolute_file_name (char *buf_0, struct file_link const *flink)
#endif
*end++ = '\0';
if (alloc_me)
- buf_0 = REALLOC (buf_0, char, end - buf_0);
+ buf_0 = xrealloc (buf_0, (size_t)(end - buf_0));
return buf_0;
}
diff --git a/libidu/xnls.h b/libidu/xnls.h
index f7f5b45..4d606e1 100644
--- a/libidu/xnls.h
+++ b/libidu/xnls.h
@@ -22,19 +22,11 @@
/* Take care of NLS matters. */
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
-#if !HAVE_SETLOCALE
-# define setlocale(Category, Locale) /* empty */
-#endif
+#include "gettext.h"
#if ENABLE_NLS
-# include <libintl.h>
# define _(Text) gettext (Text)
#else
-# define bindtextdomain(Domain, Directory) /* empty */
-# define textdomain(Domain) /* empty */
# define _(Text) Text
#endif