summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in101
-rw-r--r--NEWS18
-rw-r--r--README14
-rw-r--r--TODO2
-rwxr-xr-xconfigure62
-rw-r--r--configure.in5
-rw-r--r--lid.c149
-rw-r--r--misc.c2
-rw-r--r--misc.h2
-rw-r--r--stamp-h.in2
10 files changed, 190 insertions, 167 deletions
diff --git a/Makefile.in b/Makefile.in
index db37dae..a5a826d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -22,7 +22,8 @@ PRODUCT = @PRODUCT@
MAJOR_VERSION = @MAJOR_VERSION@
MINOR_VERSION = @MINOR_VERSION@
PATCH_LEVEL = @PATCH_LEVEL@
-VERISON = @VERSION@
+OLD_PATCH_LEVEL=@OLD_PATCH_LEVEL@
+VERSION = @VERSION@
FULL_VERSION = @FULL_VERSION@
SHELL = /bin/sh
@@ -80,15 +81,15 @@ ALL_CFILES = $(SRC_CFILES) $(LIB_CFILES) $(GEN_CFILES)
SRC_HFILES = alloc.h bitops.h filenames.h idarg.h \
idfile.h misc.h scanners.h strxtra.h token.h
LIB_HFILES = regex.h getopt.h
-GEN_HFILES = config.h
-ID_SRC_FILES = $(SRC_HFILES) $(GEN_HFILES) $(LIB_HFILES) $(SRC_CFILES) $(LIB_CFILES) $(SRC_YFILES)
+ID_SRC_FILES = $(SRC_HFILES) $(LIB_HFILES) $(SRC_CFILES) $(LIB_CFILES) $(SRC_YFILES)
DIST_SRC_FILES =$(ALL_CFILES) $(SRC_HFILES) $(LIB_HFILES) $(SRC_YFILES)
-DIST_DOC_FILES =mkid.texinfo mkid.info fid.1 iid.1 lid.1 mkid.1
+INFO_FILES = mkid.info
+DIST_DOC_FILES =mkid.texinfo $(INFO_FILES) fid.1 iid.1 lid.1 mkid.1
DIST_CONF_FILES=aclocal.m4 acconfig.h configure.in Makefile.in mkdirhier \
stamp-h.in config.h.in configure $(DEPEND)
-DIST_MISC_FILES=COPYING README INSTALL NEWS TODO THANKS idtest gid.el install-sh iid.help
+DIST_MISC_FILES=COPYING README INSTALL NEWS TODO THANKS idtest gid.el install-sh iid.help ChangeLog
DIST_FILES = $(DIST_CONF_FILES) $(DIST_SRC_FILES) $(DIST_DOC_FILES) $(DIST_MISC_FILES)
@@ -96,17 +97,19 @@ DIST_DIR = $(PRODUCT)-$(FULL_VERSION)
DIST_TGZ = $(DIST_DIR).tar.gz
DIST_UU = $(DIST_TGZ).uu
-# Note: OLD_DIST_DIR must be passed in through the environment
-# do "OLD_DIST_DIR=mkid-X.X.X make patch"
+OLD_DIST_DIR = $(PRODUCT)-$(VERSION).$(OLD_PATCH_LEVEL)
+
PATCH_GZ = $(OLD_DIST_DIR)-$(FULL_VERSION).diff.gz
PATCH_UU = $(PATCH_GZ).uu
##############################################################################
+.PRECIOUS: $(DEPEND) Makefile
+
.SUFFIXES:
.SUFFIXES: .c .i .o
-INCLUDES = -I$(srcdir)
+INCLUDES = -I. -I$(srcdir)
CC_FLAGS = $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
LINK = $(CC) $(LDFLAGS) -o $@
@@ -143,9 +146,9 @@ iid.c: iid.y
##############################################################################
-info: mkid.info
+info: $(INFO_FILES)
-mkid.info: mkid.texinfo version.texi
+$(INFO_FILES): mkid.texinfo version.texi
cd $(srcdir) && $(MAKEINFO) mkid.texinfo
dvi: mkid.dvi
@@ -154,9 +157,9 @@ mkid.dvi: mkid.texinfo version.texi
$(TEXI2DVI) $(srcdir)/mkid.texinfo
version.texi: configure.in
- echo "@set VERSION $(VERSION)" >version.tmp
- if cmp -s version.tmp $(srcdir)/version.texi; then rm version.tmp; \
- else mv version.tmp $(srcdir)/version.texi; fi
+ if ! echo "@set VERSION $(VERSION)" |cmp -s - $(srcdir)/version.texi; then \
+ echo "@set VERSION $(VERSION)" >$(srcdir)/version.texi; \
+ fi
##############################################################################
@@ -164,39 +167,42 @@ install: all
$(srcdir)/mkdirhier $(bindir) $(libdir) $(infodir)
@for file in $(PROGRAMS); do \
cmd="$(INSTALL_PROGRAM) $$file $(bindir)/`echo $$file | sed '$(transform)'`"; \
- echo $$cmd; eval $$cmd; \
+ (echo $$cmd; eval $$cmd); \
done
- @for file in $(LID_LINKS); do \
- lid=`echo lid |sed '$(transform)'`; \
+ @lid=`echo lid |sed '$(transform)'`; \
+ for file in $(LID_LINKS); do \
file=`echo $$file |sed '$(transform)'`; \
- cmd="rm -f $(bindir)/$$file; $(LN_S) $(bindir)/$$lid $(bindir)/$$file"; \
- echo $$cmd; eval $$cmd; \
+ cmd="cd $(bindir); rm -f $$file; $(LN_S) $$lid $$file"; \
+ (echo $$cmd; eval $$cmd); \
done
$(INSTALL_DATA) $(srcdir)/iid.help $(IID_HELP_FILE)
- @for file in `cd $(srcdir) && echo mkid.info*`; do \
+ @for file in $(INFO_FILES); do \
cmd="$(INSTALL_DATA) $(srcdir)/$$file $(infodir)/$$file"; \
- echo $$cmd; eval $$cmd; \
+ (echo $$cmd; eval $$cmd); \
done
uninstall:
@for file in $(TARGETS); do \
cmd="rm -f $(bindir)/`echo $$file |sed '$(transform)'`"; \
- echo $$cmd; eval $$cmd; \
+ (echo $$cmd; eval $$cmd); \
done
+ rm -f $(IID_HELP_FILE)
@for file in `cd $(infodir) && echo mkid.info*`; do \
cmd="rm -f $(infodir)/$$file"; \
- echo $$cmd; eval $$cmd; \
+ (echo $$cmd; eval $$cmd); \
done
##############################################################################
check: mkid lid fid idx
here=`pwd`; PATH=$$here:$$PATH; cd $(srcdir) \
- && $$here/mkid -v -f$$here/ID $(SRC_FILES) \
- && $(srcdir)/idtest -f$$here/ID $(SRC_FILES)
+ && $$here/mkid -v -f$$here/ID $(ID_SRC_FILES) \
+ && $(srcdir)/idtest -f$$here/ID $(ID_SRC_FILES) \
+ && rm -f $$here/ID
-ID: $(SRC_FILES) mkid
- ./mkid $(SRC_FILES)
+ID: $(ID_SRC_FILES) mkid
+ here=`pwd`; PATH=$$here:$$PATH; cd $(srcdir) \
+ && $$here/mkid -f$$here/ID $$here/config.h $(ID_SRC_FILES) \
tags: TAGS
@@ -217,39 +223,52 @@ distclean: clean
rm -f Makefile config.h config.status config.cache stamp-h
realclean: distclean
- rm -f *.info* TAGS ID
+ rm -f *.info* TAGS ID *~
##############################################################################
+dist-uu: $(DIST_UU)
+$(DIST_UU): $(DIST_TGZ)
+ uuencode $(DIST_TGZ) <$(DIST_TGZ) >$@
+
+dist dist-tgz: $(DIST_TGZ)
+$(DIST_TGZ): $(DIST_DIR)
+ tar cfzho $@ $(DIST_DIR)
+
dist-dir: $(DIST_DIR)
+dist-dir-links: $(OLD_DIST_DIR) $(DIST_DIR)
+ cd $(DIST_DIR); \
+ for file in $(DIST_FILES); do \
+ if cmp -s $$file ../$(OLD_DIST_DIR)/$$file; then \
+ rm -f $$file; \
+ if test -L ../$(OLD_DIST_DIR)/$$file; then \
+ cp -a ../$(OLD_DIST_DIR)/$$file $$file; \
+ else \
+ $(LN_S) ../$(OLD_DIST_DIR)/$$file $$file; \
+ fi; \
+ fi; \
+ done
+
$(DIST_DIR): $(DIST_FILES)
rm -fr $@
mkdir $@
chmod 777 $@
- distdir=`pwd`/$@; cd $(srcdir); ln $(DIST_FILES) $$distdir
+ distdir=`pwd`/$@; cd $(srcdir); cp -p $(DIST_FILES) $$distdir
chmod -R a+r $@
-dist dist-tgz: $(DIST_TGZ)
-$(DIST_TGZ): $(DIST_DIR)
- tar cfzho $@ $(DIST_DIR)
-
-dist-uu: $(DIST_UU)
-$(DIST_UU): $(DIST_TGZ)
- uuencode $(DIST_TGZ) <$(DIST_TGZ) >$@
+patch-uu: $(PATCH_UU)
+$(PATCH_UU): $(PATCH_GZ)
+ uuencode $(PATCH_GZ) <$(PATCH_GZ) >$@
patch patch-gz: $(PATCH_GZ)
$(PATCH_GZ): $(OLD_DIST_DIR) $(DIST_DIR)
diff -r -c --show-c-function --new-file $(OLD_DIST_DIR) $(DIST_DIR) |gzip >$@
-patch-uu: $(PATCH_UU)
-$(PATCH_UU): $(PATCH_GZ)
- uuencode $(PATCH_GZ) <$(PATCH_GZ) >$@
-
##############################################################################
Makefile: Makefile.in config.status $(DEPEND)
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
-config.status: configure
+config.status: configure config.cache
./config.status --recheck
$(srcdir)/configure: configure.in aclocal.m4
cd $(srcdir) && autoconf
@@ -263,7 +282,7 @@ $(srcdir)/stamp-h.in: configure.in aclocal.m4 acconfig.h
cd $(srcdir) && autoheader
date >$(srcdir)/stamp-h.in
-depend $(DEPEND): $(ALL_CFILES)
+depend $(DEPEND):
(cd $(srcdir) && $(CC) $(CC_FLAGS) -MM $(ALL_CFILES);) >$(DEPEND)
##############################################################################
diff --git a/NEWS b/NEWS
index 35f1200..3cc1f5d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,18 +1,18 @@
-mkid NEWS - User visible changes.
+`mkid' NEWS - User visible changes.
Version 3.0 - February 1995, by Greg McGary
-* mkid uses a new efficient algorithm for building the database. The old
-algorithm was O(n^2) for space and would exhaust memory or lead to page
-thrashing on very large programs. The new algorithm is linear with the
-size of the input for both time and space. It is now possible to build
-very large mkid databases covering many thousands of files totalling tens
-of megabytes and containing hundreds of thousands of unique tokens.
+* `mkid' uses a new efficient algorithm for building the database. The old
+ algorithm was O(n^2) for space and would exhaust memory or lead to page
+ thrashing on very large programs. The new algorithm is linear with the
+ size of the input for both time and space. It is now possible to build
+ very large `mkid' databases covering many thousands of files totalling
+ tens of megabytes and containing hundreds of thousands of unique tokens.
* The database header is now byte-order and word-size independent. ID
-files may be shared across networks of dissimilar architectures.
+ files may be shared across networks of dissimilar architectures.
-Version 2.0 - February 1991, by Tom Horsley
+Version 2.0 - March 1991, by Tom Horsley
Version 1.0 - September 1987, by Greg McGary
diff --git a/README b/README
index 1bd8a6f..0762487 100644
--- a/README
+++ b/README
@@ -1,15 +1,21 @@
+`mkid' README
+
`mkid' is a simple, fast, high-capacity, language-independent
identifier database tool. Actually, the term `identifier' is too
limiting--`mkid' stores tokens, be they program identifiers of any
-form, literal numbers, or words of human-readable text.
+form, literal numbers, or words of human-readable text. Database
+queries can be issued from the command-line, or from within emacs,
+serving as an augmented tags facility.
`mkid' was originally written by Greg McGary <gkm@magilla.cichlid.com>
and posted to comp.sources.unix in September 1987. It was then
maintained and enhanced by a loose knit group of programmers on the
Internet led by Tom Horsley <Tom.Horsley@mail.hcsc.com>. Tom released
-`mkid2' on comp.sources.unix in March, 1991. Since then, Greg
-McGary has resumed maintenance and is working on a greatly enhanced
-version 3 under GPL.
+`mkid2' on comp.sources.unix in March, 1991. Since then, Greg McGary
+has resumed maintenance and is releasing an improved version 3 under GPL.
+
+Version 3 is an interim release. Version 4 will follow in the coming
+months and include a cscope clone plus other improvements.
See file `COPYING' for copying conditions.
See file `INSTALL' for compilation and installation instructions.
diff --git a/TODO b/TODO
index eca6c82..31c772f 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-mkid TODO - Future directions
+`mkid' TODO - Future directions
* Bring all code into conformance with GNU project coding standards.
- Use command-line arguments, not the name of the program in argv[0]
diff --git a/configure b/configure
index 2fa57bb..12d78d5 100755
--- a/configure
+++ b/configure
@@ -402,7 +402,8 @@ fi
PRODUCT=mkid
MAJOR_VERSION=3
MINOR_VERSION=0
-PATCH_LEVEL=2
+PATCH_LEVEL=3
+OLD_PATCH_LEVEL=`expr $PATCH_LEVEL - 1`
VERSION=$MAJOR_VERSION.$MINOR_VERSION
FULL_VERSION=$VERSION.$PATCH_LEVEL
cat >> confdefs.h <<EOF
@@ -436,6 +437,7 @@ EOF
+
for ac_prog in 'bison -y' byacc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -676,7 +678,7 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 680 "configure"
+#line 682 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
@@ -690,7 +692,7 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 694 "configure"
+#line 696 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
@@ -722,7 +724,7 @@ else
ac_cv_cross=yes
else
cat > conftest.$ac_ext <<EOF
-#line 726 "configure"
+#line 728 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
@@ -743,7 +745,7 @@ if eval "test \"`echo '${'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 747 "configure"
+#line 749 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -765,7 +767,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 769 "configure"
+#line 771 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -783,7 +785,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 787 "configure"
+#line 789 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -804,7 +806,7 @@ if test "$cross_compiling" = yes; then
ac_cv_header_stdc=no
else
cat > conftest.$ac_ext <<EOF
-#line 808 "configure"
+#line 810 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -838,7 +840,7 @@ if eval "test \"`echo '${'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 842 "configure"
+#line 844 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -881,7 +883,7 @@ if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 885 "configure"
+#line 887 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
@@ -917,7 +919,7 @@ if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 921 "configure"
+#line 923 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
@@ -953,7 +955,7 @@ if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 957 "configure"
+#line 959 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
@@ -987,7 +989,7 @@ if eval "test \"`echo '${'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 991 "configure"
+#line 993 "configure"
#include "confdefs.h"
int main() { return 0; }
@@ -1072,7 +1074,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xa -Xc
do
CFLAGS="$ac_save_CFLAGS $ac_arg"
cat > conftest.$ac_ext <<EOF
-#line 1076 "configure"
+#line 1078 "configure"
#include "confdefs.h"
#if !defined(__STDC__) || __STDC__ != 1
choke me
@@ -1121,7 +1123,7 @@ if eval "test \"`echo '${'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1125 "configure"
+#line 1127 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -1155,7 +1157,7 @@ if eval "test \"`echo '${'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1159 "configure"
+#line 1161 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1186,7 +1188,7 @@ if eval "test \"`echo '${'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1190 "configure"
+#line 1192 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1225,7 +1227,7 @@ if eval "test \"`echo '${'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1229 "configure"
+#line 1231 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -1243,7 +1245,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1247 "configure"
+#line 1249 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -1270,7 +1272,7 @@ if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1274 "configure"
+#line 1276 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* Override any gcc2 internal prototype to avoid an error. */
@@ -1319,7 +1321,7 @@ if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1323 "configure"
+#line 1325 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* Override any gcc2 internal prototype to avoid an error. */
@@ -1368,7 +1370,7 @@ if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1372 "configure"
+#line 1374 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* Override any gcc2 internal prototype to avoid an error. */
@@ -1417,7 +1419,7 @@ if eval "test \"`echo '${'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1421 "configure"
+#line 1423 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() { return 0; }
@@ -1448,7 +1450,7 @@ if eval "test \"`echo '${'ac_cv_func_alloca'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1452 "configure"
+#line 1454 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1506,7 +1508,7 @@ if eval "test \"`echo '${'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1510 "configure"
+#line 1512 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1533,7 +1535,7 @@ if eval "test \"`echo '${'ac_cv_func__getb67'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1537 "configure"
+#line 1539 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* Override any gcc2 internal prototype to avoid an error. */
@@ -1576,7 +1578,7 @@ if eval "test \"`echo '${'ac_cv_func_GETB67'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1580 "configure"
+#line 1582 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* Override any gcc2 internal prototype to avoid an error. */
@@ -1619,7 +1621,7 @@ if eval "test \"`echo '${'ac_cv_func_getb67'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
-#line 1623 "configure"
+#line 1625 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* Override any gcc2 internal prototype to avoid an error. */
@@ -1673,7 +1675,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1677 "configure"
+#line 1679 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1836,6 +1838,7 @@ s%@PRODUCT@%$PRODUCT%g
s%@MAJOR_VERSION@%$MAJOR_VERSION%g
s%@MINOR_VERSION@%$MINOR_VERSION%g
s%@PATCH_LEVEL@%$PATCH_LEVEL%g
+s%@OLD_PATCH_LEVEL@%$OLD_PATCH_LEVEL%g
s%@VERSION@%$VERSION%g
s%@FULL_VERSION@%$FULL_VERSION%g
s%@YACC@%$YACC%g
@@ -2022,3 +2025,4 @@ chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
+date >stamp-h
diff --git a/configure.in b/configure.in
index bf54cc4..159d3be 100644
--- a/configure.in
+++ b/configure.in
@@ -5,7 +5,8 @@ AC_CONFIG_HEADER(config.h)
PRODUCT=mkid
MAJOR_VERSION=3
MINOR_VERSION=0
-PATCH_LEVEL=2
+PATCH_LEVEL=3
+OLD_PATCH_LEVEL=`expr $PATCH_LEVEL - 1`
VERSION=$MAJOR_VERSION.$MINOR_VERSION
FULL_VERSION=$VERSION.$PATCH_LEVEL
AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT")
@@ -18,6 +19,7 @@ AC_SUBST(PRODUCT)
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(PATCH_LEVEL)
+AC_SUBST(OLD_PATCH_LEVEL)
AC_SUBST(VERSION)
AC_SUBST(FULL_VERSION)
@@ -83,3 +85,4 @@ AC_SUBST(DEPEND)
AC_SUBST_FILE(DEPEND_FILE)
AC_OUTPUT(Makefile)
+date >stamp-h
diff --git a/lid.c b/lid.c
index bbd2fc8..010a37e 100644
--- a/lid.c
+++ b/lid.c
@@ -54,7 +54,7 @@ int find_plain (char const *arg, doit_t doit);
int find_anchor (char const *arg, doit_t doit);
int find_regexp (char const *arg, doit_t doit);
int find_number (char const *arg, doit_t doit);
-int find_non_unique (int, doit_t doit);
+int find_non_unique (unsigned int, doit_t doit);
int find_apropos (char const *arg, doit_t doit);
void parse_frequency_arg (char const *arg);
int frequency_wanted (char const *tok);
@@ -99,13 +99,12 @@ int crunch_on = CRUNCH_DEFAULT;
int file_name_regexp = 0;
int match_base = 0;
char id_dir[BUFSIZ];
-off_t anchor_offset;
int tree8_levels;
-int bits_vec_size;
+unsigned int bits_vec_size;
char PWD_name[BUFSIZ];
struct idhead idh;
struct idarg *id_args;
-int (*find_func) (char const *arg, doit_t doit);
+int (*find_func) (char const *, doit_t);
unsigned short frequency_low = 1;
unsigned short frequency_high = USHRT_MAX;
char *buf;
@@ -127,12 +126,12 @@ main (int argc, char **argv)
char const *id_file_name = IDFILE;
doit_t doit = look_id;
int force_merge = 0;
- int unique_limit = 0;
+ unsigned int unique_limit = 0;
int use_id_file_name = 1;
int use_pwd_file_name = 0;
int use_relative_file_name = 0;
char const *REL_file_name = NULL;
- int (*forced_find_func) (char const *arg, doit_t doit) = NULL;
+ int (*forced_find_func) (char const *, doit_t) = NULL;
program_name = basename ((argc--, *argv++));
@@ -556,7 +555,7 @@ int
skip_to_argv (char **argv)
{
char pattern[BUFSIZ];
- int count;
+ unsigned int count;
if (gets (pattern) == NULL)
return -1;
@@ -584,7 +583,7 @@ int
find_anchor (char const *arg, doit_t doit)
{
int count;
- int length;
+ unsigned int length;
if (find_token (++arg) == 0)
return 0;
@@ -693,7 +692,7 @@ find_number (char const *arg, doit_t doit)
/* Find identifiers that are non-unique within the first `count'
characters. */
int
-find_non_unique (int limit, doit_t doit)
+find_non_unique (unsigned int limit, doit_t doit)
{
char *old = buf;
char *new = buf2;
@@ -1190,15 +1189,15 @@ xtoi (char const *name)
}
unsigned char *
-tree8_to_bits (unsigned char *bits_vec, unsigned char const *hits_tree8)
+tree8_to_bits (unsigned char *bv_0, unsigned char const *hits_tree8)
{
- unsigned char* bv = bits_vec;
+ unsigned char* bv = bv_0;
tree8_to_bits_1 (&bv, &hits_tree8, tree8_levels);
- return bits_vec;
+ return bv_0;
}
void
-tree8_to_bits_1 (unsigned char **bits_vec, unsigned char const **hits_tree8, int level)
+tree8_to_bits_1 (unsigned char **bv, unsigned char const **hits_tree8, int level)
{
int hits = *(*hits_tree8)++;
@@ -1209,17 +1208,17 @@ tree8_to_bits_1 (unsigned char **bits_vec, unsigned char const **hits_tree8, int
for (bit = 1; bit & 0xff; bit <<= 1)
{
if (bit & hits)
- tree8_to_bits_1 (bits_vec, hits_tree8, level);
+ tree8_to_bits_1 (bv, hits_tree8, level);
else
- *bits_vec += incr;
+ *bv += incr;
}
}
else
- *(*bits_vec)++ |= hits;
+ *(*bv)++ |= hits;
}
char **
-bits_to_argv (unsigned char const *bits_vec)
+bits_to_argv (unsigned char const *bv)
{
int const reserved_argv_slots = 3;
static char **argv_0;
@@ -1236,14 +1235,14 @@ bits_to_argv (unsigned char const *bits_vec)
int hits;
int bit;
- while (*bits_vec == 0)
+ while (*bv == 0)
{
- bits_vec++;
+ bv++;
ida += 8;
if (ida >= end)
goto out;
}
- hits = *bits_vec++;
+ hits = *bv++;
for (bit = 1; bit & 0xff; bit <<= 1)
{
if (bit & hits)
@@ -1280,64 +1279,41 @@ tree8_to_argv (unsigned char const *hits_tree8)
#include <sys/ioctl.h>
#endif
-#if HAVE_TERMIOS_H || HAVE_TERMIO_H
-
#if HAVE_TERMIOS_H
+
#include <termios.h>
struct termios linemode;
struct termios charmode;
struct termios savemode;
+#define GET_TTY_MODES(modes) tcgetattr (0, (modes))
+#define SET_TTY_MODES(modes) tcsetattr(0, TCSANOW, (modes))
+
#else /* not HAVE_TERMIOS_H */
+
#if HAVE_TERMIO_H
#include <termio.h>
struct termio linemode;
struct termio charmode;
struct termio savemode;
-#endif /* HAVE_TERMIO_H */
-#endif /* not HAVE_TERMIOS_H */
+#define GET_TTY_MODES(modes) ioctl (0, TCGETA, (modes))
+#define SET_TTY_MODES(modes) ioctl (0, TCSETA, (modes))
-void
-savetty (void)
-{
- ioctl (0, TCGETA, &savemode);
- charmode = linemode = savemode;
-
- charmode.c_lflag &= ~(ECHO | ICANON | ISIG);
- charmode.c_cc[VMIN] = 1;
- charmode.c_cc[VTIME] = 0;
-
- linemode.c_lflag |= (ECHO | ICANON | ISIG);
- linemode.c_cc[VEOF] = 'd' & 037;
- linemode.c_cc[VEOL] = 0377;
-}
-
-void
-restoretty (void)
-{
- ioctl (0, TCSETA, &savemode);
-}
-
-void
-linetty (void)
-{
- ioctl (0, TCSETA, &linemode);
-}
-
-void
-chartty (void)
-{
- ioctl (0, TCSETA, &charmode);
-}
-
-#else /* not HAVE_TERMIOS_H || HAVE_TERMIO_H */
+#else /* not HAVE_TERMIO_H */
#if HAVE_SGTTYB_H
#include <sgttyb.h>
-
struct sgttyb linemode;
struct sgttyb charmode;
struct sgttyb savemode;
+#ifdef TIOCGETP
+#define GET_TTY_MODES(modes) ioctl (0, TIOCGETP, (modes))
+#define SET_TTY_MODES(modes) ioctl (0, TIOCSETP, (modes))
+#else /* not TIOCGETP */
+#define GET_TTY_MODES(modes) gtty (0, (modes))
+#define SET_TTY_MODES(modes) stty (0, (modes))
+#endif /* not TIOCGETP */
+
savetty()
{
#ifdef TIOCGETP
@@ -1354,32 +1330,47 @@ savetty()
linemode.sg_flags &= ~RAW;
}
-restoretty()
+#endif /* HAVE_SGTTYB_H */
+#endif /* not HAVE_TERMIO_H */
+#endif /* not HAVE_TERMIOS_H */
+
+#if HAVE_TERMIOS_H || HAVE_TERMIO_H
+
+void
+savetty (void)
{
-#ifdef TIOCSETP
- ioctl(0, TIOCSETP, &savemode);
-#else
- stty(0, &savemode);
-#endif
+ GET_TTY_MODES (&savemode);
+ charmode = linemode = savemode;
+
+ charmode.c_lflag &= ~(ECHO | ICANON | ISIG);
+ charmode.c_cc[VMIN] = 1;
+ charmode.c_cc[VTIME] = 0;
+
+ linemode.c_lflag |= (ECHO | ICANON | ISIG);
+ linemode.c_cc[VEOF] = 'd' & 037;
+ linemode.c_cc[VEOL] = 0377;
}
-linetty()
+#endif /* HAVE_TERMIOS_H || HAVE_TERMIO_H */
+
+#if HAVE_TERMIOS_H || HAVE_TERMIO_H || HAVE_SGTTYB_H
+
+void
+restoretty (void)
{
-#ifdef TIOCSETP
- ioctl(0, TIOCSETP, &linemode);
-#else
- stty(0, &linemode);
-#endif
+ SET_TTY_MODES (&savemode);
+}
+
+void
+linetty (void)
+{
+ SET_TTY_MODES (&linemode);
}
-chartty()
+void
+chartty (void)
{
-#ifdef TIOCSETP
- ioctl(0, TIOCSETP, &charmode);
-#else
- stty(0, &charmode);
-#endif
+ SET_TTY_MODES (&charmode);
}
-#endif /* HAVE_SGTTYB_H */
-#endif /* not HAVE_TERMIOS_H || HAVE_TERMIO_H */
+#endif /* HAVE_TERMIOS_H || HAVE_TERMIO_H || HAVE_SGTTYB_H */
diff --git a/misc.c b/misc.c
index 83544db..40a0da9 100644
--- a/misc.c
+++ b/misc.c
@@ -74,7 +74,7 @@ filerr (char const *syscall, char const *file_name)
}
int
-tree8_count_levels (int cardinality)
+tree8_count_levels (unsigned int cardinality)
{
int levels = 1;
cardinality--;
diff --git a/misc.h b/misc.h
index 8b556e6..9a3956f 100644
--- a/misc.h
+++ b/misc.h
@@ -23,7 +23,7 @@ char const *basename (char const *path);
char const *dirname (char const *path);
int fgets0 (char *buf0, int size, FILE *in_FILE);
void filerr (char const *syscall, char const *file_name);
-int tree8_count_levels (int cardinality);
+int tree8_count_levels (unsigned int cardinality);
int gets_past_00 (char *tok, FILE *input_FILE);
int skip_past_00 (FILE *input_FILE);
diff --git a/stamp-h.in b/stamp-h.in
index 7198698..3cf01ff 100644
--- a/stamp-h.in
+++ b/stamp-h.in
@@ -1 +1 @@
-Wed Feb 15 16:05:26 EST 1995
+Thu Feb 16 16:33:07 EST 1995