From f35570a03b92f9bf83897b70b57ac3f28e265082 Mon Sep 17 00:00:00 2001 From: skywalker Date: Mon, 7 Oct 2002 01:29:13 +0000 Subject: [PATCH] A few makefile dependancies fixed. Started work on upgrading rpm build scripts Fix makefiles for super build Exchange editline for readline in isql --- builds/posix/Makefile.in.boot.gpre | 6 +- builds/posix/Makefile.in.client.gbak | 5 +- builds/posix/Makefile.in.client.gdef | 12 +- builds/posix/Makefile.in.client.gfix | 6 +- builds/posix/Makefile.in.client.gpre | 6 +- builds/posix/Makefile.in.client.isql | 6 +- builds/posix/Makefile.in.client.util | 6 +- builds/posix/Makefile.in.embed.gbak | 6 +- builds/posix/Makefile.in.embed.gdef | 13 +- builds/posix/Makefile.in.embed.gfix | 6 +- builds/posix/Makefile.in.embed.gpre | 6 +- builds/posix/Makefile.in.embed.isql | 6 +- builds/posix/Makefile.in.embed.lockmgr | 6 +- builds/posix/Makefile.in.embed.qli | 17 +- builds/posix/Makefile.in.embed.util | 6 +- builds/posix/Makefile.in.extlib | 4 +- builds/posix/Makefile.in.fbserver | 7 +- builds/posix/Makefile.in.fbutil | 20 +- builds/posix/Makefile.in.firebird | 69 +- builds/posix/Makefile.in.inet_server | 6 +- builds/posix/Makefile.in.install | 96 +- builds/posix/Makefile.in.intl | 6 +- builds/posix/Makefile.in.libfbclient | 52 +- builds/posix/Makefile.in.libfbcommon | 10 +- builds/posix/Makefile.in.libfbembed | 35 +- builds/posix/Makefile.in.libfbserver | 38 +- builds/posix/Makefile.in.libfbstatic | 24 +- builds/posix/Makefile.in.msgs | 7 +- builds/posix/Makefile.in.refDatabases | 4 +- builds/posix/Makefile.in.static.gbak | 6 +- builds/posix/Makefile.in.static.gpre | 9 +- builds/posix/Makefile.in.static.isql | 6 +- builds/posix/Makefile.in.v5_examples | 5 +- builds/posix/make.defaults | 3 +- builds/posix/make.rules | 6 +- builds/posix/make.shared.targets | 108 ++ builds/posix/make.shared.variables | 10 +- configure.in | 18 +- src/dsql/parse.cpp | 684 +++++++++++ src/extern/editline/MANIFEST | 15 + src/extern/editline/Make.os9 | 19 + src/extern/editline/Makefile | 77 ++ src/extern/editline/README | 48 + src/extern/editline/complete.c | 219 ++++ src/extern/editline/editline.3 | 178 +++ src/extern/editline/editline.c | 1531 ++++++++++++++++++++++++ src/extern/editline/editline.h | 79 ++ src/extern/editline/os9.h | 10 + src/extern/editline/sysos9.c | 46 + src/extern/editline/sysunix.c | 132 ++ src/extern/editline/testit.c | 64 + src/extern/editline/unix.h | 22 + src/include/editline.h | 56 + src/include/gen/autoconfig_msvc.h | 1 + src/isql/isql.epp | 11 +- src/make.new/config/config.h.in | 3 +- src/utilities/srvrmgr.cpp | 3 +- 57 files changed, 3522 insertions(+), 338 deletions(-) create mode 100644 builds/posix/make.shared.targets create mode 100644 src/extern/editline/MANIFEST create mode 100644 src/extern/editline/Make.os9 create mode 100644 src/extern/editline/Makefile create mode 100644 src/extern/editline/README create mode 100644 src/extern/editline/complete.c create mode 100644 src/extern/editline/editline.3 create mode 100644 src/extern/editline/editline.c create mode 100644 src/extern/editline/editline.h create mode 100644 src/extern/editline/os9.h create mode 100644 src/extern/editline/sysos9.c create mode 100644 src/extern/editline/sysunix.c create mode 100644 src/extern/editline/testit.c create mode 100644 src/extern/editline/unix.h create mode 100644 src/include/editline.h diff --git a/builds/posix/Makefile.in.boot.gpre b/builds/posix/Makefile.in.boot.gpre index fbdaba132c..23ac5198f1 100644 --- a/builds/posix/Makefile.in.boot.gpre +++ b/builds/posix/Makefile.in.boot.gpre @@ -27,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.boot.gpre,v 1.4 2002-09-24 13:01:11 eku Exp $ +# $Id: Makefile.in.boot.gpre,v 1.5 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=boot.gpre @@ -75,6 +75,8 @@ $(GPRE_BOOT): $(GPREBOOT_Objects) $(LIB)/libfbcommon.a $(LN) $(@F) $(GPRE_CURRENT) -FORCE: + +include $(ROOT)/gen/make.shared.targets + -include $(Dependencies) diff --git a/builds/posix/Makefile.in.client.gbak b/builds/posix/Makefile.in.client.gbak index a6ab9d42b2..712d74d178 100644 --- a/builds/posix/Makefile.in.client.gbak +++ b/builds/posix/Makefile.in.client.gbak @@ -27,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.client.gbak,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.client.gbak,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. @@ -72,6 +72,7 @@ $(GSPLIT): $(GSPLIT_Objects) $(LIBFBCLIENT_SO) $(LD) $(LINK_OPTS) $(GSPLIT_Objects) -o $@ -L$(LIB) -lfbclient $(LINK_LIBS) -FORCE: + +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.client.gdef b/builds/posix/Makefile.in.client.gdef index dce0aeae12..b08b8b0bd2 100644 --- a/builds/posix/Makefile.in.client.gdef +++ b/builds/posix/Makefile.in.client.gdef @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.client.gdef,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.client.gdef,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=client.gdef @@ -68,13 +66,7 @@ $(BIN)/gdef: $(GDEF_Objects) $(LIBFBCLIENT_SO) +include $(ROOT)/gen/make.shared.targets -$(SRC)/exe.cpp $(SRC)/extract.epp: yachts.lnk - -yachts.lnk: - ln -fs $(SRC_ROOT)/refDatabases/empty.gdb yachts.lnk - - -FORCE: -include $(Dependencies) diff --git a/builds/posix/Makefile.in.client.gfix b/builds/posix/Makefile.in.client.gfix index 9288cadafb..69b01a35bb 100644 --- a/builds/posix/Makefile.in.client.gfix +++ b/builds/posix/Makefile.in.client.gfix @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.client.gfix,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.client.gfix,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=client.gfix @@ -62,6 +60,6 @@ $(BIN)/gfix: $(GFIX_Objects) $(LIB)/libfbclient.so $(LD) $(LINK_OPTS) $(GFIX_Objects) -o $@ -L$(LIB) -lfbclient $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.client.gpre b/builds/posix/Makefile.in.client.gpre index 52664b549e..eb3fb832c8 100644 --- a/builds/posix/Makefile.in.client.gpre +++ b/builds/posix/Makefile.in.client.gpre @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.client.gpre,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.client.gpre,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=client.gpre @@ -65,6 +63,6 @@ $(BIN)/gpre: $(GPRE_Objects) $(LIB)/libfbclient.so $(LD) $(LINK_OPTS) $(GPRE_Objects) -o $@ -L$(LIB) -lfbclient $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.client.isql b/builds/posix/Makefile.in.client.isql index c0f3db5ad7..dec597854c 100644 --- a/builds/posix/Makefile.in.client.isql +++ b/builds/posix/Makefile.in.client.isql @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.client.isql,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.client.isql,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=client.isql @@ -65,6 +63,6 @@ $(ISQL): $(ISQL_Objects) $(LIBFBCLIENT_SO) $(LD) $(LINK_OPTS) $(ISQL_Objects) -o $@ -L$(LIB) -lfbclient $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.client.util b/builds/posix/Makefile.in.client.util index c23dc48ce4..8ad312b71a 100644 --- a/builds/posix/Makefile.in.client.util +++ b/builds/posix/Makefile.in.client.util @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.client.util,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.client.util,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=client.util @@ -142,6 +140,6 @@ rebuild: $(GDS_REBUILD) $(GDS_REBUILD): $(REBUILD_Objects) $(LIBFBCLIENT_SO) $(LD) $(LINK_OPTS) $(REBUILD_Objects) -o $@ -L$(LIB) -lfbclient $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.embed.gbak b/builds/posix/Makefile.in.embed.gbak index 810ccf9ac8..ab5b0c493c 100644 --- a/builds/posix/Makefile.in.embed.gbak +++ b/builds/posix/Makefile.in.embed.gbak @@ -1,4 +1,3 @@ - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -28,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.embed.gbak,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.embed.gbak,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=embed.gbak @@ -72,7 +71,6 @@ gsplit : $(GSPLIT) $(GSPLIT): $(GSPLIT_Objects) $(LIBFBEMBED_SO) $(LD) $(LINK_OPTS) $(GSPLIT_Objects) -o $@ -L$(LIB) -lfbembed $(LINK_LIBS) - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.embed.gdef b/builds/posix/Makefile.in.embed.gdef index 69f7538c8e..e68dd1ef9c 100644 --- a/builds/posix/Makefile.in.embed.gdef +++ b/builds/posix/Makefile.in.embed.gdef @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.embed.gdef,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.embed.gdef,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=embed.gdef @@ -67,13 +65,6 @@ $(BIN)/gdef: $(GDEF_Objects) $(LIBFBEMBED_SO) - -$(SRC)/exe.cpp $(SRC)/extract.epp: yachts.lnk - -yachts.lnk: - ln -fs $(SRC_ROOT)/refDatabases/empty.gdb yachts.lnk - - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.embed.gfix b/builds/posix/Makefile.in.embed.gfix index a4fa6c167a..430529020b 100644 --- a/builds/posix/Makefile.in.embed.gfix +++ b/builds/posix/Makefile.in.embed.gfix @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.embed.gfix,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.embed.gfix,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=embed.gfix @@ -62,6 +60,6 @@ $(BIN)/gfix: $(GFIX_Objects) $(LIB)/libfbembed.so $(LD) $(LINK_OPTS) $(GFIX_Objects) -o $@ -L$(LIB) -lfbembed $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.embed.gpre b/builds/posix/Makefile.in.embed.gpre index e090ffdddf..3a44c66655 100644 --- a/builds/posix/Makefile.in.embed.gpre +++ b/builds/posix/Makefile.in.embed.gpre @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.embed.gpre,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.embed.gpre,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=embed.gpre @@ -63,6 +61,6 @@ $(BIN)/gpre: $(GPRE_Objects) $(LIB)/libfbembed.so $(LD) $(LINK_OPTS) $(GPRE_Objects) -o $@ -L$(LIB) -lfbembed $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.embed.isql b/builds/posix/Makefile.in.embed.isql index 8c67467b51..89a287ec4e 100644 --- a/builds/posix/Makefile.in.embed.isql +++ b/builds/posix/Makefile.in.embed.isql @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.embed.isql,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.embed.isql,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=embed.isql @@ -64,6 +62,6 @@ $(ISQL): $(ISQL_Objects) $(LIBFBEMBED_SO) $(LD) $(LINK_OPTS) $(ISQL_Objects) -o $@ -L$(LIB) -lfbembed $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.embed.lockmgr b/builds/posix/Makefile.in.embed.lockmgr index 17cd0b92db..1a2c5fc752 100644 --- a/builds/posix/Makefile.in.embed.lockmgr +++ b/builds/posix/Makefile.in.embed.lockmgr @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.embed.lockmgr,v 1.2 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.embed.lockmgr,v 1.3 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=embed.lockmgr @@ -62,6 +60,6 @@ $(BIN)/gds_lock_mgr: $(LOCKMGR_Objects) $(LIBFBCOMMON_A) $(LIBFBSTATIC_A) $(CXX) $(LINK_OPTS) $(LOCKMGR_Objects) -o $@ -L $(LIB) -lfbstatic -lfbcommon $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.embed.qli b/builds/posix/Makefile.in.embed.qli index 850918682e..6798eba8b1 100644 --- a/builds/posix/Makefile.in.embed.qli +++ b/builds/posix/Makefile.in.embed.qli @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.embed.qli,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.embed.qli,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=embed.qli @@ -73,19 +71,8 @@ $(QLI): $(QLI_Objects) $(LIBFBEMBED_SO) # need to be rebuilt here. -# These need to change to $(GEN_SRC) at some stage -$(SRC)/meta.cpp $(SRC)/proc.cpp $(SRC)/show.cpp: yachts.lnk -$(SRC)/help.cpp: help.gdb - - -yachts.lnk: - ln -fs $(SRC_ROOT)/refDatabases/metadata.gdb yachts.lnk - -help.gdb: - ln -fs $(SRC_ROOT)/refDatabases/help.gdb help.gdb - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.embed.util b/builds/posix/Makefile.in.embed.util index 8923110bbe..5fab999c3d 100644 --- a/builds/posix/Makefile.in.embed.util +++ b/builds/posix/Makefile.in.embed.util @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.embed.util,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.embed.util,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=embed.util @@ -151,6 +149,6 @@ rebuild: $(GDS_REBUILD) $(GDS_REBUILD): $(REBUILD_Objects) $(LIBFBEMBED_SO) $(LD) $(LINK_OPTS) $(REBUILD_Objects) -o $@ -L$(LIB) -lfbembed $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.extlib b/builds/posix/Makefile.in.extlib index ac78e9413a..2fc57dc13d 100644 --- a/builds/posix/Makefile.in.extlib +++ b/builds/posix/Makefile.in.extlib @@ -27,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.extlib,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.extlib,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=extlib @@ -113,6 +113,6 @@ $(LIB)/ib_util.so: $(UTIL_Objects) # ar crv $@ $% -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.fbserver b/builds/posix/Makefile.in.fbserver index 7fac75debd..663d3333d0 100644 --- a/builds/posix/Makefile.in.fbserver +++ b/builds/posix/Makefile.in.fbserver @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.fbserver,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.fbserver,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=fbserver @@ -72,7 +70,6 @@ AllObjects = $(SERVER_Objects) Dependencies = $(AllObjects:.o=.d) - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.fbutil b/builds/posix/Makefile.in.fbutil index 6aa8ed314d..3fdb1437f8 100755 --- a/builds/posix/Makefile.in.fbutil +++ b/builds/posix/Makefile.in.fbutil @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.fbutil,v 1.3 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.fbutil,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=../.. @@ -65,23 +63,9 @@ libtestx.so.2 : $(FBUTIL_Objects) # g++ -shared -o $@ $^ $(STATICLINK_LIBS) $(LIB_LINK) $(LIB_LINK_OPTIONS) -o $@ $^ -# The following was just for testing - -testx: main.o -# g++ -v -shared -o $@ $^ -L. -ltestx $(STATICLINK_LIBS) - g++ -v -o $@ $^ -L. -ltestx.so.2 - -testx2: - -rm libtestx.so testx - $(MAKE) libtestx.so.2 - $(MAKE) testx -clean: - -rm $(AllObjects) - -rm $(Dependancies) - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependancies) diff --git a/builds/posix/Makefile.in.firebird b/builds/posix/Makefile.in.firebird index 7e002639d1..05051481e1 100644 --- a/builds/posix/Makefile.in.firebird +++ b/builds/posix/Makefile.in.firebird @@ -1,4 +1,3 @@ - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -28,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.firebird,v 1.9 2002-10-02 12:43:15 eku Exp $ +# $Id: Makefile.in.firebird,v 1.10 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. @@ -135,15 +134,17 @@ export LD_LIBRARY_PATH .PHONY: firebird_super firebird_classic -# The main targets, firebird_embedded and firebird_server +# The main targets are firebird_embedded or firebird_server +# or their older names _classic or _super. +# The following target is expanded by autoconf process to +# either _classic or _super. -firebird : firebird_embedded -firebird_embedded: firebird_basic classic_targets -firebird_server: firebird_basic super_targets -# To help those remember to 'older' forms -firebird_classic: firebird_embedded -firebird_super: firebird_server +firebird : firebird_@FIREBIRD_ARCH_TYPE@ + +firebird_classic firebird_embedded: firebird_basic classic_targets +firebird_super firebird_server: firebird_basic super_targets + @@ -154,7 +155,7 @@ firebird_super: firebird_server # some complications particularly for super in needing to start the server # that you are currently building. MOD 28-July-2002 -firebird_basic: firebird_boot basic_targets +firebird_basic: external_libraries firebird_boot basic_targets firebird_boot: updateBuildNum boot_phase1 boot_phase2 @@ -167,7 +168,7 @@ firebird_boot: updateBuildNum boot_phase1 boot_phase2 # writeBuildNum.sh script is autoupdated by CVS checkins. # -.PHONY: updateBuildNum +.PHONY: updateBuildNum external_libraries updateBuildNum : jrd/build_no.h @@ -175,6 +176,18 @@ jrd/build_no.h : misc/writeBuildNum.sh (cd ..; ./src/misc/writeBuildNum.sh rebuildHeader) + +# +# Libraries that come from outside the project but are built +# as part of the project are included here. Currently editline +# is the only external library we have included. +# +external_libraries: $(LIBEDIT_A) + +$(LIBEDIT_A): + $(MAKE) -C $(SRC_ROOT)/extern/editline + + #--------------------------------------------------------------------------- # Phase1: make a gpre_static from scratch so we can parse .e and .epp files # to build the rest of the system. It goes in two bits make a real simple @@ -200,6 +213,7 @@ $(GPRE_STATIC): boot_phase1_build: libfbcommon gpre_boot libfbstatic gpre_static @MANAGER_PROCESS_TARGET@ + libfbcommon: $(MAKE) -f $(MAKE_ROOT)/Makefile.libfbcommon $@ @@ -348,7 +362,7 @@ embed_qli: .PHONY: libfbclient client_gfix client_gbak client_isql client_gpre client_util super_targets: libfbserver fbserver libfbclient client_gfix client_gbak \ - client_isql client_gpre client_util client_gdef + client_isql client_gpre client_util # client_gdef libfbserver: $(MAKE) -f $(MAKE_ROOT)/Makefile.libfbserver $@ @@ -369,11 +383,14 @@ client_gpre: $(MAKE) -f $(MAKE_ROOT)/Makefile.client.gpre client_isql: - $(MAKE) -f $(MAKE_ROOT)/Makefile.client.gbak + $(MAKE) -f $(MAKE_ROOT)/Makefile.client.isql client_util: $(MAKE) -f $(MAKE_ROOT)/Makefile.client.util +# Not sure we need this target in super - problems with WAL includes +# MOD 04-Oct-2002 + client_gdef: $(MAKE) -f $(MAKE_ROOT)/Makefile.client.gdef @@ -512,11 +529,11 @@ $(BIN)/% :: $(SRC_ROOT)/install/misc/% .PHONY: install install: - $(MAKE) -C install $@ + $(MAKE) -f $(MAKE_ROOT)/Makefile.install $@ packages: - $(MAKE) -C install $@ + $(MAKE) -f $(MAKE_ROOT)/Makefile.install $@ installclassic: @@ -529,29 +546,21 @@ dist: #___________________________________________________________________________ -# This one needs some more work. +# -clean: clean_objs clean_libs clean_exes clean_dbs clean_dependancies clean_build - -clean_objs: - -echo $(GDSLIB_Objects) | xargs rm -f - -echo $(GDSLIB_SharedObjects) | xargs rm -f +clean: clean_objects clean_dependancies clean_build - -clean_libs: - -rm $(GDSLIB_LA) - -rm $(JRD_BOOT) - -clean_exes: - -rm -f $(BIN)/* -# -rm $(Executables) - +# Not sure if this one is still needed MOD 7-Oct-2002 clean_dbs: -rm -f refDatabases/*\.gdb +clean_objects: + rm -f `find $(GEN_ROOT)/ -type f -name '*.o' -print` + + # Clear out dependancies files created by the gcc compiler # since when .o and other files are deleted the dependant # targets need to be recalculated diff --git a/builds/posix/Makefile.in.inet_server b/builds/posix/Makefile.in.inet_server index e183e34526..a244265388 100644 --- a/builds/posix/Makefile.in.inet_server +++ b/builds/posix/Makefile.in.inet_server @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.inet_server,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.inet_server,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=inet_server @@ -59,7 +57,7 @@ $(BIN)/fb_inet_server: $(SERVER_Objects) $(LIBFBEMBED_SO) # $(CHMOD_S7) $@ +include $(ROOT)/gen/make.shared.targets -FORCE: -include $(Dependencies) diff --git a/builds/posix/Makefile.in.install b/builds/posix/Makefile.in.install index 7cd17d7958..74196fb535 100644 --- a/builds/posix/Makefile.in.install +++ b/builds/posix/Makefile.in.install @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,9 +27,9 @@ # Contributor(s): # # -# $Id: Makefile.in.install,v 1.3 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.install,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # -ROOT=../.. +ROOT=.. @@ -70,34 +68,47 @@ FirebirdBuildPrefix=$(GEN_ROOT) #export FirebirdInstallPrefix #export PackageVersion +BuildVersion=@FIREBIRD_VERSION@.@FB_BUILD_NUM@ +PackageVersion=@FIREBIRD_PACKAGE_VERSION@ + +Version=$(BuildVersion)-$(PackageVersion) # This means something like: FirebirdCS-2.0.0-1.i386.tar.gz -TarFile=Firebird$(ArchPrefix)-$(FirebirdVersion)-$(PackageVersion).$(CpuType).tar.gz +TarFile=Firebird$(ArchPrefix)-$(Version).$(CpuType).tar.gz +RPMFile=Firebird$(ArchPrefix)-$(Version).$(CpuType).rpm + + +# Determine where the packages are built. Each distribution builds them in +# their own spot. +# This should be moved to configure.in file +RedhatPackageDir=/usr/src/redhat/RPMS/$(CpuType) +MandrakePackageDir=/usr/src/RPM/RPMS/$(CpuType) +SuSEPackageDir=/usr/src/packages/RPMS/$(CpuType) + +PackageDir:=$(shell if [ -d $(RedhatPackageDir) ]; then echo $(RedhatPackageDir); \ + elif [ -d $(MandrakePackageDir) ]; then echo $(MandrakePackageDir); \ + elif [ -d $(SuSEPackageDir) ]; then echo $(SuSEPackageDir); \ + fi) + + + PkgSrcDir=$(InstallRoot)/$(ArchType) +RPMSrcDir=$(SRC)/install/@FIREBIRD_ARCH_TYPE@/ +ScriptDir=$(GEN_ROOT)/install/scripts/ -LastInstallFlg=.lastinstallflg +TarInstallDir=$(GEN_ROOT)/install + + +.PHONY: install tarfile rpmfile dist packages -install: runinstall dist : packages - -runinstall: $(LastInstallFlg) - - -$(LastInstallFlg) : $(BIN)/gsec - (cd $(GEN_ROOT)/install; ./install.sh) -# (cd $(ROOT); sh $(InstallRoot)/classic/CSTarInstall.sh) -# touch $(LastInstallFlg) - - - - - packages: tarfile +#packages: tarfile rpmfile tarfile: $(TarFile) @@ -105,9 +116,48 @@ $(TarFile) : buildInstallDir (cd $(GEN_ROOT); tar -czf $(TarFile) install) -TarInstallDir=$(GEN_ROOT)/install - buildInstallDir: -# (cd $(BuildRoot); tar -czf - interbase ) | cat > $(CSTarInstallDir)/interbase.tar.gz (cd $(GEN_ROOT); tar -czf install/firebird.tar.gz firebird) + +install: + (cd $(GEN_ROOT)/install; ./install.sh) + +rpmfile: $(RPMFile) + +$(RPMFile) : $(GEN_ROOT)/rpmscript + rpm -bb $(GEN_ROOT)/rpmscript +# rpm -bb --buildroot `pwd`/buildroot $(GEN_ROOT)/rpmscript + cp $(PackageDir)/$(RPMFile) . + + +.PHONY: $(GEN_ROOT)/rpmscript + +$(GEN_ROOT)/rpmscript : + echo $@ + cat $(RPMSrcDir)/rpmheader.txt.in | sed 's/^Version:.*/Version: $(BuildVersion)/' \ + | sed 's/Release:.*/Release: $(PackageVersion)/' > $@ + echo "" >> $@ + echo "%prep" >> $@ +# cat $(ClassicSrcDir)/prepinstall.sh >> $@ + echo "" >> $@ + echo "%build" >> $@ +# cat $(ScriptDir)/buildinstall.sh >> $@ + echo "" >> $@ + echo "%install" >> $@ +# cat $(ScriptDir)/install.sh >> $@ + echo "" >> $@ + echo "%files" >> $@ + cat $(RPMSrcDir)/rpmfiles.txt.in >> $@ + echo "" >> $@ + echo "%pre" >> $@ + cat $(ScriptDir)/preinstall.sh >> $@ + echo "" >> $@ + echo "%post" >> $@ + cat $(ScriptDir)/postinstall.sh >> $@ + echo "" >> $@ + echo "%preun" >> $@ + cat $(ScriptDir)/preuninstall.sh >> $@ + echo "" >> $@ + echo "%postun" >> $@ + cat $(ScriptDir)/postuninstall.sh >> $@ diff --git a/builds/posix/Makefile.in.intl b/builds/posix/Makefile.in.intl index faea7e1fae..2141987620 100644 --- a/builds/posix/Makefile.in.intl +++ b/builds/posix/Makefile.in.intl @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.intl,v 1.4 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.intl,v 1.5 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=intl @@ -87,6 +85,6 @@ $(LIBFBINTL_SO): $(INTL_Objects) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.libfbclient b/builds/posix/Makefile.in.libfbclient index 53bf162f96..ecfa2d068b 100644 --- a/builds/posix/Makefile.in.libfbclient +++ b/builds/posix/Makefile.in.libfbclient @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.libfbclient,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.libfbclient,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=libfbclient @@ -67,6 +65,14 @@ REMOTE_ClientSources = $(addprefix remote/, $(REMOTE_ClientFiles)) REMOTE_ClientObjects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(REMOTE_ClientSources)))) +GPRELIB_ClientSources = $(addprefix gpre/, $(GPRELIB_ClientFiles)) +GPRELIB_ClientObjects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GPRELIB_ClientSources)))) + + +WAL_ClientSources = $(addprefix wal/, $(WAL_ClientFiles)) +WAL_ClientObjects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(WAL_ClientSources)))) + + SECURITY_ClientSources = $(addprefix utilities/, $(SECURITY_ClientFiles)) SECURITY_ClientObjects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(SECURITY_ClientSources)))) @@ -81,10 +87,15 @@ FBMEMORY_ClientSources = $(addprefix common/memory/, $(FBMEMORY_ClientFiles)) FBMEMORY_ClientObjects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBMEMORY_ClientSources)))) -FBCLIENT_Objects = $(JRD_ClientObjects) $(DSQL_ClientObjects) \ - $(REMOTE_ClientObjects) $(SECURITY_ClientObjects) \ +FBCLIENT_Objects = $(JRD_ClientObjects) \ + $(DSQL_ClientObjects) \ + $(REMOTE_ClientObjects) \ + $(GPRELIB_ClientObjects) \ + $(WAL_ClientObjects) \ + $(SECURITY_ClientObjects) \ $(FBUTIL_ClientObjects) \ - $(FBCOMMON_ClientObjects) $(FBMEMORY_ClientObjects) + $(FBCOMMON_ClientObjects)\ + $(FBMEMORY_ClientObjects) .PHONY: libfbclient @@ -99,38 +110,11 @@ $(LIBFBCLIENT_SO): $(FBCLIENT_Objects) -$(LN) $(notdir $(LIBFBCLIENT_SOBASENAME)) $(LIBFBCLIENT_SONAME) -# This is the one where dyn_def.epp produced dyn_def.cpp and then the sed -# script is run to remove a component of it. This is pretty ugly, and even -# if we have to live with it, the makefile should be changed to make the -# dependencies clearer. - -$(SRC)/dyn_def.cpp : $(SRC)/dyn_def.epp $(SRC)/dyn_def.sed - $(GPRE_BOOT) $(GPRE_FLAGS) $< $(GEN_SRC)/dyn_deffoo.cpp - sed -f $(SRC)/dyn_def.sed $(GEN_SRC)/dyn_deffoo.cpp > $@ - -# This was the old dependancies. -#$(BIN)/dyn_def.o: $(SRC)/dyn_def.cpp $(SRC)/dyn_def.sed -# sed -f dyn_def.sed $< > dyn_deffoo.cpp -# $(CXX) -c $(CFLAGS) $(CXX_INCLUDE_DIRS) $(VERSION_FLAG) dyn_deffoo.cpp -# $(MV) dyn_deffoo.o dyn_def.bin -# -$(RM) dyn_deffoo.cpp dyn_deffoo.o - - - -buildb: isc4.gdb yachts.lnk - -isc4.gdb : $(ISC_GDB) - -ln -sf $(ISC_GDB) $@ - -yachts.lnk: - ln -fs $(SRC_ROOT)/refDatabases/empty.gdb yachts.lnk - AllObjects = $(FBCLIENT_Objects) - Dependencies = $(AllObjects:.o=.d) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.libfbcommon b/builds/posix/Makefile.in.libfbcommon index a962d9f7b3..c657f76c6c 100644 --- a/builds/posix/Makefile.in.libfbcommon +++ b/builds/posix/Makefile.in.libfbcommon @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.libfbcommon,v 1.2 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.libfbcommon,v 1.3 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=libfbcommon @@ -66,11 +64,7 @@ $(LIB)/libfbcommon.a: $(LIBFBCOMMON_Objects) $(CHMOD_6) $@ -clean: - -rm $(AllObjects) - -rm $(Dependancies) - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependancies) diff --git a/builds/posix/Makefile.in.libfbembed b/builds/posix/Makefile.in.libfbembed index 37368791d7..53a92a6113 100644 --- a/builds/posix/Makefile.in.libfbembed +++ b/builds/posix/Makefile.in.libfbembed @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.libfbembed,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.libfbembed,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=libfbembed @@ -65,35 +63,6 @@ $(LIBFBEMBED_SO): $(LIBFBEMBED_Objects) -$(LN) $(@F) $(LIBFBEMBED_SOBASENAME) -$(LN) $(notdir $(LIBFBEMBED_SOBASENAME)) $(LIBFBEMBED_SONAME) - -# This is the one where dyn_def.epp produced dyn_def.cpp and then the sed -# script is run to remove a component of it. This is pretty ugly, and even -# if we have to live with it, the makefile should be changed to make the -# dependencies clearer. - -$(SRC)/dyn_def.cpp : $(SRC)/dyn_def.epp $(SRC)/dyn_def.sed - $(GPRE_BOOT) $(GPRE_FLAGS) $< $(GEN_SRC)/dyn_deffoo.cpp - sed -f $(SRC)/dyn_def.sed $(GEN_SRC)/dyn_deffoo.cpp > $@ - -# This was the old dependancies. -#$(BIN)/dyn_def.o: $(SRC)/dyn_def.cpp $(SRC)/dyn_def.sed -# sed -f dyn_def.sed $< > dyn_deffoo.cpp -# $(CXX) -c $(CFLAGS) $(CXX_INCLUDE_DIRS) $(VERSION_FLAG) dyn_deffoo.cpp -# $(MV) dyn_deffoo.o dyn_def.bin -# -$(RM) dyn_deffoo.cpp dyn_deffoo.o - - - -buildb: isc4.gdb yachts.lnk - -isc4.gdb : $(ISC_GDB) - -ln -sf $(ISC_GDB) $@ - -yachts.lnk: - ln -fs $(SRC_ROOT)/refDatabases/empty.gdb yachts.lnk - - - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.libfbserver b/builds/posix/Makefile.in.libfbserver index 041dc5bfbd..52389fa6d9 100644 --- a/builds/posix/Makefile.in.libfbserver +++ b/builds/posix/Makefile.in.libfbserver @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.libfbserver,v 1.2 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.libfbserver,v 1.3 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=libfbserver @@ -78,39 +76,9 @@ $(LIB)/libfbserver.a: $(LIBFBSERVER_Objects) $(CHMOD_6) $@ - -# This is the one where dyn_def.epp produced dyn_def.cpp and then the sed -# script is run to remove a component of it. This is pretty ugly, and even -# if we have to live with it, the makefile should be changed to make the -# dependencies clearer. - -$(SRC)/dyn_def.cpp : $(SRC)/dyn_def.epp $(SRC)/dyn_def.sed - $(GPRE_BOOT) $(GPRE_FLAGS) $< $(GEN_SRC)/dyn_deffoo.cpp - sed -f $(SRC)/dyn_def.sed $(GEN_SRC)/dyn_deffoo.cpp > $@ - -# This was the old dependancies. -#$(BIN)/dyn_def.o: $(SRC)/dyn_def.cpp $(SRC)/dyn_def.sed -# sed -f dyn_def.sed $< > dyn_deffoo.cpp -# $(CXX) -c $(CFLAGS) $(CXX_INCLUDE_DIRS) $(VERSION_FLAG) dyn_deffoo.cpp -# $(MV) dyn_deffoo.o dyn_def.bin -# -$(RM) dyn_deffoo.cpp dyn_deffoo.o - - - -buildb: isc4.gdb yachts.lnk - -isc4.gdb : $(ISC_GDB) - -ln -sf $(ISC_GDB) $@ - -yachts.lnk: - ln -fs $(SRC_ROOT)/refDatabases/empty.gdb yachts.lnk - - -AllObjects = $(GDSLIB_Objects) - +AllObjects = $(LIBFBSERVER_Objects) Dependencies = $(AllObjects:.o=.d) - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.libfbstatic b/builds/posix/Makefile.in.libfbstatic index a55d573e7a..d94d27a3c1 100644 --- a/builds/posix/Makefile.in.libfbstatic +++ b/builds/posix/Makefile.in.libfbstatic @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.libfbstatic,v 1.3 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.libfbstatic,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=libfbstatic @@ -44,11 +42,11 @@ include $(ROOT)/gen/make.shared.variables AllObjects= $(LIBFBSTATIC_Objects) - Dependancies=$(AllObjects:.o=.d) + .PHONY: libfbstatic @@ -65,22 +63,6 @@ $(LIB)/libfbstatic.a: $(LIBFBSTATIC_Objects) $(CHMOD_6) $@ -# This is the one where dyn_def.epp produced dyn_def.cpp and then the sed -# script is run to remove a component of it. This is pretty ugly, and even -# if we have to live with it, the makefile should be changed to make the -# dependencies clearer. MOD July-2001 - -$(SRC)/jrd/dyn_def.cpp : $(SRC)/jrd/dyn_def.epp $(SRC)/jrd/dyn_def.sed - $(GPRE_BOOT) $(JRD_GPRE_FLAGS) $< $(GEN_SRC)/jrd/dyn_deffoo.cpp - sed -f $(SRC)/jrd/dyn_def.sed $(GEN_SRC)/jrd/dyn_deffoo.cpp > $@ - - - -clean: - -rm $(AllObjects) - -rm $(Dependancies) - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependancies) - diff --git a/builds/posix/Makefile.in.msgs b/builds/posix/Makefile.in.msgs index 213312b7aa..0da7801b24 100644 --- a/builds/posix/Makefile.in.msgs +++ b/builds/posix/Makefile.in.msgs @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.msgs,v 1.5 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.msgs,v 1.6 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=msgs @@ -179,7 +177,6 @@ $(ja_JP_MSG) : $(BUILD_FILE) indicator.msg $(BIN)/build_file -d $(MSGSDIR)master_msg_db -l ja_JP.EUC -f $@ $(CHMOD_6) $@ - -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.refDatabases b/builds/posix/Makefile.in.refDatabases index 71af4ae75d..fb8e857353 100644 --- a/builds/posix/Makefile.in.refDatabases +++ b/builds/posix/Makefile.in.refDatabases @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.refDatabases,v 1.5 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.refDatabases,v 1.6 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=refDatabases diff --git a/builds/posix/Makefile.in.static.gbak b/builds/posix/Makefile.in.static.gbak index 42fc1bfea9..60121e06f1 100644 --- a/builds/posix/Makefile.in.static.gbak +++ b/builds/posix/Makefile.in.static.gbak @@ -1,4 +1,3 @@ - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -28,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.static.gbak,v 1.2 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.static.gbak,v 1.3 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=static.gbak @@ -64,8 +63,7 @@ $(BIN)/gbak_static : $(GBAKSTATIC_Objects) $(LIBFBCOMMON_A) $(LIBBSTATIC_A) # Darwin may need this link as well #$(COREFOUNDATION_LINK) +include $(ROOT)/gen/make.shared.targets -FORCE: - -include $(Dependencies) diff --git a/builds/posix/Makefile.in.static.gpre b/builds/posix/Makefile.in.static.gpre index 788fbf8770..7ca6da69df 100644 --- a/builds/posix/Makefile.in.static.gpre +++ b/builds/posix/Makefile.in.static.gpre @@ -27,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.static.gpre,v 1.4 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.static.gpre,v 1.5 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=static.gpre @@ -67,12 +67,7 @@ $(GPRE_STATIC): $(GPRESTATIC_Objects) $(LIBFBCOMMON_A) $(LIBFBSTATIC_A) $(LN) $(@F) $(GPRE_CURRENT) +include $(ROOT)/gen/make.shared.targets -# gpre_meta needs a special boot build since there is no database. -$(SRC)/gpre/gpre_meta.cpp: $(SRC)/gpre/gpre_meta.epp - $(GPRE_BOOT) -lang_internal $(GPRE_FLAGS) $< $@ - - -FORCE: -include $(Dependencies) diff --git a/builds/posix/Makefile.in.static.isql b/builds/posix/Makefile.in.static.isql index c039432f88..c60c8740e2 100644 --- a/builds/posix/Makefile.in.static.isql +++ b/builds/posix/Makefile.in.static.isql @@ -1,5 +1,3 @@ - - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -29,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.static.isql,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: Makefile.in.static.isql,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=.. ObjModuleName=static.isql @@ -64,6 +62,6 @@ $(ISQL_STATIC): $(ISQL_Objects) $(LIBFBCOMMON_A) $(LIBBSTATIC_A) $(LD) $(LINK_OPTS) $(ISQL_Objects) -o $@ -L$(LIB) -lfbstatic -lfbcommon $(LINK_LIBS) -FORCE: +include $(ROOT)/gen/make.shared.targets -include $(Dependencies) diff --git a/builds/posix/Makefile.in.v5_examples b/builds/posix/Makefile.in.v5_examples index 5a8b0a3ed0..c6dccb267f 100644 --- a/builds/posix/Makefile.in.v5_examples +++ b/builds/posix/Makefile.in.v5_examples @@ -1,4 +1,3 @@ - # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either @@ -28,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.v5_examples,v 1.3 2002-09-19 15:25:38 skidder Exp $ +# $Id: Makefile.in.v5_examples,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # ROOT=../.. ObjModuleName=v5_examples @@ -213,4 +212,4 @@ intlbld.c: intlbuild.gdb intlbld.e $(CP) $^ $@ %.e:: $(SRC)/v5_examples/%.e - $(CP) $^ $@ \ No newline at end of file + $(CP) $^ $@ diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults index efeab06e5d..20af675c6d 100755 --- a/builds/posix/make.defaults +++ b/builds/posix/make.defaults @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: make.defaults,v 1.3 2002-09-24 13:01:12 eku Exp $ +# $Id: make.defaults,v 1.4 2002-10-07 01:29:09 skywalker Exp $ # @@ -128,6 +128,7 @@ LIBFBINTL_SO = $(FIREBIRD)/intl/libfbintl.so LIBFBCOMMON_A = $(LIB)/libfbcommon.a LIBFBSTATIC_A = $(LIB)/libfbstatic.a +LIBEDIT_A = $(LIB)/libedit.a ifdef UseSharedLibraries LIBGDS_LA = $(LIBGDS_SO) diff --git a/builds/posix/make.rules b/builds/posix/make.rules index d996958f7c..7160d8fc30 100644 --- a/builds/posix/make.rules +++ b/builds/posix/make.rules @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: make.rules,v 1.7 2002-09-25 11:20:30 kkuznetsov Exp $ +# $Id: make.rules,v 1.8 2002-10-07 01:29:09 skywalker Exp $ # #____________________________________________________________________________ @@ -164,8 +164,8 @@ LINK_OPTIONS= #LINK_LIBS:= -lm -lstdc++ $(ReadlineLibs) @LIBS@ -lc -ldl -lcrypt #STATICLINK_LIBS := -lm -lstdc++ $(ReadlineLibs) -lc -ldl -lcrypt -LINK_LIBS = @LIBS@ -STATICLINK_LIBS = @LIBS@ +LINK_LIBS = @LIBS@ @EDITLINE_A@ +STATICLINK_LIBS = @LIBS@ @EDITLINE_A@ #LINK_LIBS= -L$(LIB) -lgds -lm -lc -ldl -lcrypt # -lgcc diff --git a/builds/posix/make.shared.targets b/builds/posix/make.shared.targets new file mode 100644 index 0000000000..077d7c7885 --- /dev/null +++ b/builds/posix/make.shared.targets @@ -0,0 +1,108 @@ +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# You may obtain a copy of the Licence at +# http://www.gnu.org/licences/lgpl.html +# +# As a special exception this file can also be included in modules +# with other source code as long as that source code has been +# released under an Open Source Initiative certificed licence. +# More information about OSI certification can be found at: +# http://www.opensource.org +# +# This module 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 Lesser General Public Licence for more details. +# +# This module was created by members of the firebird development +# team. All individual contributions remain the Copyright (C) of +# those individuals and all rights are reserved. Contributors to +# this file are either listed below or can be obtained from a CVS +# history command. +# +# Created by: Mark O'Donohue +# +# Contributor(s): +# +# +# $Id: make.shared.targets,v 1.1 2002-10-07 01:29:09 skywalker Exp $ +# + + +#----------------------------------------------------------- +# Amongst a number of makefiles some of the targets have +# specific rules. Rather than duplicate the rules in a +# number of makefiles, these have been included here. +# +# Hopefully this file is an intermediate step, on the way to +# potentially a single makefile, or at least one per directory. +# MOD 07-Oct-2002 + + + + + +# This is the one where dyn_def.epp produced dyn_def.cpp and then the sed +# script is run to remove a component of it. This is pretty ugly, and even +# if we have to live with it, the makefile should be changed to make the +# dependencies clearer. MOD July-2001 + +$(SRC)/jrd/dyn_def.cpp : $(SRC)/jrd/dyn_def.epp $(SRC)/jrd/dyn_def.sed + $(GPRE_BOOT) $(JRD_GPRE_FLAGS) $< $(GEN_SRC)/jrd/dyn_deffoo.cpp + sed -f $(SRC)/jrd/dyn_def.sed $(GEN_SRC)/jrd/dyn_deffoo.cpp > $@ + + +# This rule creates parse.cpp from parse.y +# The intermediate files dsql.tab.c dsql.tab.h and parse.cpp are generated +# and are also stored in the CVS tree. MOD 7-Oct-2002 + +$(SRC)/dsql/parse.cpp: $(SRC)/dsql/parse.y $(SRC)/dsql/parse.sed + $(YACC) -d -b $(SRC)/dsql/dsql $< + sed -f $(SRC)/dsql/parse.sed <$(SRC)/dsql/dsql.tab.c > $@ + + + +# gpre_meta needs a special boot build since there is no database. + +$(SRC)/gpre/gpre_meta.cpp: $(SRC)/gpre/gpre_meta.epp + $(GPRE_BOOT) -lang_internal $(GPRE_FLAGS) $< $@ + + + + +buildb: isc4.gdb yachts.lnk help.gdb + +isc4.gdb : $(ISC_GDB) + -ln -sf $(ISC_GDB) $@ + +yachts.lnk: + -ln -fs $(SRC_ROOT)/refDatabases/empty.gdb yachts.lnk + +help.gdb: + -ln -fs $(SRC_ROOT)/refDatabases/help.gdb help.gdb + + + +# These need to change to $(GEN_SRC) at some stage +$(SRC)/dudley/exe.cpp $(SRC)/dudley/extract.epp: yachts.lnk + +$(SRC)/qli/meta.cpp $(SRC)/qli/proc.cpp $(SRC)/qli/show.cpp: yachts.lnk +$(SRC)/qli/help.cpp: help.gdb + + +.PHONY: clean FORCE + +clean: + -rm $(AllObjects) + -rm $(Dependancies) + + +# This target is used in the generated dependancy xxx.d files which are +# automatically created from the .cpp files. To simplify the build +# process, if the .d files does not yet exist, a line is written +# of the form fred.o : FORCE to ennsure that fred.cpp will be +# recompiled MOD 7-Oct-2002 + +FORCE: diff --git a/builds/posix/make.shared.variables b/builds/posix/make.shared.variables index dc563b9dd1..1bf6a55b37 100644 --- a/builds/posix/make.shared.variables +++ b/builds/posix/make.shared.variables @@ -127,7 +127,11 @@ PIPE_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(PIPE_Sources))) # # wal -WAL_Files= wal.cpp walc.cpp walf.cpp walr.cpp wstatus.cpp walw.cpp +WAL_ClientFiles = + +WAL_ServerFiles= walf.cpp wal.cpp walc.cpp walr.cpp wstatus.cpp walw.cpp + +WAL_Files = $(WAL_ClientFiles) $(WAL_ServerFiles) WAL_Sources = $(addprefix wal/, $(WAL_Files)) WAL_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(WAL_Sources)))) @@ -136,7 +140,9 @@ WAL_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(WAL_Sources)))) # # gpre -GPRELIB_Files = pretty.cpp +GPRELIB_ClientFiles = pretty.cpp + +GPRELIB_Files = $(GPRELIB_ClientFiles) $(GPRELIB_ServerFiles) GPRELIB_Sources = $(addprefix gpre/, $(GPRELIB_Files)) GPRELIB_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GPRELIB_Sources)))) diff --git a/configure.in b/configure.in index f943351474..b1f0f43db7 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.51 2002-10-01 10:38:13 eku Exp $ +dnl $Id: configure.in,v 1.52 2002-10-07 01:29:08 skywalker Exp $ dnl ############################# INITIALISATION ############################### @@ -143,7 +143,8 @@ AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) AC_CHECK_HEADERS(signal.h) if test "$READLINE_FLG" = "Y"; then - AC_CHECK_HEADERS(readline/readline.h) + AC_DEFINE(HAVE_EDITLINE_H) +# AC_CHECK_HEADERS(readline/readline.h) fi AC_CHECK_HEADERS(pwd.h) AC_CHECK_HEADERS(unistd.h) @@ -161,7 +162,8 @@ AC_CHECK_LIB(crypt, main) AC_CHECK_LIB(curses, main) dnl AC_CHECK_LIB(termcap, main) if test "$READLINE_FLG" = "Y"; then - AC_CHECK_LIB(readline, main,,, $LIBS) + AC_SUBST(EDITLINE_A, -ledit) +# AC_CHECK_LIB(readline, main,,, $LIBS) fi AC_CHECK_LIB(stdc++, main,,, $LIBS) @@ -281,7 +283,7 @@ AC_SUBST(FIREBIRD_LIBGDS_SO_X_LNK) AC_SUBST(FIREBIRD_VERSION) AC_SUBST(FIREBIRD_PACKAGE_VERSION) - +AC_SUBST(FB_BUILD_NUM, $BuildNum) BUILD_ROOT_DIR=`pwd` SRC_ROOT=$BUILD_ROOT_DIR/src @@ -357,6 +359,8 @@ mkdir -p gen/libfbserver/jrd/os/posix mkdir -p gen/fbserver/remote mkdir -p gen/libfbclient/jrd mkdir -p gen/libfbclient/dsql +mkdir -p gen/libfbclient/gpre +mkdir -p gen/libfbclient/wal mkdir -p gen/libfbclient/remote mkdir -p gen/libfbclient/utilities mkdir -p gen/libfbclient/fbutil @@ -364,6 +368,7 @@ mkdir -p gen/libfbclient/common/memory mkdir -p gen/client.gbak/burp mkdir -p gen/client.gfix/alice mkdir -p gen/client.gpre/gpre +mkdir -p gen/client.gdef/dudley mkdir -p gen/client.isql/isql mkdir -p gen/client.util/utilities mkdir -p gen/intl/intl @@ -439,6 +444,7 @@ gen/make.rules:${MAKE_SRC_DIR}/make.rules gen/make.defaults:${MAKE_SRC_DIR}/make.defaults gen/make.platform:${MAKE_SRC_DIR}/prefix.${MAKEFILE_PREFIX} gen/make.shared.variables:${MAKE_SRC_DIR}/make.shared.variables +gen/make.shared.targets:${MAKE_SRC_DIR}/make.shared.targets src/Makefile:${MAKE_SRC_DIR}/Makefile.in.firebird gen/Makefile.libfbcommon:${MAKE_SRC_DIR}/Makefile.in.libfbcommon gen/Makefile.boot.gpre:${MAKE_SRC_DIR}/Makefile.in.boot.gpre @@ -452,6 +458,7 @@ gen/Makefile.fbserver:${MAKE_SRC_DIR}/Makefile.in.fbserver gen/Makefile.libfbclient:${MAKE_SRC_DIR}/Makefile.in.libfbclient gen/Makefile.client.gbak:${MAKE_SRC_DIR}/Makefile.in.client.gbak gen/Makefile.client.gfix:${MAKE_SRC_DIR}/Makefile.in.client.gfix +gen/Makefile.client.gdef:${MAKE_SRC_DIR}/Makefile.in.client.gdef gen/Makefile.client.isql:${MAKE_SRC_DIR}/Makefile.in.client.isql gen/Makefile.client.gpre:${MAKE_SRC_DIR}/Makefile.in.client.gpre gen/Makefile.client.util:${MAKE_SRC_DIR}/Makefile.in.client.util @@ -470,7 +477,7 @@ gen/Makefile.embed.gdef:${MAKE_SRC_DIR}/Makefile.in.embed.gdef gen/Makefile.embed.qli:${MAKE_SRC_DIR}/Makefile.in.embed.qli gen/Makefile.embed.gpre:${MAKE_SRC_DIR}/Makefile.in.embed.gpre src/v5_examples/Makefile:${MAKE_SRC_DIR}/Makefile.in.example5 -src/install/Makefile:${MAKE_SRC_DIR}/Makefile.in.install +gen/Makefile.install:${MAKE_SRC_DIR}/Makefile.in.install Makefile:Makefile.in gen/install/scripts/preinstall.sh:src/install/${FIREBIRD_ARCH_TYPE}/preinstall.sh.in gen/install/scripts/install.sh:src/install/${FIREBIRD_ARCH_TYPE}/install.sh.in @@ -500,6 +507,7 @@ dnl AC_DEFINE_UNQUOTED(FILE_VER_STRING, "$FILE_VER_STRING") dnl AC_DEFINE_UNQUOTED(LICENSE_VER_STRING, "$FILE_VER_STRING") + dnl EKU: must be executed after AC_OUTPUT chmod a+x gen/install/install.sh gen/install/scripts/*.sh diff --git a/src/dsql/parse.cpp b/src/dsql/parse.cpp index bf0eead47b..d80984f5a9 100644 --- a/src/dsql/parse.cpp +++ b/src/dsql/parse.cpp @@ -8,6 +8,7 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define yyerrok (DSQL_yyerrflag=0) #define YYRECOVERING (DSQL_yyerrflag!=0) #define YYPREFIX "yy" +#line 2 "../src/dsql/parse.y" /* * PROGRAM: Dynamic SQL runtime support * MODULE: parse.y @@ -151,6 +152,7 @@ static TEXT *beginning; static SSHORT log_defined, cache_defined; static void yyerror (TEXT *); +#line 156 "../src/dsql/dsql.tab.c" #define ACTIVE 257 #define ADD 258 #define AFTER 259 @@ -4036,6 +4038,7 @@ static YYSTYPE yylval; static short DSQL_yyss[YYSTACKSIZE]; static YYSTYPE yyvs[YYSTACKSIZE]; #define yystacksize YYSTACKSIZE +#line 3778 "../src/dsql/parse.y" /* @@ -5119,6 +5122,7 @@ static void yyabandon ( ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) sql_code, gds_arg_gds, error_symbol, 0); } +#line 5122 "../src/dsql/dsql.tab.c" #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept @@ -5260,441 +5264,571 @@ yyreduce: switch (yyn) { case 1: +#line 445 "../src/dsql/parse.y" { DSQL_parse = yyvsp[0]; } break; case 2: +#line 447 "../src/dsql/parse.y" { DSQL_parse = yyvsp[-1]; } break; case 20: +#line 468 "../src/dsql/parse.y" { prepare_console_debug ((int) yyvsp[0], &yydebug); yyval = make_node (nod_null, (int) 0, NULL); } break; case 21: +#line 477 "../src/dsql/parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, yyvsp[-5], yyvsp[-3], make_list(yyvsp[-1]), yyvsp[0]); } break; case 22: +#line 481 "../src/dsql/parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, yyvsp[-6], yyvsp[-3], make_list(yyvsp[-1]), yyvsp[0]); } break; case 23: +#line 485 "../src/dsql/parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, yyvsp[-4], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 24: +#line 489 "../src/dsql/parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, yyvsp[-5], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 25: +#line 492 "../src/dsql/parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, make_list(yyvsp[-3]), make_list(yyvsp[-1]), NULL, yyvsp[0]); } break; case 27: +#line 498 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 28: +#line 502 "../src/dsql/parse.y" { yyval = make_node (nod_all, (int) 0, NULL); } break; case 29: +#line 504 "../src/dsql/parse.y" { yyval = make_node (nod_all, (int) 0, NULL); } break; case 30: +#line 506 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 32: +#line 511 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 33: +#line 515 "../src/dsql/parse.y" { yyval = make_list (make_node (nod_execute, (int) 0, NULL)); } break; case 34: +#line 519 "../src/dsql/parse.y" { yyval = make_node (nod_select, (int) 0, NULL); } break; case 35: +#line 521 "../src/dsql/parse.y" { yyval = make_node (nod_insert, (int) 0, NULL); } break; case 36: +#line 523 "../src/dsql/parse.y" { yyval = make_node (nod_delete, (int) 0, NULL); } break; case 37: +#line 525 "../src/dsql/parse.y" { yyval = make_node (nod_update, (int) 1, yyvsp[0]); } break; case 38: +#line 527 "../src/dsql/parse.y" { yyval = make_node (nod_references, (int) 1, yyvsp[0]); } break; case 39: +#line 531 "../src/dsql/parse.y" { yyval = make_node (nod_grant, (int) 0, NULL); } break; case 40: +#line 533 "../src/dsql/parse.y" { yyval = 0; } break; case 41: +#line 537 "../src/dsql/parse.y" { yyval = make_node (nod_grant_admin, (int) 0, NULL); } break; case 42: +#line 539 "../src/dsql/parse.y" { yyval = 0; } break; case 43: +#line 543 "../src/dsql/parse.y" { yyval = make_node (nod_procedure_name, (int) 1, yyvsp[0]); } break; case 44: +#line 551 "../src/dsql/parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-4], yyvsp[-2], make_list(yyvsp[0]), yyvsp[-5]); } break; case 45: +#line 556 "../src/dsql/parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-5], yyvsp[-2], make_list(yyvsp[0]), yyvsp[-6]); } break; case 46: +#line 561 "../src/dsql/parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-4], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 47: +#line 566 "../src/dsql/parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-5], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 48: +#line 571 "../src/dsql/parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-4], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 49: +#line 576 "../src/dsql/parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-5], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 50: +#line 580 "../src/dsql/parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, make_list(yyvsp[-2]), make_list(yyvsp[0]), NULL, NULL); } break; case 51: +#line 586 "../src/dsql/parse.y" { yyval = make_node (nod_grant, (int) 0, NULL); } break; case 53: +#line 591 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 54: +#line 593 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 55: +#line 595 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 56: +#line 599 "../src/dsql/parse.y" { yyval = make_node (nod_proc_obj, (int) 1, yyvsp[0]); } break; case 57: +#line 601 "../src/dsql/parse.y" { yyval = make_node (nod_trig_obj, (int) 1, yyvsp[0]); } break; case 58: +#line 603 "../src/dsql/parse.y" { yyval = make_node (nod_view_obj, (int) 1, yyvsp[0]); } break; case 59: +#line 605 "../src/dsql/parse.y" { yyval = make_node (nod_role_name, (int) 1, yyvsp[0]); } break; case 61: +#line 610 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 62: +#line 617 "../src/dsql/parse.y" { yyval = make_node (nod_user_name, (int) 1, yyvsp[0]); } break; case 63: +#line 619 "../src/dsql/parse.y" { yyval = make_node (nod_user_name, (int) 2, yyvsp[0], NULL); } break; case 64: +#line 621 "../src/dsql/parse.y" { yyval = make_node (nod_user_group, (int) 1, yyvsp[0]); } break; case 66: +#line 626 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 67: +#line 630 "../src/dsql/parse.y" { yyval = make_node (nod_role_name, (int) 1, yyvsp[0]); } break; case 69: +#line 635 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 70: +#line 639 "../src/dsql/parse.y" { yyval = make_node (nod_user_name, (int) 1, yyvsp[0]); } break; case 71: +#line 641 "../src/dsql/parse.y" { yyval = make_node (nod_user_name, (int) 1, yyvsp[0]); } break; case 72: +#line 648 "../src/dsql/parse.y" { yyval = yyvsp[0];} break; case 73: +#line 652 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 74: +#line 654 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 75: +#line 660 "../src/dsql/parse.y" { yyval = make_node (nod_def_udf, (int) e_udf_count, yyvsp[-7], yyvsp[-2], yyvsp[0], make_list (yyvsp[-6]), yyvsp[-4]); } break; case 77: +#line 666 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_blob; } break; case 78: +#line 668 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_cstring; g_field->fld_character_length = (USHORT) yyvsp[-2]; } break; case 79: +#line 674 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 81: +#line 677 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 83: +#line 682 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 84: +#line 688 "../src/dsql/parse.y" { yyval = make_node (nod_udf_param, (int) e_udf_param_count, yyvsp[-1], NULL); } break; case 85: +#line 691 "../src/dsql/parse.y" { yyval = make_node (nod_udf_param, (int) e_udf_param_count, yyvsp[-3], MAKE_constant ((STR) FUN_descriptor, CONSTANT_SLONG)); } break; case 87: +#line 698 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 88: +#line 701 "../src/dsql/parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, yyvsp[-1], MAKE_constant ((STR) FUN_reference, CONSTANT_SLONG));} break; case 89: +#line 704 "../src/dsql/parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, yyvsp[-2], MAKE_constant ((STR) (-1 * FUN_reference), CONSTANT_SLONG));} break; case 90: +#line 708 "../src/dsql/parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, yyvsp[-3], MAKE_constant ((STR) FUN_value, CONSTANT_SLONG));} break; case 91: +#line 712 "../src/dsql/parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, yyvsp[-3], MAKE_constant ((STR) FUN_descriptor, CONSTANT_SLONG));} break; case 92: +#line 715 "../src/dsql/parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, (NOD) NULL, MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG));} break; case 93: +#line 721 "../src/dsql/parse.y" { yyval = make_node (nod_def_filter, (int) e_filter_count, yyvsp[-8], yyvsp[-6], yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 94: +#line 729 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 95: +#line 733 "../src/dsql/parse.y" { yyval = make_node (nod_def_exception, (int) e_xcp_count, yyvsp[-1], yyvsp[0]); } break; case 96: +#line 736 "../src/dsql/parse.y" { yyval = make_node (nod_def_index, (int) e_idx_count, yyvsp[-6], yyvsp[-5], yyvsp[-3], yyvsp[-1], yyvsp[0]); } break; case 97: +#line 739 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 98: +#line 741 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 99: +#line 743 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 100: +#line 745 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 101: +#line 747 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 102: +#line 749 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 103: +#line 751 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 104: +#line 753 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 105: +#line 755 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 106: +#line 760 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 107: +#line 764 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 108: +#line 766 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 109: +#line 768 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 110: +#line 778 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 111: +#line 782 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 112: +#line 784 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 113: +#line 795 "../src/dsql/parse.y" { yyval = make_node (nod_unique, (int) 0, NULL); } break; case 114: +#line 797 "../src/dsql/parse.y" { yyval = NULL; } break; case 115: +#line 801 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 117: +#line 804 "../src/dsql/parse.y" { yyval = make_node (nod_def_computed, 2, yyvsp[-2], yyvsp[-1]); } break; case 118: +#line 811 "../src/dsql/parse.y" { yyval = make_node (nod_def_shadow, (int) e_shadow_count, yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], make_list (yyvsp[0])); } break; case 119: +#line 816 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 1, CONSTANT_SLONG); } break; case 120: +#line 818 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 121: +#line 820 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 122: +#line 824 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 123: +#line 826 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 1, CONSTANT_SLONG); } break; case 124: +#line 830 "../src/dsql/parse.y" { yyval = (NOD) 0;} break; case 125: +#line 832 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 126: +#line 836 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 129: +#line 842 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 130: +#line 856 "../src/dsql/parse.y" { yyval = make_node (nod_def_domain, (int) e_dom_count, yyvsp[-7], yyvsp[-3], yyvsp[-2], make_list (yyvsp[-1]), yyvsp[0]); } break; case 131: +#line 867 "../src/dsql/parse.y" { yyval = NULL; } break; case 132: +#line 869 "../src/dsql/parse.y" { yyval = NULL; } break; case 133: +#line 873 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 134: +#line 875 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 135: +#line 879 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 138: +#line 885 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 139: +#line 888 "../src/dsql/parse.y" { yyval = make_node (nod_rel_constraint, (int) 2, NULL, yyvsp[0]);} break; case 142: +#line 897 "../src/dsql/parse.y" { yyval = make_node (nod_null, (int) 0, NULL); } break; case 143: +#line 901 "../src/dsql/parse.y" { yyval = make_node (nod_def_constraint, (int) e_cnstr_count, MAKE_string (NULL_STRING, 0), NULL, NULL, NULL, yyvsp[-2], NULL, yyvsp[0], NULL, NULL); } break; case 144: +#line 910 "../src/dsql/parse.y" { yyval = make_node (nod_def_generator, (int) e_gen_count, yyvsp[0]); } break; case 145: +#line 918 "../src/dsql/parse.y" { yyval = make_node (nod_def_role, (int) 1, yyvsp[0]); } break; case 146: +#line 926 "../src/dsql/parse.y" { yyval = make_node (nod_def_database, (int) e_cdb_count, yyvsp[-2], make_list(yyvsp[-1]), make_list (yyvsp[0]));} break; case 149: +#line 935 "../src/dsql/parse.y" { log_defined = FALSE; cache_defined = FALSE; yyval = (NOD) yyvsp[0]; } break; case 150: +#line 941 "../src/dsql/parse.y" {yyval = (NOD) NULL;} break; case 153: +#line 947 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 154: +#line 951 "../src/dsql/parse.y" { yyval = make_node (nod_page_size, 1, yyvsp[0]);} break; case 155: +#line 953 "../src/dsql/parse.y" { yyval = make_node (nod_file_length, 1, yyvsp[-1]);} break; case 156: +#line 955 "../src/dsql/parse.y" { yyval = make_node (nod_user_name, 1, yyvsp[0]);} break; case 157: +#line 957 "../src/dsql/parse.y" { yyval = make_node (nod_password, 1, yyvsp[0]);} break; case 158: +#line 959 "../src/dsql/parse.y" { yyval = make_node (nod_lc_ctype, 1, yyvsp[0]);} break; case 159: +#line 963 "../src/dsql/parse.y" {yyval = (NOD) NULL;} break; case 162: +#line 969 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 166: +#line 977 "../src/dsql/parse.y" { yyval = make_node (nod_dfl_charset, 1, yyvsp[0]);} break; case 167: +#line 981 "../src/dsql/parse.y" { yyval = make_node (nod_group_commit_wait, 1, yyvsp[0]);} break; case 168: +#line 983 "../src/dsql/parse.y" { yyval = make_node (nod_check_point_len, 1, yyvsp[0]);} break; case 169: +#line 985 "../src/dsql/parse.y" { yyval = make_node (nod_num_log_buffers, 1, yyvsp[0]);} break; case 170: +#line 987 "../src/dsql/parse.y" { yyval = make_node (nod_log_buffer_size, 1, yyvsp[0]);} break; case 171: +#line 991 "../src/dsql/parse.y" { if (log_defined) yyabandon (-260, isc_log_redef); /* Log redefined */ log_defined = TRUE; yyval = yyvsp[0]; } break; case 172: +#line 996 "../src/dsql/parse.y" { if (log_defined) yyabandon (-260, isc_log_redef); log_defined = TRUE; yyval = yyvsp[0]; } break; case 173: +#line 1003 "../src/dsql/parse.y" { g_file->fil_flags |= LOG_serial | LOG_overflow; if (g_file->fil_partitions) yyabandon (-261, isc_partition_not_supp); @@ -5702,782 +5836,1013 @@ case 173: yyval = make_node (nod_list, 2, yyvsp[-3], yyvsp[0]); } break; case 174: +#line 1009 "../src/dsql/parse.y" { g_file->fil_flags |= LOG_serial; if (g_file->fil_partitions) yyabandon (-261, isc_partition_not_supp); yyval = yyvsp[0]; } break; case 175: +#line 1016 "../src/dsql/parse.y" { g_file = make_file(); g_file->fil_flags = LOG_serial | LOG_default; yyval = make_node (nod_log_file_desc, (int) 1, (NOD) g_file);} break; case 176: +#line 1023 "../src/dsql/parse.y" { g_file->fil_name = (STR) yyvsp[-1]; yyval = (NOD) make_node (nod_file_desc, (int) 1, (NOD) g_file); } break; case 178: +#line 1057 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 179: +#line 1060 "../src/dsql/parse.y" { check_log_file_attrs(); yyval = (NOD) make_node (nod_log_file_desc, (int) 1, (NOD) g_file); } break; case 180: +#line 1066 "../src/dsql/parse.y" { g_file = make_file(); g_file->fil_name = (STR) yyvsp[0]; } break; case 183: +#line 1074 "../src/dsql/parse.y" { g_file->fil_length = (SLONG) yyvsp[0]; } break; case 184: +#line 1082 "../src/dsql/parse.y" { g_file = make_file ();} break; case 189: +#line 1094 "../src/dsql/parse.y" { g_file->fil_start = (SLONG) yyvsp[0];} break; case 190: +#line 1096 "../src/dsql/parse.y" { g_file->fil_length = (SLONG) yyvsp[-1];} break; case 197: +#line 1113 "../src/dsql/parse.y" { yyval = make_node (nod_def_relation, (int) e_drl_count, yyvsp[-4], make_list (yyvsp[-1]), yyvsp[-3]); } break; case 198: +#line 1118 "../src/dsql/parse.y" { yyval = make_node (nod_redef_relation, (int) e_drl_count, yyvsp[-4], make_list (yyvsp[-1]), yyvsp[-3]); } break; case 199: +#line 1123 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 200: +#line 1125 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 201: +#line 1127 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 203: +#line 1132 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 206: +#line 1145 "../src/dsql/parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-5], yyvsp[-3], yyvsp[-2], make_list (yyvsp[-1]), yyvsp[0], yyvsp[-4], NULL); } break; case 207: +#line 1148 "../src/dsql/parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-2], NULL, NULL, NULL, NULL, NULL, yyvsp[0]); } break; case 208: +#line 1152 "../src/dsql/parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-1], NULL, NULL, NULL, NULL, NULL, yyvsp[0]); } break; case 209: +#line 1161 "../src/dsql/parse.y" { g_field->fld_flags |= FLD_computed; yyval = make_node (nod_def_computed, 2, yyvsp[-2], yyvsp[-1]); } break; case 212: +#line 1171 "../src/dsql/parse.y" { yyval = NULL; } break; case 213: +#line 1173 "../src/dsql/parse.y" { yyval = make_node (nod_def_domain, (int) e_dom_count, yyvsp[-1], NULL, NULL, NULL, NULL); } break; case 214: +#line 1178 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 215: +#line 1180 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 216: +#line 1185 "../src/dsql/parse.y" { g_field_name = yyvsp[0]; g_field = make_field (yyvsp[0]); yyval = (NOD) g_field; } break; case 217: +#line 1191 "../src/dsql/parse.y" { g_field = make_field (yyvsp[0]); yyval = (NOD) g_field; } break; case 218: +#line 1197 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 219: +#line 1200 "../src/dsql/parse.y" { g_field = make_field (NULL); yyval = (NOD) g_field; } break; case 220: +#line 1205 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 221: +#line 1207 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 225: +#line 1218 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 226: +#line 1220 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 227: +#line 1222 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 228: +#line 1226 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 231: +#line 1232 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 232: +#line 1236 "../src/dsql/parse.y" { yyval = make_node (nod_rel_constraint, (int) 2, yyvsp[-1], yyvsp[0]);} break; case 233: +#line 1240 "../src/dsql/parse.y" { yyval = make_node (nod_null, (int) 1, NULL); } break; case 234: +#line 1243 "../src/dsql/parse.y" { yyval = make_node (nod_foreign, e_for_count, make_node (nod_list, (int) 1, g_field_name), yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 236: +#line 1248 "../src/dsql/parse.y" { yyval = make_node (nod_unique, 2, NULL, yyvsp[0]); } break; case 237: +#line 1250 "../src/dsql/parse.y" { yyval = make_node (nod_primary, e_pri_count, NULL, yyvsp[0]); } break; case 238: +#line 1258 "../src/dsql/parse.y" { yyval = make_node (nod_rel_constraint, (int) 2, yyvsp[-1], yyvsp[0]);} break; case 239: +#line 1262 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 240: +#line 1263 "../src/dsql/parse.y" { yyval = NULL ;} break; case 245: +#line 1273 "../src/dsql/parse.y" { yyval = make_node (nod_unique, 2, yyvsp[-1], yyvsp[0]); } break; case 246: +#line 1277 "../src/dsql/parse.y" { yyval = make_node (nod_primary, e_pri_count, yyvsp[-1], yyvsp[0]); } break; case 247: +#line 1283 "../src/dsql/parse.y" { yyval = make_node (nod_foreign, e_for_count, yyvsp[-5], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 248: +#line 1288 "../src/dsql/parse.y" { yyval = make_node (nod_def_index, (int) e_idx_count, NULL, yyvsp[-2], yyvsp[0], NULL, NULL); } break; case 249: +#line 1295 "../src/dsql/parse.y" { yyval = make_node (nod_def_index, (int) e_idx_count, NULL, NULL, NULL, NULL, NULL); } break; case 250: +#line 1300 "../src/dsql/parse.y" { yyval = make_node (nod_def_constraint, (int) e_cnstr_count, MAKE_string (NULL_STRING, 0), NULL, NULL, NULL, yyvsp[-2], NULL, yyvsp[0], NULL, NULL); } break; case 251: +#line 1307 "../src/dsql/parse.y" { yyval = make_node (nod_ref_upd_del, e_ref_upd_del_count, yyvsp[0], NULL);} break; case 252: +#line 1309 "../src/dsql/parse.y" { yyval = make_node (nod_ref_upd_del, e_ref_upd_del_count, NULL, yyvsp[0]);} break; case 253: +#line 1311 "../src/dsql/parse.y" { yyval = make_node (nod_ref_upd_del, e_ref_upd_del_count, yyvsp[0], yyvsp[-1]); } break; case 254: +#line 1313 "../src/dsql/parse.y" { yyval = make_node (nod_ref_upd_del, e_ref_upd_del_count, yyvsp[-1], yyvsp[0]);} break; case 255: +#line 1315 "../src/dsql/parse.y" { yyval = NULL;} break; case 256: +#line 1319 "../src/dsql/parse.y" { yyval = yyvsp[0];} break; case 257: +#line 1322 "../src/dsql/parse.y" { yyval = yyvsp[0];} break; case 258: +#line 1326 "../src/dsql/parse.y" { yyval = make_flag_node (nod_ref_trig_action, REF_ACTION_CASCADE, e_ref_trig_action_count, NULL);} break; case 259: +#line 1329 "../src/dsql/parse.y" { yyval = make_flag_node (nod_ref_trig_action, REF_ACTION_SET_DEFAULT, e_ref_trig_action_count, NULL);} break; case 260: +#line 1332 "../src/dsql/parse.y" { yyval = make_flag_node (nod_ref_trig_action, REF_ACTION_SET_NULL, e_ref_trig_action_count, NULL);} break; case 261: +#line 1335 "../src/dsql/parse.y" { yyval = make_flag_node (nod_ref_trig_action, REF_ACTION_NONE, e_ref_trig_action_count, NULL);} break; case 262: +#line 1349 "../src/dsql/parse.y" { yyval = make_node (nod_def_procedure, (int) e_prc_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 263: +#line 1361 "../src/dsql/parse.y" { yyval = make_node (nod_redef_procedure, (int) e_prc_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 264: +#line 1372 "../src/dsql/parse.y" { yyval = make_node (nod_replace_procedure, (int) e_prc_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 265: +#line 1383 "../src/dsql/parse.y" { yyval = make_node (nod_mod_procedure, (int) e_prc_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 266: +#line 1389 "../src/dsql/parse.y" { yyval = make_list (yyvsp[-1]); } break; case 267: +#line 1391 "../src/dsql/parse.y" { yyval = NULL; } break; case 268: +#line 1395 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 269: +#line 1397 "../src/dsql/parse.y" { yyval = NULL; } break; case 271: +#line 1402 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 272: +#line 1406 "../src/dsql/parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-1], NULL, NULL, NULL, NULL, NULL, NULL); } break; case 273: +#line 1412 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 274: +#line 1414 "../src/dsql/parse.y" { yyval = NULL; } break; case 276: +#line 1419 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 277: +#line 1423 "../src/dsql/parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-3], yyvsp[-1], NULL, NULL, NULL, NULL, NULL); } break; case 278: +#line 1428 "../src/dsql/parse.y" { yyval = NULL; } break; case 279: +#line 1430 "../src/dsql/parse.y" { yyval = NULL; } break; case 280: +#line 1434 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 281: +#line 1436 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 284: +#line 1444 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 285: +#line 1448 "../src/dsql/parse.y" { yyval = make_node (nod_block, e_blk_count, make_list (yyvsp[0]), NULL); } break; case 286: +#line 1450 "../src/dsql/parse.y" { yyval = make_node (nod_block, e_blk_count, make_list (yyvsp[-1]), make_list (yyvsp[0])); } break; case 287: +#line 1452 "../src/dsql/parse.y" { yyval = make_node (nod_block, e_blk_count, NULL, NULL);} break; case 289: +#line 1457 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 299: +#line 1470 "../src/dsql/parse.y" { yyval = make_node (nod_post, e_pst_count, yyvsp[-1]); } break; case 303: +#line 1475 "../src/dsql/parse.y" { yyval = make_node (nod_return, e_rtn_count, NULL); } break; case 304: +#line 1477 "../src/dsql/parse.y" { yyval = make_node (nod_exit, 0, NULL); } break; case 305: +#line 1479 "../src/dsql/parse.y" { yyval = make_node (nod_breakleave, e_break_count, NULL); } break; case 306: +#line 1483 "../src/dsql/parse.y" { yyval = make_node (nod_exception_stmt, e_xcp_count, yyvsp[-1], NULL); } break; case 307: +#line 1485 "../src/dsql/parse.y" { yyval = make_node (nod_exception_stmt, e_xcp_count, yyvsp[-2], yyvsp[-1]); } break; case 308: +#line 1489 "../src/dsql/parse.y" { yyval = make_node (nod_exception_stmt, e_xcp_count, NULL, NULL); } break; case 309: +#line 1493 "../src/dsql/parse.y" { yyval = make_node (nod_exec_procedure, e_exe_count, yyvsp[-3], yyvsp[-2], yyvsp[-1]); } break; case 310: +#line 1498 "../src/dsql/parse.y" { yyval = make_node (nod_exec_sql, e_exec_vc_count, yyvsp[-1]); } break; case 311: +#line 1502 "../src/dsql/parse.y" { yyval = make_node (nod_for_select, e_flp_count, yyvsp[-5], make_list (yyvsp[-3]), yyvsp[-2], yyvsp[0], NULL); } break; case 312: +#line 1507 "../src/dsql/parse.y" { yyval = make_node (nod_if, e_if_count, yyvsp[-5], yyvsp[-2], yyvsp[0]); } break; case 313: +#line 1509 "../src/dsql/parse.y" { yyval = make_node (nod_if, e_if_count, yyvsp[-3], yyvsp[0], NULL); } break; case 314: +#line 1513 "../src/dsql/parse.y" { yyval = make_node (nod_for_select, e_flp_count, yyvsp[-3], make_list (yyvsp[-1]), NULL, NULL); } break; case 315: +#line 1518 "../src/dsql/parse.y" { yyval = make_node (nod_var_name, (int) e_vrn_count, yyvsp[0]); } break; case 316: +#line 1523 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 317: +#line 1525 "../src/dsql/parse.y" { yyval = make_list (yyvsp[-1]); } break; case 318: +#line 1527 "../src/dsql/parse.y" { yyval = NULL; } break; case 319: +#line 1531 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 320: +#line 1533 "../src/dsql/parse.y" { yyval = make_list (yyvsp[-1]); } break; case 321: +#line 1535 "../src/dsql/parse.y" { yyval = NULL; } break; case 324: +#line 1541 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 325: +#line 1543 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 326: +#line 1547 "../src/dsql/parse.y" { yyval = make_node (nod_while, e_while_count, yyvsp[-3], yyvsp[0], NULL); } break; case 327: +#line 1552 "../src/dsql/parse.y" { yyval = make_node (nod_cursor, e_cur_count, yyvsp[0], NULL, NULL); } break; case 328: +#line 1554 "../src/dsql/parse.y" { yyval = NULL; } break; case 330: +#line 1558 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 331: +#line 1562 "../src/dsql/parse.y" { yyval = make_node (nod_on_error, e_err_count, make_list (yyvsp[-2]), yyvsp[0]); } break; case 333: +#line 1568 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 334: +#line 1572 "../src/dsql/parse.y" { yyval = make_node (nod_sqlcode, 1, yyvsp[0]); } break; case 335: +#line 1574 "../src/dsql/parse.y" { yyval = make_node (nod_gdscode, 1, yyvsp[0]); } break; case 336: +#line 1576 "../src/dsql/parse.y" { yyval = make_node (nod_exception, 1, yyvsp[0]); } break; case 337: +#line 1578 "../src/dsql/parse.y" { yyval = make_node (nod_default, 1, NULL); } break; case 338: +#line 1585 "../src/dsql/parse.y" { yyval = make_node (nod_exec_procedure, e_exe_count, yyvsp[-1], yyvsp[0], make_node (nod_all, (int) 0, NULL)); } break; case 339: +#line 1590 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 340: +#line 1592 "../src/dsql/parse.y" { yyval = make_list (yyvsp[-1]); } break; case 341: +#line 1594 "../src/dsql/parse.y" { yyval = NULL; } break; case 345: +#line 1601 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 346: +#line 1603 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 347: +#line 1605 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 348: +#line 1613 "../src/dsql/parse.y" { yyval = make_node (nod_def_view, (int) e_view_count, yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 349: +#line 1620 "../src/dsql/parse.y" { yyval = make_node (nod_redef_view, (int) e_view_count, yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 350: +#line 1627 "../src/dsql/parse.y" { yyval = make_node (nod_replace_view, (int) e_view_count, yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 351: +#line 1633 "../src/dsql/parse.y" { yyval = make_node (nod_mod_view, (int) e_view_count, yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 352: +#line 1638 "../src/dsql/parse.y" { yyval = make_node (nod_select, (int) 2, yyvsp[0], NULL); } break; case 353: +#line 1642 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 1, yyvsp[0]); } break; case 354: +#line 1644 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 355: +#line 1646 "../src/dsql/parse.y" { yyval = make_flag_node (nod_list, NOD_UNION_ALL, 2, yyvsp[-3], yyvsp[0]); } break; case 356: +#line 1657 "../src/dsql/parse.y" { yyval = make_node (nod_select_expr, e_sel_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 357: +#line 1662 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 359: +#line 1667 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 362: +#line 1675 "../src/dsql/parse.y" { yyval = make_node (nod_join, (int) e_join_count, yyvsp[-5], yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 363: +#line 1678 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 364: +#line 1684 "../src/dsql/parse.y" { beginning = lex_position(); } break; case 365: +#line 1688 "../src/dsql/parse.y" { yyval = (NOD) MAKE_string ((UCHAR *) beginning, (lex_position() == end) ? lex_position()-beginning : last_token-beginning);} break; case 366: +#line 1694 "../src/dsql/parse.y" { beginning = last_token; } break; case 367: +#line 1698 "../src/dsql/parse.y" { yyval = (NOD) MAKE_string ((UCHAR *) beginning, lex_position()-beginning); } break; case 368: +#line 1704 "../src/dsql/parse.y" { yyval = make_node (nod_def_constraint, (int) e_cnstr_count, MAKE_string (NULL_STRING, 0), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } break; case 369: +#line 1708 "../src/dsql/parse.y" { yyval = 0; } break; case 370: +#line 1722 "../src/dsql/parse.y" { yyval = make_node (nod_def_trigger, (int) e_trg_count, yyvsp[-8], yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-1], yyvsp[0], NULL); } break; case 371: +#line 1733 "../src/dsql/parse.y" { yyval = make_node (nod_replace_trigger, (int) e_trg_count, yyvsp[-8], yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-1], yyvsp[0], NULL); } break; case 372: +#line 1738 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 373: +#line 1740 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 1, CONSTANT_SLONG); } break; case 374: +#line 1742 "../src/dsql/parse.y" { yyval = NULL; } break; case 375: +#line 1746 "../src/dsql/parse.y" { yyval = MAKE_trigger_type (yyvsp[-1], yyvsp[0]); } break; case 376: +#line 1750 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 377: +#line 1752 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) 1, CONSTANT_SLONG); } break; case 378: +#line 1756 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 0, 0), CONSTANT_SLONG); } break; case 379: +#line 1758 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 0, 0), CONSTANT_SLONG); } break; case 380: +#line 1760 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 0, 0), CONSTANT_SLONG); } break; case 381: +#line 1762 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 2, 0), CONSTANT_SLONG); } break; case 382: +#line 1764 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 3, 0), CONSTANT_SLONG); } break; case 383: +#line 1766 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 1, 0), CONSTANT_SLONG); } break; case 384: +#line 1768 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 3, 0), CONSTANT_SLONG); } break; case 385: +#line 1770 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 1, 0), CONSTANT_SLONG); } break; case 386: +#line 1772 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 2, 0), CONSTANT_SLONG); } break; case 387: +#line 1774 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 2, 3), CONSTANT_SLONG); } break; case 388: +#line 1776 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 3, 2), CONSTANT_SLONG); } break; case 389: +#line 1778 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 1, 3), CONSTANT_SLONG); } break; case 390: +#line 1780 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 3, 1), CONSTANT_SLONG); } break; case 391: +#line 1782 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 1, 2), CONSTANT_SLONG); } break; case 392: +#line 1784 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 2, 1), CONSTANT_SLONG); } break; case 393: +#line 1788 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 394: +#line 1790 "../src/dsql/parse.y" { yyval = NULL; } break; case 395: +#line 1794 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 396: +#line 1800 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 397: +#line 1804 "../src/dsql/parse.y" { yyval = make_node (nod_mod_exception, (int) e_xcp_count, yyvsp[-1], yyvsp[0]); } break; case 398: +#line 1807 "../src/dsql/parse.y" { yyval = make_node (nod_mod_relation, (int) e_alt_count, yyvsp[-1], make_list (yyvsp[0])); } break; case 399: +#line 1814 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 400: +#line 1816 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 401: +#line 1818 "../src/dsql/parse.y" { yyval = make_node (nod_mod_database, (int) e_adb_count, make_list (yyvsp[0])); } break; case 402: +#line 1821 "../src/dsql/parse.y" { yyval = make_node (nod_mod_domain, (int) e_alt_count, yyvsp[-1], make_list (yyvsp[0])); } break; case 403: +#line 1824 "../src/dsql/parse.y" { yyval = make_node (nod_mod_index, (int) e_mod_idx_count, yyvsp[0]); } break; case 404: +#line 1829 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 405: +#line 1832 "../src/dsql/parse.y" { yyval = make_node (nod_def_constraint, (int) e_cnstr_count, MAKE_string (NULL_STRING, 0), NULL, NULL, NULL, yyvsp[-2], NULL, yyvsp[0], NULL, NULL); } break; case 407: +#line 1839 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 408: +#line 1843 "../src/dsql/parse.y" { yyval = make_node (nod_def_default, (int) e_dft_count, yyvsp[-1], yyvsp[0]); } break; case 409: +#line 1852 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 410: +#line 1856 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 411: +#line 1858 "../src/dsql/parse.y" {yyval = make_node (nod_del_default, (int) 0, NULL); } break; case 412: +#line 1860 "../src/dsql/parse.y" { yyval = make_node (nod_delete_rel_constraint, (int) 1, NULL); } break; case 413: +#line 1862 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 414: +#line 1864 "../src/dsql/parse.y" { yyval = make_node (nod_mod_domain_type, 2, yyvsp[-1]); } break; case 416: +#line 1869 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 417: +#line 1873 "../src/dsql/parse.y" { yyval = make_node (nod_del_field, 2, yyvsp[-1], yyvsp[0]); } break; case 418: +#line 1875 "../src/dsql/parse.y" { yyval = make_node (nod_delete_rel_constraint, (int) 1, yyvsp[0]);} break; case 419: +#line 1877 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 420: +#line 1879 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 421: +#line 1885 "../src/dsql/parse.y" { yyval = make_node (nod_mod_field_pos, 2, yyvsp[-2], MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG)); } break; case 422: +#line 1888 "../src/dsql/parse.y" { yyval = make_node (nod_mod_field_name, 2, yyvsp[-2], yyvsp[0]); } break; case 423: +#line 1890 "../src/dsql/parse.y" { yyval = make_node (nod_mod_field_type, 3, yyvsp[-3], yyvsp[0], yyvsp[-1]); } break; case 424: +#line 1894 "../src/dsql/parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, NULL, yyvsp[0]); } break; case 449: +#line 1925 "../src/dsql/parse.y" { yyval = NULL; } break; case 450: +#line 1927 "../src/dsql/parse.y" { yyval = NULL; } break; case 451: +#line 1931 "../src/dsql/parse.y" { yyval = NULL; } break; case 452: +#line 1933 "../src/dsql/parse.y" { yyval = make_node (nod_def_domain, (int) e_dom_count, yyvsp[-1], NULL, NULL, NULL, NULL); } break; case 453: +#line 1937 "../src/dsql/parse.y" { g_field_name = yyvsp[0]; g_field = make_field (yyvsp[0]); yyval = (NOD) g_field; } break; case 454: +#line 1942 "../src/dsql/parse.y" { yyval = make_node (nod_restrict, 0, NULL); } break; case 455: +#line 1944 "../src/dsql/parse.y" { yyval = make_node (nod_cascade, 0, NULL); } break; case 456: +#line 1946 "../src/dsql/parse.y" { yyval = make_node (nod_restrict, 0, NULL); } break; case 457: +#line 1950 "../src/dsql/parse.y" { yyval = make_node (nod_idx_active, 1, yyvsp[-1]); } break; case 458: +#line 1952 "../src/dsql/parse.y" { yyval = make_node (nod_idx_inactive, 1, yyvsp[-1]); } break; case 459: +#line 1959 "../src/dsql/parse.y" { log_defined = FALSE; cache_defined = FALSE; yyval = (NOD) NULL; } break; case 461: +#line 1966 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 462: +#line 1970 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 463: +#line 1978 "../src/dsql/parse.y" { yyval = make_node (nod_drop_log, (int) 0, NULL); } break; case 464: +#line 1980 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 465: +#line 1982 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 467: +#line 1987 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 468: +#line 1999 "../src/dsql/parse.y" { yyval = make_node (nod_mod_trigger, (int) e_trg_count, yyvsp[-6], NULL, yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-1], yyvsp[0], NULL); } break; case 470: +#line 2005 "../src/dsql/parse.y" { yyval = NULL; } break; case 472: +#line 2010 "../src/dsql/parse.y" { yyval = NULL; } break; case 473: +#line 2016 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 474: +#line 2020 "../src/dsql/parse.y" { yyval = make_node (nod_del_exception, 1, yyvsp[0]); } break; case 475: +#line 2022 "../src/dsql/parse.y" { yyval = make_node (nod_del_index, (int) 1, yyvsp[0]); } break; case 476: +#line 2024 "../src/dsql/parse.y" { yyval = make_node (nod_del_procedure, (int) 1, yyvsp[0]); } break; case 477: +#line 2026 "../src/dsql/parse.y" { yyval = make_node (nod_del_relation, (int) 1, yyvsp[0]); } break; case 478: +#line 2028 "../src/dsql/parse.y" { yyval = make_node (nod_del_trigger, (int) 1, yyvsp[0]); } break; case 479: +#line 2030 "../src/dsql/parse.y" { yyval = make_node (nod_del_view, (int) 1, yyvsp[0]); } break; case 480: +#line 2032 "../src/dsql/parse.y" { yyval = make_node (nod_del_filter, (int) 1, yyvsp[0]); } break; case 481: +#line 2034 "../src/dsql/parse.y" { yyval = make_node (nod_del_domain, (int) 1, yyvsp[0]); } break; case 482: +#line 2036 "../src/dsql/parse.y" { yyval = make_node (nod_del_udf, (int) 1, yyvsp[0]); } break; case 483: +#line 2038 "../src/dsql/parse.y" { yyval = make_node (nod_del_shadow, (int) 1, yyvsp[0]); } break; case 484: +#line 2040 "../src/dsql/parse.y" { yyval = make_node (nod_del_role, (int) 1, yyvsp[0]); } break; case 485: +#line 2042 "../src/dsql/parse.y" { yyval = make_node (nod_del_generator, (int) 1, yyvsp[0]); } break; case 490: +#line 2058 "../src/dsql/parse.y" { g_field->fld_ranges = make_list (yyvsp[-1]); g_field->fld_dimensions = g_field->fld_ranges->nod_count / 2; g_field->fld_element_dtype = g_field->fld_dtype; yyval = yyvsp[-3]; } break; case 491: +#line 2063 "../src/dsql/parse.y" { g_field->fld_ranges = make_list (yyvsp[-2]); g_field->fld_dimensions = g_field->fld_ranges->nod_count / 2; g_field->fld_element_dtype = g_field->fld_dtype; yyval = yyvsp[-4]; } break; case 493: +#line 2071 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 494: +#line 2075 "../src/dsql/parse.y" { if ((SLONG) yyvsp[0] < 1) yyval = make_node (nod_list, (int) 2, MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG), @@ -6488,11 +6853,13 @@ case 494: MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG) ); } break; case 495: +#line 2084 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, MAKE_constant ((STR) yyvsp[-2], CONSTANT_SLONG), MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG)); } break; case 501: +#line 2097 "../src/dsql/parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -6511,18 +6878,21 @@ case 501: } break; case 502: +#line 2114 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_long; g_field->fld_length = sizeof (SLONG); } break; case 503: +#line 2119 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_short; g_field->fld_length = sizeof (SSHORT); } break; case 504: +#line 2124 "../src/dsql/parse.y" { *stmt_ambiguous = TRUE; if (client_dialect <= SQL_DIALECT_V5) @@ -6543,6 +6913,7 @@ case 504: } break; case 505: +#line 2143 "../src/dsql/parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -6561,17 +6932,20 @@ case 505: } break; case 506: +#line 2160 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_timestamp; g_field->fld_length = sizeof (GDS_TIMESTAMP); } break; case 509: +#line 2175 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_blob; } break; case 510: +#line 2179 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_blob; g_field->fld_seg_length = (USHORT) yyvsp[-1]; @@ -6579,6 +6953,7 @@ case 510: } break; case 511: +#line 2185 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_blob; g_field->fld_seg_length = (USHORT) yyvsp[-3]; @@ -6586,6 +6961,7 @@ case 511: } break; case 512: +#line 2191 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_blob; g_field->fld_seg_length = 80; @@ -6593,36 +6969,43 @@ case 512: } break; case 513: +#line 2199 "../src/dsql/parse.y" { g_field->fld_seg_length = (USHORT) yyvsp[0]; } break; case 514: +#line 2203 "../src/dsql/parse.y" { g_field->fld_seg_length = (USHORT) 80; } break; case 515: +#line 2209 "../src/dsql/parse.y" { g_field->fld_sub_type = (USHORT) yyvsp[0]; } break; case 516: +#line 2213 "../src/dsql/parse.y" { g_field->fld_sub_type_name = yyvsp[0]; } break; case 517: +#line 2217 "../src/dsql/parse.y" { g_field->fld_sub_type = (USHORT) 0; } break; case 518: +#line 2223 "../src/dsql/parse.y" { g_field->fld_character_set = yyvsp[0]; } break; case 520: +#line 2234 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_text; g_field->fld_character_length = (USHORT) yyvsp[-1]; @@ -6630,6 +7013,7 @@ case 520: } break; case 521: +#line 2240 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_text; g_field->fld_character_length = 1; @@ -6637,6 +7021,7 @@ case 521: } break; case 522: +#line 2246 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_varying; g_field->fld_character_length = (USHORT) yyvsp[-1]; @@ -6644,29 +7029,34 @@ case 522: } break; case 523: +#line 2254 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_text; g_field->fld_character_length = (USHORT) yyvsp[-1]; } break; case 524: +#line 2259 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_text; g_field->fld_character_length = 1; } break; case 525: +#line 2264 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_varying; g_field->fld_character_length = (USHORT) yyvsp[-1]; } break; case 534: +#line 2289 "../src/dsql/parse.y" { g_field->fld_sub_type = dsc_num_type_numeric; } break; case 535: +#line 2293 "../src/dsql/parse.y" { g_field->fld_sub_type = dsc_num_type_decimal; if (g_field->fld_dtype == dtype_short) @@ -6677,9 +7067,11 @@ case 535: } break; case 536: +#line 2304 "../src/dsql/parse.y" { yyval = make_node (nod_position, 1, yyvsp[0]); } break; case 537: +#line 2311 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_long; g_field->fld_length = sizeof (SLONG); @@ -6687,6 +7079,7 @@ case 537: } break; case 538: +#line 2317 "../src/dsql/parse.y" { if ( ((SLONG) yyvsp[-1] < 1) || ((SLONG) yyvsp[-1] > 18) ) yyabandon (-842, isc_precision_err); @@ -6742,6 +7135,7 @@ case 538: } break; case 539: +#line 2371 "../src/dsql/parse.y" { if ( ((SLONG) yyvsp[-3] < 1) || ((SLONG) yyvsp[-3] > 18) ) yyabandon (-842, isc_precision_err); @@ -6803,6 +7197,7 @@ case 539: } break; case 542: +#line 2441 "../src/dsql/parse.y" { if ((SLONG) yyvsp[0] > 7) { @@ -6817,42 +7212,50 @@ case 542: } break; case 543: +#line 2454 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_double; g_field->fld_length = sizeof (double); } break; case 544: +#line 2459 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_real; g_field->fld_length = sizeof (float); } break; case 545: +#line 2464 "../src/dsql/parse.y" { g_field->fld_dtype = dtype_double; g_field->fld_length = sizeof (double); } break; case 546: +#line 2471 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 547: +#line 2473 "../src/dsql/parse.y" { yyval = 0; } break; case 551: +#line 2486 "../src/dsql/parse.y" { yyval = make_node (nod_set_generator2,e_gen_id_count,yyvsp[-2], MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG)); } break; case 552: +#line 2491 "../src/dsql/parse.y" { yyval = make_node (nod_set_generator2,e_gen_id_count,yyvsp[-2], MAKE_constant((STR)yyvsp[0], CONSTANT_SINT64)); } break; case 553: +#line 2496 "../src/dsql/parse.y" { yyval = make_node (nod_set_generator2, e_gen_id_count, yyvsp[-3], make_node(nod_negate, 1, @@ -6860,609 +7263,805 @@ case 553: } break; case 554: +#line 2507 "../src/dsql/parse.y" { yyval = make_node (nod_commit, 1, yyvsp[0]); } break; case 555: +#line 2511 "../src/dsql/parse.y" { yyval = make_node (nod_rollback, 0, NULL); } break; case 558: +#line 2519 "../src/dsql/parse.y" { yyval = make_node (nod_commit_retain, 0, NULL); } break; case 559: +#line 2521 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 561: +#line 2526 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 562: +#line 2530 "../src/dsql/parse.y" {yyval = make_node (nod_trans, 1, make_list (yyvsp[0])); } break; case 564: +#line 2535 "../src/dsql/parse.y" { yyval = (NOD) NULL; } break; case 566: +#line 2540 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 571: +#line 2550 "../src/dsql/parse.y" { yyval = make_flag_node (nod_access, NOD_READ_ONLY, (int) 0, NULL); } break; case 572: +#line 2552 "../src/dsql/parse.y" { yyval = make_flag_node (nod_access, NOD_READ_WRITE, (int) 0, NULL); } break; case 573: +#line 2556 "../src/dsql/parse.y" { yyval = make_flag_node (nod_wait, NOD_WAIT, (int) 0, NULL); } break; case 574: +#line 2558 "../src/dsql/parse.y" { yyval = make_flag_node (nod_wait, NOD_NO_WAIT, (int) 0, NULL); } break; case 575: +#line 2562 "../src/dsql/parse.y" { yyval = yyvsp[0];} break; case 577: +#line 2567 "../src/dsql/parse.y" { yyval = yyvsp[0];} break; case 578: +#line 2569 "../src/dsql/parse.y" { yyval = make_flag_node (nod_isolation, NOD_READ_COMMITTED, 1, yyvsp[0]); } break; case 579: +#line 2571 "../src/dsql/parse.y" { yyval = make_flag_node (nod_isolation, NOD_READ_COMMITTED, 1, yyvsp[0]); } break; case 580: +#line 2575 "../src/dsql/parse.y" { yyval = make_flag_node (nod_isolation, NOD_CONCURRENCY, 0, NULL); } break; case 581: +#line 2577 "../src/dsql/parse.y" { yyval = make_flag_node (nod_isolation, NOD_CONSISTENCY, 0, NULL); } break; case 582: +#line 2579 "../src/dsql/parse.y" { yyval = make_flag_node (nod_isolation, NOD_CONSISTENCY, 0, NULL); } break; case 583: +#line 2583 "../src/dsql/parse.y" { yyval = make_flag_node (nod_version, NOD_VERSION, 0, NULL); } break; case 584: +#line 2585 "../src/dsql/parse.y" { yyval = make_flag_node (nod_version, NOD_NO_VERSION, 0, NULL); } break; case 585: +#line 2587 "../src/dsql/parse.y" { yyval = 0; } break; case 586: +#line 2591 "../src/dsql/parse.y" { yyval = make_node (nod_reserve, 1, make_list (yyvsp[0])); } break; case 587: +#line 2595 "../src/dsql/parse.y" { yyval = (NOD) NOD_SHARED; } break; case 588: +#line 2597 "../src/dsql/parse.y" { yyval = (NOD) NOD_PROTECTED ; } break; case 589: +#line 2599 "../src/dsql/parse.y" { yyval = (NOD) 0; } break; case 590: +#line 2603 "../src/dsql/parse.y" { yyval = (NOD) NOD_READ; } break; case 591: +#line 2605 "../src/dsql/parse.y" { yyval = (NOD) NOD_WRITE; } break; case 593: +#line 2610 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 594: +#line 2614 "../src/dsql/parse.y" { yyval = make_node (nod_table_lock, (int) 2, make_list (yyvsp[-1]), yyvsp[0]); } break; case 595: +#line 2618 "../src/dsql/parse.y" { yyval = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT) yyvsp[-1] | (SSHORT) yyvsp[0]), (SSHORT) 0, NULL); } break; case 596: +#line 2620 "../src/dsql/parse.y" { yyval = 0; } break; case 598: +#line 2625 "../src/dsql/parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 599: +#line 2630 "../src/dsql/parse.y" {yyval = make_node (nod_set_statistics, (int)e_stat_count, yyvsp[0]); } break; case 600: +#line 2637 "../src/dsql/parse.y" { yyval = make_node (nod_select, 3, yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 601: +#line 2641 "../src/dsql/parse.y" { yyval = make_node (nod_list, 1, yyvsp[0]); } break; case 602: +#line 2643 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 603: +#line 2645 "../src/dsql/parse.y" { yyval = make_flag_node (nod_list, NOD_UNION_ALL, 2, yyvsp[-3], yyvsp[0]); } break; case 604: +#line 2649 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 605: +#line 2651 "../src/dsql/parse.y" { yyval = 0; } break; case 607: +#line 2656 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 608: +#line 2660 "../src/dsql/parse.y" { yyval = make_node (nod_order, e_order_count, yyvsp[-3], yyvsp[-1], yyvsp[-2], yyvsp[0]); } break; case 609: +#line 2662 "../src/dsql/parse.y" { yyval = make_node (nod_order, e_order_count, yyvsp[-3], yyvsp[-1], yyvsp[-2], yyvsp[0]); } break; case 610: +#line 2666 "../src/dsql/parse.y" { yyval = 0; } break; case 611: +#line 2668 "../src/dsql/parse.y" { yyval = make_node (nod_flag, 0, NULL); } break; case 612: +#line 2670 "../src/dsql/parse.y" { yyval = 0; } break; case 613: +#line 2674 "../src/dsql/parse.y" { yyval = make_node (nod_flag, 0, NULL); } break; case 614: +#line 2676 "../src/dsql/parse.y" { yyval = 0; } break; case 615: +#line 2678 "../src/dsql/parse.y" { yyval = 0; } break; case 616: +#line 2682 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 617: +#line 2684 "../src/dsql/parse.y" { yyval = 0; } break; case 618: +#line 2688 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 619: +#line 2690 "../src/dsql/parse.y" { yyval = make_node (nod_flag, 0, NULL); } break; case 620: +#line 2704 "../src/dsql/parse.y" { yyval = make_node (nod_select_expr, e_sel_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 621: +#line 2710 "../src/dsql/parse.y" { yyval = make_node (nod_flag, 0, NULL); } break; case 622: +#line 2712 "../src/dsql/parse.y" { yyval = 0; } break; case 623: +#line 2716 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 624: +#line 2718 "../src/dsql/parse.y" { yyval = 0; } break; case 626: +#line 2723 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 628: +#line 2728 "../src/dsql/parse.y" { yyval = make_node (nod_alias, 2, yyvsp[-1], yyvsp[0]); } break; case 629: +#line 2730 "../src/dsql/parse.y" { yyval = make_node (nod_alias, 2, yyvsp[-2], yyvsp[0]); } break; case 630: +#line 2737 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 632: +#line 2745 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 635: +#line 2753 "../src/dsql/parse.y" { yyval = make_node (nod_join, (int) e_join_count, yyvsp[-5], yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 636: +#line 2755 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 637: +#line 2759 "../src/dsql/parse.y" { yyval = make_node (nod_rel_proc_name, (int) e_rpn_count, yyvsp[-2], yyvsp[0], yyvsp[-1]); } break; case 638: +#line 2762 "../src/dsql/parse.y" { yyval = make_node (nod_rel_proc_name, (int) e_rpn_count, yyvsp[-1], NULL, yyvsp[0]); } break; case 639: +#line 2767 "../src/dsql/parse.y" { yyval = make_list (yyvsp[-1]); } break; case 640: +#line 2769 "../src/dsql/parse.y" { yyval = NULL; } break; case 642: +#line 2774 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 646: +#line 2783 "../src/dsql/parse.y" { yyval = make_node (nod_relation_name, (int) e_rln_count, yyvsp[-1], yyvsp[0]); } break; case 647: +#line 2788 "../src/dsql/parse.y" { yyval = make_node (nod_relation_name, (int) e_rln_count, yyvsp[0], NULL); } break; case 648: +#line 2793 "../src/dsql/parse.y" { yyval = make_node (nod_join_inner, (int) 0, NULL); } break; case 649: +#line 2795 "../src/dsql/parse.y" { yyval = make_node (nod_join_left, (int) 0, NULL); } break; case 650: +#line 2797 "../src/dsql/parse.y" { yyval = make_node (nod_join_left, (int) 0, NULL); } break; case 651: +#line 2799 "../src/dsql/parse.y" { yyval = make_node (nod_join_right, (int) 0, NULL); } break; case 652: +#line 2801 "../src/dsql/parse.y" { yyval = make_node (nod_join_right, (int) 0, NULL); } break; case 653: +#line 2803 "../src/dsql/parse.y" { yyval = make_node (nod_join_full, (int) 0, NULL); } break; case 654: +#line 2805 "../src/dsql/parse.y" { yyval = make_node (nod_join_full, (int) 0, NULL); } break; case 655: +#line 2807 "../src/dsql/parse.y" { yyval = make_node (nod_join_inner, (int) 0, NULL); } break; case 656: +#line 2813 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 657: +#line 2815 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 658: +#line 2817 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 659: +#line 2821 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 660: +#line 2823 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 661: +#line 2825 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 662: +#line 2829 "../src/dsql/parse.y" { yyval = make_node (nod_limit, e_limit_count, yyvsp[0], yyvsp[-1]); } break; case 663: +#line 2831 "../src/dsql/parse.y" { yyval = make_node (nod_limit, e_limit_count, NULL, yyvsp[0]); } break; case 664: +#line 2833 "../src/dsql/parse.y" { yyval = make_node (nod_limit, e_limit_count, yyvsp[0], NULL); } break; case 665: +#line 2835 "../src/dsql/parse.y" { yyval = 0; } break; case 666: +#line 2839 "../src/dsql/parse.y" { yyval = make_list (yyvsp[0]); } break; case 667: +#line 2841 "../src/dsql/parse.y" { yyval = 0; } break; case 669: +#line 2846 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 674: +#line 2854 "../src/dsql/parse.y" { yyval = make_node (nod_collate, e_coll_count, (NOD) yyvsp[0], yyvsp[-2]); } break; case 678: +#line 2863 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 679: +#line 2865 "../src/dsql/parse.y" { yyval = 0; } break; case 680: +#line 2869 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 681: +#line 2871 "../src/dsql/parse.y" { yyval = 0; } break; case 682: +#line 2875 "../src/dsql/parse.y" { yyval = make_node (nod_top, 1, yyvsp[-2]);} break; case 683: +#line 2877 "../src/dsql/parse.y" { yyval = make_node (nod_top, 2, yyvsp[-4], yyvsp[-3]);} break; case 684: +#line 2879 "../src/dsql/parse.y" { yyval = 0;} break; case 685: +#line 2887 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 686: +#line 2889 "../src/dsql/parse.y" { yyval = 0; } break; case 687: +#line 2893 "../src/dsql/parse.y" { yyval = make_node (nod_plan_expr, 2, yyvsp[-3], make_list (yyvsp[-1])); } break; case 688: +#line 2897 "../src/dsql/parse.y" { yyval = 0; } break; case 689: +#line 2899 "../src/dsql/parse.y" { yyval = make_node (nod_merge, (int) 0, NULL); } break; case 690: +#line 2901 "../src/dsql/parse.y" { yyval = make_node (nod_merge, (int) 0, NULL); } break; case 691: +#line 2907 "../src/dsql/parse.y" { yyval = 0; } break; case 692: +#line 2909 "../src/dsql/parse.y" { yyval = 0; } break; case 694: +#line 2914 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 695: +#line 2918 "../src/dsql/parse.y" { yyval = make_node (nod_plan_item, 2, make_list (yyvsp[-1]), yyvsp[0]); } break; case 698: +#line 2924 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 699: +#line 2928 "../src/dsql/parse.y" { yyval = make_node (nod_natural, (int) 0, NULL); } break; case 700: +#line 2930 "../src/dsql/parse.y" { yyval = make_node (nod_index, 1, make_list (yyvsp[-1])); } break; case 701: +#line 2932 "../src/dsql/parse.y" { yyval = make_node (nod_index_order, 1, yyvsp[0]); } break; case 703: +#line 2937 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 704: +#line 2945 "../src/dsql/parse.y" { yyval = make_node (nod_insert, e_ins_count, yyvsp[-5], make_list (yyvsp[-4]), make_list (yyvsp[-1]), NULL); } break; case 705: +#line 2948 "../src/dsql/parse.y" { yyval = make_node (nod_insert, e_ins_count, yyvsp[-2], yyvsp[-1], NULL, yyvsp[0]); } break; case 707: +#line 2953 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 710: +#line 2964 "../src/dsql/parse.y" { yyval = make_node (nod_delete, e_del_count, yyvsp[-1], yyvsp[0], NULL); } break; case 711: +#line 2968 "../src/dsql/parse.y" { yyval = make_node (nod_delete, e_del_count, yyvsp[-1], NULL, yyvsp[0]); } break; case 712: +#line 2972 "../src/dsql/parse.y" { yyval = make_node (nod_cursor, e_cur_count, yyvsp[0], NULL, NULL); } break; case 715: +#line 2983 "../src/dsql/parse.y" { yyval = make_node (nod_update, e_upd_count, yyvsp[-3], make_list (yyvsp[-1]), yyvsp[0], NULL); } break; case 716: +#line 2988 "../src/dsql/parse.y" { yyval = make_node (nod_update, e_upd_count, yyvsp[-3], make_list (yyvsp[-1]), NULL, yyvsp[0]); } break; case 718: +#line 2994 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 719: +#line 2998 "../src/dsql/parse.y" { yyval = make_node (nod_assign, 2, yyvsp[0], yyvsp[-2]); } break; case 722: +#line 3009 "../src/dsql/parse.y" { yyval = make_node (nod_get_segment, e_blb_count, yyvsp[-4], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 723: +#line 3011 "../src/dsql/parse.y" { yyval = make_node (nod_put_segment, e_blb_count, yyvsp[-4], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 724: +#line 3015 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 725: +#line 3017 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, NULL, yyvsp[0]); } break; case 729: +#line 3026 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 730: +#line 3030 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 732: +#line 3035 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 735: +#line 3044 "../src/dsql/parse.y" { yyval = NULL; } break; case 736: +#line 3048 "../src/dsql/parse.y" { yyval = make_list (yyvsp[-1]); } break; case 738: +#line 3053 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 740: +#line 3059 "../src/dsql/parse.y" { yyval = NULL; } break; case 741: +#line 3063 "../src/dsql/parse.y" { yyval = make_list (yyvsp[-1]); } break; case 743: +#line 3068 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 745: +#line 3074 "../src/dsql/parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, yyvsp[-2], yyvsp[0]); } break; case 746: +#line 3077 "../src/dsql/parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, yyvsp[-2], NULL); } break; case 747: +#line 3082 "../src/dsql/parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, NULL, yyvsp[0]); } break; case 749: +#line 3090 "../src/dsql/parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, yyvsp[-2], yyvsp[0]); } break; case 751: +#line 3098 "../src/dsql/parse.y" { yyval = make_node (nod_or, 2, yyvsp[-2], yyvsp[0]); } break; case 752: +#line 3100 "../src/dsql/parse.y" { yyval = make_node (nod_and, 2, yyvsp[-2], yyvsp[0]); } break; case 753: +#line 3102 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, yyvsp[0]); } break; case 764: +#line 3116 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 765: +#line 3123 "../src/dsql/parse.y" { yyval = make_node (nod_eql, 2, yyvsp[-2], yyvsp[0]); } break; case 766: +#line 3125 "../src/dsql/parse.y" { yyval = make_node (nod_lss, 2, yyvsp[-2], yyvsp[0]); } break; case 767: +#line 3127 "../src/dsql/parse.y" { yyval = make_node (nod_gtr, 2, yyvsp[-2], yyvsp[0]); } break; case 768: +#line 3129 "../src/dsql/parse.y" { yyval = make_node (nod_geq, 2, yyvsp[-2], yyvsp[0]); } break; case 769: +#line 3131 "../src/dsql/parse.y" { yyval = make_node (nod_leq, 2, yyvsp[-2], yyvsp[0]); } break; case 770: +#line 3133 "../src/dsql/parse.y" { yyval = make_node (nod_leq, 2, yyvsp[-2], yyvsp[0]); } break; case 771: +#line 3135 "../src/dsql/parse.y" { yyval = make_node (nod_geq, 2, yyvsp[-2], yyvsp[0]); } break; case 772: +#line 3137 "../src/dsql/parse.y" { yyval = make_node (nod_neq, 2, yyvsp[-2], yyvsp[0]); } break; case 773: +#line 3144 "../src/dsql/parse.y" { yyval = make_node (nod_eql_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 774: +#line 3146 "../src/dsql/parse.y" { yyval = make_node (nod_lss_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 775: +#line 3148 "../src/dsql/parse.y" { yyval = make_node (nod_gtr_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 776: +#line 3150 "../src/dsql/parse.y" { yyval = make_node (nod_geq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 777: +#line 3152 "../src/dsql/parse.y" { yyval = make_node (nod_leq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 778: +#line 3154 "../src/dsql/parse.y" { yyval = make_node (nod_leq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 779: +#line 3156 "../src/dsql/parse.y" { yyval = make_node (nod_geq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 780: +#line 3158 "../src/dsql/parse.y" { yyval = make_node (nod_neq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 781: +#line 3160 "../src/dsql/parse.y" { yyval = make_node (nod_eql_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 782: +#line 3162 "../src/dsql/parse.y" { yyval = make_node (nod_lss_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 783: +#line 3164 "../src/dsql/parse.y" { yyval = make_node (nod_gtr_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 784: +#line 3166 "../src/dsql/parse.y" { yyval = make_node (nod_geq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 785: +#line 3168 "../src/dsql/parse.y" { yyval = make_node (nod_leq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 786: +#line 3170 "../src/dsql/parse.y" { yyval = make_node (nod_leq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 787: +#line 3172 "../src/dsql/parse.y" { yyval = make_node (nod_geq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 788: +#line 3174 "../src/dsql/parse.y" { yyval = make_node (nod_neq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 791: +#line 3185 "../src/dsql/parse.y" { yyval = make_node (nod_between, 3, yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 792: +#line 3187 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, make_node (nod_between, 3, yyvsp[-5], yyvsp[-2], yyvsp[0])); } break; case 793: +#line 3192 "../src/dsql/parse.y" { yyval = make_node (nod_like, 2, yyvsp[-2], yyvsp[0]); } break; case 794: +#line 3194 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, make_node (nod_like, 2, yyvsp[-3], yyvsp[0])); } break; case 795: +#line 3196 "../src/dsql/parse.y" { yyval = make_node (nod_like, 3, yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 796: +#line 3198 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, make_node (nod_like, 3, yyvsp[-5], yyvsp[-2], yyvsp[0])); } break; case 797: +#line 3203 "../src/dsql/parse.y" { yyval = make_node (nod_eql_any, 2, yyvsp[-2], yyvsp[0]); } break; case 798: +#line 3205 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, make_node (nod_eql_any, 2, yyvsp[-3], yyvsp[0])); } break; case 799: +#line 3209 "../src/dsql/parse.y" { yyval = make_node (nod_containing, 2, yyvsp[-2], yyvsp[0]); } break; case 800: +#line 3211 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, make_node (nod_containing, 2, yyvsp[-3], yyvsp[0])); } break; case 801: +#line 3215 "../src/dsql/parse.y" { yyval = make_node (nod_starting, 2, yyvsp[-2], yyvsp[0]); } break; case 802: +#line 3217 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, make_node (nod_starting, 2, yyvsp[-3], yyvsp[0])); } break; case 803: +#line 3219 "../src/dsql/parse.y" { yyval = make_node (nod_starting, 2, yyvsp[-3], yyvsp[0]); } break; case 804: +#line 3221 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, make_node (nod_starting, 2, yyvsp[-4], yyvsp[0])); } break; case 805: +#line 3225 "../src/dsql/parse.y" { yyval = make_node (nod_exists, 1, yyvsp[-1]); } break; case 806: +#line 3229 "../src/dsql/parse.y" { yyval = make_node (nod_singular, 1, yyvsp[-1]); } break; case 807: +#line 3233 "../src/dsql/parse.y" { yyval = make_node (nod_missing, 1, yyvsp[-2]); } break; case 808: +#line 3235 "../src/dsql/parse.y" { yyval = make_node (nod_not, 1, make_node (nod_missing, 1, yyvsp[-3])); } break; case 810: +#line 3243 "../src/dsql/parse.y" { yyval = make_list (yyvsp[-1]); } break; case 811: +#line 3247 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 812: +#line 3258 "../src/dsql/parse.y" { yyval = make_node (nod_select_expr, e_sel_count, yyvsp[-7], yyvsp[-6], make_list (yyvsp[-5]), yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 813: +#line 3270 "../src/dsql/parse.y" { yyval = make_node (nod_select_expr, e_sel_count, yyvsp[-7], yyvsp[-6], make_list (yyvsp[-5]), yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0], MAKE_constant ((STR) 1, CONSTANT_SLONG)); } break; case 823: +#line 3288 "../src/dsql/parse.y" { yyval = make_node (nod_negate, 1, yyvsp[0]); } break; case 824: +#line 3290 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 825: +#line 3292 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_add2, 2, yyvsp[-2], yyvsp[0]); @@ -7471,12 +8070,15 @@ case 825: } break; case 826: +#line 3299 "../src/dsql/parse.y" { yyval = make_node (nod_concatenate, 2, yyvsp[-2], yyvsp[0]); } break; case 827: +#line 3301 "../src/dsql/parse.y" { yyval = make_node (nod_collate, e_coll_count, (NOD) yyvsp[0], yyvsp[-2]); } break; case 828: +#line 3303 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_subtract2, 2, yyvsp[-2], yyvsp[0]); @@ -7485,6 +8087,7 @@ case 828: } break; case 829: +#line 3310 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_multiply2, 2, yyvsp[-2], yyvsp[0]); @@ -7493,6 +8096,7 @@ case 829: } break; case 830: +#line 3317 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_divide2, 2, yyvsp[-2], yyvsp[0]); @@ -7501,32 +8105,41 @@ case 830: } break; case 831: +#line 3324 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 832: +#line 3326 "../src/dsql/parse.y" { yyval = yyvsp[-1]; } break; case 835: +#line 3334 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 836: +#line 3336 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 837: +#line 3338 "../src/dsql/parse.y" { yyval = make_node (nod_dbkey, 1, NULL); } break; case 838: +#line 3340 "../src/dsql/parse.y" { yyval = make_node (nod_dbkey, 1, yyvsp[-2]); } break; case 839: +#line 3342 "../src/dsql/parse.y" { yyval = make_node (nod_dom_value, 0, NULL); } break; case 840: +#line 3346 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 841: +#line 3351 "../src/dsql/parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -7544,6 +8157,7 @@ case 841: } break; case 842: +#line 3367 "../src/dsql/parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -7561,36 +8175,47 @@ case 842: } break; case 843: +#line 3383 "../src/dsql/parse.y" { yyval = make_node (nod_current_timestamp, 0, NULL); } break; case 844: +#line 3387 "../src/dsql/parse.y" { yyval = make_node (nod_array, 2, yyvsp[-3], make_list (yyvsp[-1])); } break; case 846: +#line 3392 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 848: +#line 3397 "../src/dsql/parse.y" { yyval = make_node (nod_negate, 1, yyvsp[0]); } break; case 849: +#line 3401 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_STRING); } break; case 850: +#line 3403 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 851: +#line 3405 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_DOUBLE); } break; case 852: +#line 3407 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SINT64); } break; case 853: +#line 3409 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SINT64); } break; case 855: +#line 3414 "../src/dsql/parse.y" { yyval = MAKE_str_constant ((STR) yyvsp[0], att_charset); } break; case 856: +#line 3416 "../src/dsql/parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -7608,6 +8233,7 @@ case 856: } break; case 857: +#line 3432 "../src/dsql/parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -7625,91 +8251,114 @@ case 857: } break; case 858: +#line 3448 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_TIMESTAMP); } break; case 859: +#line 3452 "../src/dsql/parse.y" { yyval = make_node (nod_parameter, 0, NULL); } break; case 860: +#line 3456 "../src/dsql/parse.y" { yyval = make_node (nod_user_name, 0, NULL); } break; case 861: +#line 3458 "../src/dsql/parse.y" { yyval = make_node (nod_user_name, 0, NULL); } break; case 862: +#line 3462 "../src/dsql/parse.y" { yyval = make_node (nod_current_role, 0, NULL); } break; case 863: +#line 3466 "../src/dsql/parse.y" { yyval = make_node (nod_internal_info, e_internal_info_count, MAKE_constant ((STR) internal_connection_id, CONSTANT_SLONG)); } break; case 864: +#line 3469 "../src/dsql/parse.y" { yyval = make_node (nod_internal_info, e_internal_info_count, MAKE_constant ((STR) internal_transaction_id, CONSTANT_SLONG)); } break; case 865: +#line 3474 "../src/dsql/parse.y" { yyval = make_node (nod_proc_internal_info, e_internal_info_count, MAKE_constant ((STR) internal_gdscode, CONSTANT_SLONG)); } break; case 866: +#line 3477 "../src/dsql/parse.y" { yyval = make_node (nod_proc_internal_info, e_internal_info_count, MAKE_constant ((STR) internal_sqlcode, CONSTANT_SLONG)); } break; case 867: +#line 3480 "../src/dsql/parse.y" { yyval = make_node (nod_proc_internal_info, e_internal_info_count, MAKE_constant ((STR) internal_rows_affected, CONSTANT_SLONG)); } break; case 868: +#line 3485 "../src/dsql/parse.y" { yyval = yyvsp[0]; } break; case 869: +#line 3487 "../src/dsql/parse.y" { ((STR) yyvsp[0])->str_charset = (TEXT *) yyvsp[-1]; yyval = yyvsp[0]; } break; case 871: +#line 3493 "../src/dsql/parse.y" { yyval = (NOD) - (SLONG) yyvsp[0]; } break; case 872: +#line 3497 "../src/dsql/parse.y" { if ((SLONG) yyvsp[0] > SHRT_POS_MAX) yyabandon (-842, isc_expec_short); /* Short integer expected */ yyval = yyvsp[0];} break; case 873: +#line 3504 "../src/dsql/parse.y" { if ((SLONG) yyvsp[0] > SHRT_NEG_MAX) yyabandon (-842, isc_expec_short); /* Short integer expected */ yyval = yyvsp[0];} break; case 874: +#line 3511 "../src/dsql/parse.y" { if ((SLONG) yyvsp[0] == 0) yyabandon (-842, isc_expec_positive); /* Positive number expected */ yyval = yyvsp[0];} break; case 875: +#line 3518 "../src/dsql/parse.y" { if ((SLONG) yyvsp[0] > SHRT_UNSIGNED_MAX) yyabandon (-842, isc_expec_ushort); /* Unsigned short integer expected */ yyval = yyvsp[0];} break; case 877: +#line 3526 "../src/dsql/parse.y" { yyval = (NOD) - (SLONG) yyvsp[0]; } break; case 878: +#line 3530 "../src/dsql/parse.y" { yyval = yyvsp[0];} break; case 883: +#line 3542 "../src/dsql/parse.y" { yyval = make_node (nod_agg_count, 0, NULL); } break; case 884: +#line 3544 "../src/dsql/parse.y" { yyval = make_node (nod_agg_count, 1, yyvsp[-1]); } break; case 885: +#line 3546 "../src/dsql/parse.y" { yyval = make_flag_node (nod_agg_count, NOD_AGG_DISTINCT, 1, yyvsp[-1]); } break; case 886: +#line 3549 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_agg_total2, 1, yyvsp[-1]); @@ -7718,6 +8367,7 @@ case 886: } break; case 887: +#line 3556 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_flag_node (nod_agg_total2, @@ -7728,6 +8378,7 @@ case 887: } break; case 888: +#line 3565 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_agg_average2, 1, yyvsp[-1]); @@ -7736,6 +8387,7 @@ case 888: } break; case 889: +#line 3572 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_flag_node (nod_agg_average2, @@ -7746,18 +8398,23 @@ case 889: } break; case 890: +#line 3581 "../src/dsql/parse.y" { yyval = make_node (nod_agg_min, 1, yyvsp[-1]); } break; case 891: +#line 3583 "../src/dsql/parse.y" { yyval = make_node (nod_agg_min, 1, yyvsp[-1]); } break; case 892: +#line 3585 "../src/dsql/parse.y" { yyval = make_node (nod_agg_max, 1, yyvsp[-1]); } break; case 893: +#line 3587 "../src/dsql/parse.y" { yyval = make_node (nod_agg_max, 1, yyvsp[-1]); } break; case 894: +#line 3593 "../src/dsql/parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_gen_id2, 2, yyvsp[-3], yyvsp[-1]); @@ -7766,89 +8423,116 @@ case 894: } break; case 895: +#line 3602 "../src/dsql/parse.y" { yyval = make_node (nod_extract, e_extract_count, yyvsp[-3], yyvsp[-1]); } break; case 896: +#line 3609 "../src/dsql/parse.y" { yyval = make_node (nod_substr, e_substr_count, yyvsp[-3], MAKE_constant ((STR) ((SLONG)(yyvsp[-1]) - 1), CONSTANT_SLONG), MAKE_constant ((STR) SHRT_POS_MAX, CONSTANT_SLONG)); } break; case 897: +#line 3613 "../src/dsql/parse.y" { yyval = make_node (nod_substr, e_substr_count, yyvsp[-5], MAKE_constant ((STR) ((SLONG)(yyvsp[-3]) - 1), CONSTANT_SLONG), MAKE_constant ((STR) (yyvsp[-1]), CONSTANT_SLONG)); } break; case 898: +#line 3617 "../src/dsql/parse.y" { yyval = make_node (nod_upcase, 1, yyvsp[-1]); } break; case 899: +#line 3621 "../src/dsql/parse.y" { yyval = make_node (nod_udf, 2, yyvsp[-3], yyvsp[-1]); } break; case 900: +#line 3623 "../src/dsql/parse.y" { yyval = make_node (nod_udf, 1, yyvsp[-2]); } break; case 901: +#line 3627 "../src/dsql/parse.y" { yyval = make_node (nod_cast, e_cast_count, yyvsp[-1], yyvsp[-3]); } break; case 904: +#line 3637 "../src/dsql/parse.y" { yyval = make_node (nod_searched_case, 2, make_node (nod_list, 2, make_node (nod_eql, 2, yyvsp[-3], yyvsp[-1]), make_node (nod_null, 0, NULL)), yyvsp[-3]); } break; case 905: +#line 3641 "../src/dsql/parse.y" { yyval = make_node (nod_coalesce, 2, yyvsp[-3], yyvsp[-1]); } break; case 908: +#line 3649 "../src/dsql/parse.y" { yyval = make_node (nod_simple_case, 3, yyvsp[-2], make_list(yyvsp[-1]), make_node (nod_null, 0, NULL)); } break; case 909: +#line 3651 "../src/dsql/parse.y" { yyval = make_node (nod_simple_case, 3, yyvsp[-4], make_list(yyvsp[-3]), yyvsp[-1]); } break; case 910: +#line 3655 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 911: +#line 3657 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-4], make_node (nod_list, 2, yyvsp[-2], yyvsp[0])); } break; case 912: +#line 3661 "../src/dsql/parse.y" { yyval = make_node (nod_searched_case, 2, make_list(yyvsp[-1]), make_node (nod_null, 0, NULL)); } break; case 913: +#line 3663 "../src/dsql/parse.y" { yyval = make_node (nod_searched_case, 2, make_list(yyvsp[-3]), yyvsp[-1]); } break; case 914: +#line 3667 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 915: +#line 3669 "../src/dsql/parse.y" { yyval = make_node (nod_list, 2, yyvsp[-4], make_node (nod_list, 2, yyvsp[-2], yyvsp[0])); } break; case 919: +#line 3682 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR)blr_extract_year, CONSTANT_SLONG); } break; case 920: +#line 3684 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR)blr_extract_month, CONSTANT_SLONG); } break; case 921: +#line 3686 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR)blr_extract_day, CONSTANT_SLONG); } break; case 922: +#line 3688 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR)blr_extract_hour, CONSTANT_SLONG); } break; case 923: +#line 3690 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR)blr_extract_minute, CONSTANT_SLONG); } break; case 924: +#line 3692 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR)blr_extract_second, CONSTANT_SLONG); } break; case 925: +#line 3694 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR)blr_extract_weekday, CONSTANT_SLONG); } break; case 926: +#line 3696 "../src/dsql/parse.y" { yyval = MAKE_constant ((STR)blr_extract_yearday, CONSTANT_SLONG); } break; case 929: +#line 3704 "../src/dsql/parse.y" { yyval = make_node (nod_null, 0, NULL); } break; +#line 8532 "../src/dsql/dsql.tab.c" } DSQL_DSQL_yyssp -= yym; yystate = *DSQL_DSQL_yyssp; diff --git a/src/extern/editline/MANIFEST b/src/extern/editline/MANIFEST new file mode 100644 index 0000000000..25231c797a --- /dev/null +++ b/src/extern/editline/MANIFEST @@ -0,0 +1,15 @@ +File Name Description +-------------------------------------------------------- +README Release notes and copyright +MANIFEST This shipping list +Make.os9 OS-9 makefile +Makefile Unix makefile +complete.c Filename completion routines +editline.3 Manual page for editline library +editline.c Line-editing routines +editline.h Internal library header file +os9.h OS-9-specific declarations +sysos9.c OS-9-specific routines +sysunix.c Unix-specific routines +testit.c Test driver +unix.h Unix-specific declarations diff --git a/src/extern/editline/Make.os9 b/src/extern/editline/Make.os9 new file mode 100644 index 0000000000..0a7d5eb5a4 --- /dev/null +++ b/src/extern/editline/Make.os9 @@ -0,0 +1,19 @@ +## $Revision: 1.1 $ +## +## OS-9 makefile for editline library. +## + +.SUFFIXES: + +RFILES = editline.r complete.r sysos9.r + +%.r: %.c + cc68 -r -Dstrchr=index -Dstrrchr=rindex -DNEED_STRDUP -DSYS_OS9 $*.c + +testit: testit.r editline.lib + cc68 -f=testit testit.r -l=editline.lib + +$(RFILES): $(RFILES:%.r=%.c) + +editline.lib: $(RFILES) + cat $(RFILES) >$@ diff --git a/src/extern/editline/Makefile b/src/extern/editline/Makefile new file mode 100644 index 0000000000..372ea320d7 --- /dev/null +++ b/src/extern/editline/Makefile @@ -0,0 +1,77 @@ +## $Revision: 1.1 $ +## +## Unix makefile for editline library. +## + +## Set your options: +## -DANSI_ARROWS ANSI arrows keys work like emacs. +## -DHAVE_STDLIB Have . +## -DHAVE_TCGETATTR Have tcgetattr(), tcsetattr(). +## -DHAVE_TERMIO Have "struct termio" and +## (If neither of above two, we use and BSD ioctl's) +## -DHIDE Make static functions static (non debug). +## -DHIST_SIZE=n History size. +## -DNEED_STRDUP Don't have strdup(). +## -DUNIQUE_HISTORY Don't save command if same as last one. +## -DUSE_DIRENT Use , not ? +## -DUSE_TERMCAP Use the termcap library for terminal size +## see LDFLAGS, below, if you set this. +## -DNEED_PERROR Don't have perror() (used in testit) +## -DDO_SIGTSTP Send SIGTSTP on "suspend" key +DEFS = -DANSI_ARROWS -DHAVE_STDLIB -DHAVE_TCGETATTR -DHIDE -DUSE_DIRENT -DSYS_UNIX -DNEED_STRDUP + +## Set your C compiler: +WARN = -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings \ + -Wunused -Wcomment -Wswitch +CC = gcc -ansi $(WARN) +#CFLAGS = $(DEFS) -O -g +#CC = gcc +CFLAGS = $(DEFS) -g + +## If you have -DUSE_TERMCAP, set this as appropriate: +#LDFLAGS = -ltermlib +#LDFLAGS = -ltermcap + +## Set ranlib as appropriate: +RANLIB = ranlib +#RANLIB = echo + +## End of configuration. + +SOURCES = editline.c complete.c sysunix.c +OBJECTS = editline.o complete.o sysunix.o + +FIREBIRD_LIB=../../gen/firebird/lib +all: $(FIREBIRD_LIB)/libedit.a +#all: libedit.a + +testit: testit.c libedit.a + $(CC) $(CFLAGS) -o testit testit.c libedit.a $(LDFLAGS) + +shar: FORCE + shar `sed -e 1,2d -e 's/[ ].*//' shar + +FORCE: + +clean: + rm -f *.[oa] testit foo core tags lint lint.all a.out Part01 + +lint: testit + lint -a -b -u -x $(DEFS) $(SOURCES) testit.c >lint.all + sed -e '/warning: function prototype not in scope/d' \ + -e '/warning: old style argument declaration/'d \ + -e '/mix of old and new style function declaration/'d \ + lint + + +$(FIREBIRD_LIB)/libedit.a: $(OBJECTS) + @rm -f $@ + ar r $@ $(OBJECTS) + $(RANLIB) $@ + +libedit.a: $(OBJECTS) + @rm -f $@ + ar r $@ $(OBJECTS) + $(RANLIB) $@ + +$(OBJECTS): editline.h diff --git a/src/extern/editline/README b/src/extern/editline/README new file mode 100644 index 0000000000..dcd1685f8d --- /dev/null +++ b/src/extern/editline/README @@ -0,0 +1,48 @@ +$Revision: 1.1 $ + +This is a line-editing library. It can be linked into almost any +program to provide command-line editing and recall. + +It is call-compatible with the FSF readline library, but it is a +fraction of the size (and offers fewer features). It does not use +standard I/O. It is distributed under a "C News-like" copyright. + +Configuration is done in the Makefile. Type "make testit" to get +a small slow shell for testing. + +This contains some changes since the posting to comp.sources.misc: + - Bugfix for completion on absolute pathnames. + - Better handling of M-n versus showing raw 8bit chars. + - Better signal handling. + - Now supports termios/termio/sgttyb ioctl's. + - Add M-m command to toggle how 8bit data is displayed. +The following changes, made since the last public release, come from +J.G. Vons : + - History-searching no longer redraws the line wrong + - Added ESC-ESC as synonym for ESC-? + - SIGQUIT (normally ^\) now sends a signal, not indicating EOF. + - Fixed some typo's and unclear wording in the manpage. + - Fixed completion when all entries shared a common prefix. + - Fixed some meta-char line-redrawing bugs. + +Enjoy, + Rich $alz + + + Copyright 1992,1993 Simmule Turner and Rich Salz. All rights reserved. + + This software is not subject to any license of the American Telephone + and Telegraph Company or of the Regents of the University of California. + + Permission is granted to anyone to use this software for any purpose on + any computer system, and to alter it and redistribute it freely, subject + to the following restrictions: + 1. The authors are not responsible for the consequences of use of this + software, no matter how awful, even if they arise from flaws in it. + 2. The origin of this software must not be misrepresented, either by + explicit claim or by omission. Since few users ever read sources, + credits must appear in the documentation. + 3. Altered versions must be plainly marked as such, and must not be + misrepresented as being the original software. Since few users + ever read sources, credits must appear in the documentation. + 4. This notice may not be removed or altered. diff --git a/src/extern/editline/complete.c b/src/extern/editline/complete.c new file mode 100644 index 0000000000..c5c7bd50ba --- /dev/null +++ b/src/extern/editline/complete.c @@ -0,0 +1,219 @@ +/* $Revision: 1.1 $ +** +** History and file completion functions for editline library. +*/ +#include "editline.h" + + +#if defined(NEED_STRDUP) +/* +** Return an allocated copy of a string. +*/ +char * +strdup(p) + char *p; +{ + char *new; + + if ((new = NEW(char, strlen(p) + 1)) != NULL) + (void)strcpy(new, p); + return new; +} +#endif /* defined(NEED_STRDUP) */ + +/* +** strcmp-like sorting predicate for qsort. +*/ +STATIC int +compare(p1, p2) + CONST void *p1; + CONST void *p2; +{ + CONST char **v1; + CONST char **v2; + + v1 = (CONST char **)p1; + v2 = (CONST char **)p2; + return strcmp(*v1, *v2); +} + +/* +** Fill in *avp with an array of names that match file, up to its length. +** Ignore . and .. . +*/ +STATIC int +FindMatches(dir, file, avp) + char *dir; + char *file; + char ***avp; +{ + char **av; + char **new; + char *p; + DIR *dp; + DIRENTRY *ep; + SIZE_T ac; + SIZE_T len; + + if ((dp = opendir(dir)) == NULL) + return 0; + + av = NULL; + ac = 0; + len = strlen(file); + while ((ep = readdir(dp)) != NULL) { + p = ep->d_name; + if (p[0] == '.' && (p[1] == '\0' || (p[1] == '.' && p[2] == '\0'))) + continue; + if (len && strncmp(p, file, len) != 0) + continue; + + if ((ac % MEM_INC) == 0) { + if ((new = NEW(char*, ac + MEM_INC)) == NULL) + break; + if (ac) { + COPYFROMTO(new, av, ac * sizeof (char **)); + DISPOSE(av); + } + *avp = av = new; + } + + if ((av[ac] = strdup(p)) == NULL) { + if (ac == 0) + DISPOSE(av); + break; + } + ac++; + } + + /* Clean up and return. */ + (void)closedir(dp); + if (ac) + qsort(av, ac, sizeof (char **), compare); + return ac; +} + +/* +** Split a pathname into allocated directory and trailing filename parts. +*/ +STATIC int +SplitPath(path, dirpart, filepart) + char *path; + char **dirpart; + char **filepart; +{ + static char DOT[] = "."; + char *dpart; + char *fpart; + + if ((fpart = strrchr(path, '/')) == NULL) { + if ((dpart = strdup(DOT)) == NULL) + return -1; + if ((fpart = strdup(path)) == NULL) { + DISPOSE(dpart); + return -1; + } + } + else { + if ((dpart = strdup(path)) == NULL) + return -1; + dpart[fpart - path + 1] = '\0'; + if ((fpart = strdup(++fpart)) == NULL) { + DISPOSE(dpart); + return -1; + } + } + *dirpart = dpart; + *filepart = fpart; + return 0; +} + +/* +** Attempt to complete the pathname, returning an allocated copy. +** Fill in *unique if we completed it, or set it to 0 if ambiguous. +*/ +char * +rl_complete(pathname, unique) + char *pathname; + int *unique; +{ + char **av; + char *dir; + char *file; + char *new; + char *p; + SIZE_T ac; + SIZE_T end; + SIZE_T i; + SIZE_T j; + SIZE_T len; + + if (SplitPath(pathname, &dir, &file) < 0) + return NULL; + if ((ac = FindMatches(dir, file, &av)) == 0) { + DISPOSE(dir); + DISPOSE(file); + return NULL; + } + + p = NULL; + len = strlen(file); + if (ac == 1) { + /* Exactly one match -- finish it off. */ + *unique = 1; + j = strlen(av[0]) - len + 2; + if ((p = NEW(char, j + 1)) != NULL) { + COPYFROMTO(p, av[0] + len, j); + if ((new = NEW(char, strlen(dir) + strlen(av[0]) + 2)) != NULL) { + (void)strcpy(new, dir); + (void)strcat(new, "/"); + (void)strcat(new, av[0]); + rl_add_slash(new, p); + DISPOSE(new); + } + } + } + else { + /* Find largest matching substring. */ + for (*unique = 0, i = len, end = strlen(av[0]); i < end; i++) + for (j = 1; j < ac; j++) + if (av[0][i] != av[j][i]) + goto breakout; +breakout: + if (i > len) { + j = i - len + 1; + if ((p = NEW(char, j)) != NULL) { + COPYFROMTO(p, av[0] + len, j); + p[j - 1] = '\0'; + } + } + } + + /* Clean up and return. */ + DISPOSE(dir); + DISPOSE(file); + for (i = 0; i < ac; i++) + DISPOSE(av[i]); + DISPOSE(av); + return p; +} + +/* +** Return all possible completions. +*/ +int +rl_list_possib(pathname, avp) + char *pathname; + char ***avp; +{ + char *dir; + char *file; + int ac; + + if (SplitPath(pathname, &dir, &file) < 0) + return 0; + ac = FindMatches(dir, file, avp); + DISPOSE(dir); + DISPOSE(file); + return ac; +} diff --git a/src/extern/editline/editline.3 b/src/extern/editline/editline.3 new file mode 100644 index 0000000000..159cc7f87b --- /dev/null +++ b/src/extern/editline/editline.3 @@ -0,0 +1,178 @@ +.\" $Revision: 1.1 $ +.TH EDITLINE 3 +.SH NAME +editline \- command-line editing library with history +.SH SYNOPSIS +.nf +.B "char *" +.B "readline(prompt)" +.B " char *prompt;" + +.B "void" +.B "add_history(line)" +.B " char *line;" +.fi +.SH DESCRIPTION +.I Editline +is a library that provides an line-editing interface with text recall. +It is intended to be compatible with the +.I readline +library provided by the Free Software Foundation, but much smaller. +The bulk of this manual page describes the user interface. +.PP +The +.I readline +routine returns a line of text with the trailing newline removed. +The data is returned in a buffer allocated with +.IR malloc (3), +so the space should be released with +.IR free (3) +when the calling program is done with it. +Before accepting input from the user, the specified +.I prompt +is displayed on the terminal. +.PP +The +.I add_history +routine makes a copy of the specified +.I line +and adds it to the internal history list. +.SS "User Interface" +A program that uses this library provides a simple emacs-like editing +interface to its users. +A line may be edited before it is sent to the calling program by typing either +control characters or escape sequences. +A control character, shown as a caret followed by a letter, is typed by +holding down the ``control'' key while the letter is typed. +For example, ``^A'' is a control-A. +An escape sequence is entered by typing the ``escape'' key followed by one or +more characters. +The escape key is abbreviated as ``ESC''. +Note that unlike control keys, case matters in escape sequences; ``ESC\ F'' +is not the same as ``ESC\ f''. +.PP +An editing command may be typed anywhere on the line, not just at the +beginning. +In addition, a return may also be typed anywhere on the line, not just at +the end. +.PP +Most editing commands may be given a repeat count, +.IR n , +where +.I n +is a number. +To enter a repeat count, type the escape key, the number, and then +the command to execute. +For example, ``ESC\ 4\ ^f'' moves forward four characters. +If a command may be given a repeat count then the text ``[n]'' is given at the +end of its description. +.PP +The following control characters are accepted: +.RS +.nf +.ta \w'ESC DEL 'u +^A Move to the beginning of the line +^B Move left (backwards) [n] +^D Delete character [n] +^E Move to end of line +^F Move right (forwards) [n] +^G Ring the bell +^H Delete character before cursor (backspace key) [n] +^I Complete filename (tab key); see below +^J Done with line (return key) +^K Kill to end of line (or column [n]) +^L Redisplay line +^M Done with line (alternate return key) +^N Get next line from history [n] +^P Get previous line from history [n] +^R Search backward (forward if [n]) through history for text; +\& prefixing the string with a caret (^) forces it to +\& match only at the beginning of a history line +^T Transpose characters +^V Insert next character, even if it is an edit command +^W Wipe to the mark +^X^X Exchange current location and mark +^Y Yank back last killed text +^[ Start an escape sequence (escape key) +^]c Move forward to next character ``c'' +^? Delete character before cursor (delete key) [n] +.fi +.RE +.PP +The following escape sequences are provided. +.RS +.nf +.ta \w'ESC DEL 'u +ESC\ ^H Delete previous word (backspace key) [n] +ESC\ DEL Delete previous word (delete key) [n] +ESC\ ESC Show possible completions; see below +ESC\ SP Set the mark (space key); see ^X^X and ^Y above +ESC\ . Get the last (or [n]'th) word from previous line +ESC\ ? Show possible completions; see below +ESC\ < Move to start of history +ESC\ > Move to end of history +ESC\ b Move backward a word [n] +ESC\ d Delete word under cursor [n] +ESC\ f Move forward a word [n] +ESC\ l Make word lowercase [n] +ESC\ m Toggle if 8bit chars display as themselves or with +\& an ``M\-'' prefix +ESC\ u Make word uppercase [n] +ESC\ y Yank back last killed text +ESC\ w Make area up to mark yankable +ESC\ nn Set repeat count to the number nn +ESC\ C Read from environment variable ``_C_'', where C is +\& an uppercase letter +.fi +.RE +.PP +The +.I editline +library has a small macro facility. +If you type the escape key followed by an uppercase letter, +.IR C , +then the contents of the environment variable +.I _C_ +are read in as if you had typed them at the keyboard. +For example, if the variable +.I _L_ +contains the following: +.RS +^A^Kecho '^V^[[H^V^[[2J'^M +.RE +Then typing ``ESC L'' will move to the beginning of the line, kill the +entire line, enter the echo command needed to clear the terminal (if your +terminal is like a VT-100), and send the line back to the shell. +.PP +The +.I editline +library also does filename completion. +Suppose the root directory has the following files in it: +.RS +.nf +.ta \w'core 'u +bin vmunix +core vmunix.old +.fi +.RE +If you type ``rm\ /v'' and then the tab key. +.I Editline +will then finish off as much of the name as possible by adding ``munix''. +Because the name is not unique, it will then beep. +If you type the escape key followed by either a question mark or another +escape, it will display the two choices. +If you then type a period and a tab, the library will finish off the filename +for you: +.RS +.nf +.RI "rm /v[TAB]" munix ".[TAB]" old +.fi +.RE +The tab key is shown by ``[TAB]'' and the automatically-entered text +is shown in italics. +.SH "BUGS AND LIMITATIONS" +Cannot handle lines more than 80 columns. +.SH AUTHORS +Simmule R. Turner +and Rich $alz . +Original manual page by DaviD W. Sanderson . diff --git a/src/extern/editline/editline.c b/src/extern/editline/editline.c new file mode 100644 index 0000000000..0930675493 --- /dev/null +++ b/src/extern/editline/editline.c @@ -0,0 +1,1531 @@ +/* $Revision: 1.1 $ +** +** Main editing routines for editline library. +*/ +#include "editline.h" +#include +#include + +/* +** Manifest constants. +*/ +#define SCREEN_WIDTH 80 +#define SCREEN_ROWS 24 +#define NO_ARG (-1) +#define DEL 127 +#define TAB '\t' +#define CTL(x) ((x) & 0x1F) +#define ISCTL(x) ((x) && (x) < ' ') +#define UNCTL(x) ((x) + 64) +#define META(x) ((x) | 0x80) +#define ISMETA(x) ((x) & 0x80) +#define UNMETA(x) ((x) & 0x7F) +#define MAPSIZE 32 +#define METAMAPSIZE 16 +#if !defined(HIST_SIZE) +#define HIST_SIZE 20 +#endif /* !defined(HIST_SIZE) */ + +typedef CONST CHAR *STRING; + +/* +** Command status codes. +*/ +typedef enum _STATUS { + CSdone, CSeof, CSmove, CSdispatch, CSstay, CSsignal +} STATUS; + +/* +** The type of case-changing to perform. +*/ +typedef enum _CASE { + TOupper, TOlower +} CASE; + +/* +** Key to command mapping. +*/ +typedef struct _KEYMAP { + CHAR Key; + char Active; + STATUS (*Function)(); +} KEYMAP; + +/* +** Command history structure. +*/ +typedef struct _HISTORY { + int Size; + int Pos; + CHAR *Lines[HIST_SIZE]; +} HISTORY; + +/* +** Globals. +*/ +int rl_eof; +int rl_erase; +int rl_intr; +int rl_kill; +int rl_quit; +#if defined(DO_SIGTSTP) +int rl_susp; +#endif /* defined(DO_SIGTSTP) */ + +STATIC CHAR NIL[] = ""; +STATIC STRING Input = NIL; +STATIC CHAR *Line; +STATIC CONST char *Prompt; +STATIC CHAR *Yanked; +STATIC char *Screen; +STATIC char NEWLINE[]= CRLF; +STATIC HISTORY H; +STATIC int Repeat; +STATIC int End; +STATIC int Mark; +STATIC int OldPoint; +STATIC int Point; +STATIC int PushBack; +STATIC int Pushed; +STATIC int Signal; +FORWARD KEYMAP Map[MAPSIZE]; +FORWARD KEYMAP MetaMap[METAMAPSIZE]; +STATIC SIZE_T Length; +STATIC SIZE_T ScreenCount; +STATIC SIZE_T ScreenSize; +STATIC char *backspace; +STATIC int TTYwidth; +STATIC int TTYrows; + +/* Display print 8-bit chars as `M-x' or as the actual 8-bit char? */ +int rl_meta_chars = 1; + +/* +** Declarations. +*/ +STATIC CHAR *editinput(); +extern int read(); +extern int write(); +#if defined(USE_TERMCAP) +extern char *getenv(); +extern char *tgetstr(); +extern int tgetent(); +extern int tgetnum(); +#endif /* defined(USE_TERMCAP) */ + +/* +** TTY input/output functions. +*/ + +STATIC void +TTYflush() +{ + if (ScreenCount) { + (void)write(1, Screen, ScreenCount); + ScreenCount = 0; + } +} + +STATIC void +TTYput(c) + CONST CHAR c; +{ + Screen[ScreenCount] = c; + if (++ScreenCount >= ScreenSize - 1) { + ScreenSize += SCREEN_INC; + RENEW(Screen, char, ScreenSize); + } +} + +STATIC void +TTYputs(p) + STRING p; +{ + while (*p) + TTYput(*p++); +} + +STATIC void +TTYshow(c) + CHAR c; +{ + if (c == DEL) { + TTYput('^'); + TTYput('?'); + } + else if (c == TAB) { + /* XXX */ + } + else if (ISCTL(c)) { + TTYput('^'); + TTYput(UNCTL(c)); + } + else if (rl_meta_chars && ISMETA(c)) { + TTYput('M'); + TTYput('-'); + TTYput(UNMETA(c)); + } + else + TTYput(c); +} + +STATIC void +TTYstring(p) + CHAR *p; +{ + while (*p) + TTYshow(*p++); +} + +STATIC unsigned int +TTYget() +{ + CHAR c; + + TTYflush(); + if (Pushed) { + Pushed = 0; + return PushBack; + } + if (*Input) + return *Input++; + return read(0, &c, (SIZE_T)1) == 1 ? c : EOF; +} + +#define TTYback() (backspace ? TTYputs((STRING)backspace) : TTYput('\b')) + +STATIC void +TTYbackn(n) + int n; +{ + while (--n >= 0) + TTYback(); +} + +STATIC void +TTYinfo() +{ + static int init; +#if defined(USE_TERMCAP) + char *term; + char buff[2048]; + char *bp; + char *p; +#endif /* defined(USE_TERMCAP) */ +#if defined(TIOCGWINSZ) + struct winsize W; +#endif /* defined(TIOCGWINSZ) */ + + if (init) { +#if defined(TIOCGWINSZ) + /* Perhaps we got resized. */ + if (ioctl(0, TIOCGWINSZ, &W) >= 0 + && W.ws_col > 0 && W.ws_row > 0) { + TTYwidth = (int)W.ws_col; + TTYrows = (int)W.ws_row; + } +#endif /* defined(TIOCGWINSZ) */ + return; + } + init++; + + TTYwidth = TTYrows = 0; +#if defined(USE_TERMCAP) + bp = &buff[0]; + if ((term = getenv("TERM")) == NULL) + term = "dumb"; + if (tgetent(buff, term) < 0) { + TTYwidth = SCREEN_WIDTH; + TTYrows = SCREEN_ROWS; + return; + } + p = tgetstr("le", &bp); + backspace = p ? strdup(p) : NULL; + TTYwidth = tgetnum("co"); + TTYrows = tgetnum("li"); +#endif /* defined(USE_TERMCAP) */ + +#if defined(TIOCGWINSZ) + if (ioctl(0, TIOCGWINSZ, &W) >= 0) { + TTYwidth = (int)W.ws_col; + TTYrows = (int)W.ws_row; + } +#endif /* defined(TIOCGWINSZ) */ + + if (TTYwidth <= 0 || TTYrows <= 0) { + TTYwidth = SCREEN_WIDTH; + TTYrows = SCREEN_ROWS; + } +} + + +/* +** Print an array of words in columns. +*/ +STATIC void +columns(ac, av) + int ac; + CHAR **av; +{ + CHAR *p; + int i; + int j; + int k; + int len; + int skip; + int longest; + int cols; + + /* Find longest name, determine column count from that. */ + for (longest = 0, i = 0; i < ac; i++) + if ((j = strlen((char *)av[i])) > longest) + longest = j; + cols = TTYwidth / (longest + 3); + + TTYputs((STRING)NEWLINE); + for (skip = ac / cols + 1, i = 0; i < skip; i++) { + for (j = i; j < ac; j += skip) { + for (p = av[j], len = strlen((char *)p), k = len; --k >= 0; p++) + TTYput(*p); + if (j + skip < ac) + while (++len < longest + 3) + TTYput(' '); + } + TTYputs((STRING)NEWLINE); + } +} + +STATIC void +reposition() +{ + int i; + CHAR *p; + + TTYput('\r'); + TTYputs((STRING)Prompt); + for (i = Point, p = Line; --i >= 0; p++) + TTYshow(*p); +} + +STATIC void +left(Change) + STATUS Change; +{ + CHAR c; + + TTYback(); + if (Point) { + c = Line[Point - 1]; + if (c == TAB) { + /* XXX */ + } + else if (ISCTL(c)) + TTYback(); + else if (rl_meta_chars && ISMETA(c)) { + TTYback(); + TTYback(); + } + } + if (Change == CSmove) + Point--; +} + +STATIC void +right(Change) + STATUS Change; +{ + TTYshow(Line[Point]); + if (Change == CSmove) + Point++; +} + +STATIC STATUS +ring_bell() +{ + TTYput('\07'); + TTYflush(); + return CSstay; +} + +STATIC STATUS +do_macro(c) + unsigned int c; +{ + CHAR name[4]; + + name[0] = '_'; + name[1] = c; + name[2] = '_'; + name[3] = '\0'; + + if ((Input = (CHAR *)getenv((char *)name)) == NULL) { + Input = NIL; + return ring_bell(); + } + return CSstay; +} + +STATIC STATUS +do_forward(move) + STATUS move; +{ + int i; + CHAR *p; + + i = 0; + do { + p = &Line[Point]; + for ( ; Point < End && (*p == ' ' || !isalnum(*p)); Point++, p++) + if (move == CSmove) + right(CSstay); + + for (; Point < End && isalnum(*p); Point++, p++) + if (move == CSmove) + right(CSstay); + + if (Point == End) + break; + } while (++i < Repeat); + + return CSstay; +} + +STATIC STATUS +do_case(type) + CASE type; +{ + int i; + int end; + int count; + CHAR *p; + + (void)do_forward(CSstay); + if (OldPoint != Point) { + if ((count = Point - OldPoint) < 0) + count = -count; + Point = OldPoint; + if ((end = Point + count) > End) + end = End; + for (i = Point, p = &Line[i]; i < end; i++, p++) { + if (type == TOupper) { + if (islower(*p)) + *p = toupper(*p); + } + else if (isupper(*p)) + *p = tolower(*p); + right(CSmove); + } + } + return CSstay; +} + +STATIC STATUS +case_down_word() +{ + return do_case(TOlower); +} + +STATIC STATUS +case_up_word() +{ + return do_case(TOupper); +} + +STATIC void +ceol() +{ + int extras; + int i; + CHAR *p; + + for (extras = 0, i = Point, p = &Line[i]; i <= End; i++, p++) { + TTYput(' '); + if (*p == TAB) { + /* XXX */ + } + else if (ISCTL(*p)) { + TTYput(' '); + extras++; + } + else if (rl_meta_chars && ISMETA(*p)) { + TTYput(' '); + TTYput(' '); + extras += 2; + } + } + + for (i += extras; i > Point; i--) + TTYback(); +} + +STATIC void +clear_line() +{ + Point = -strlen(Prompt); + TTYput('\r'); + ceol(); + Point = 0; + End = 0; + Line[0] = '\0'; +} + +STATIC STATUS +insert_string(p) + CHAR *p; +{ + SIZE_T len; + int i; + CHAR *new; + CHAR *q; + + len = strlen((char *)p); + if (End + len >= Length) { + if ((new = NEW(CHAR, Length + len + MEM_INC)) == NULL) + return CSstay; + if (Length) { + COPYFROMTO(new, Line, Length); + DISPOSE(Line); + } + Line = new; + Length += len + MEM_INC; + } + + for (q = &Line[Point], i = End - Point; --i >= 0; ) + q[len + i] = q[i]; + COPYFROMTO(&Line[Point], p, len); + End += len; + Line[End] = '\0'; + TTYstring(&Line[Point]); + Point += len; + + return Point == End ? CSstay : CSmove; +} + +STATIC STATUS +redisplay() +{ + TTYputs((STRING)NEWLINE); + TTYputs((STRING)Prompt); + TTYstring(Line); + return CSmove; +} + +STATIC STATUS +redisplay_no_nl() +{ + TTYput('\r'); + TTYputs((STRING)Prompt); + TTYstring(Line); + return CSmove; +} + +STATIC STATUS +toggle_meta_mode() +{ + rl_meta_chars = !rl_meta_chars; + return redisplay(); +} + + +STATIC CHAR * +next_hist() +{ + return H.Pos >= H.Size - 1 ? NULL : H.Lines[++H.Pos]; +} + +STATIC CHAR * +prev_hist() +{ + return H.Pos == 0 ? NULL : H.Lines[--H.Pos]; +} + +STATIC STATUS +do_insert_hist(p) + CHAR *p; +{ + if (p == NULL) + return ring_bell(); + Point = 0; + reposition(); + ceol(); + End = 0; + return insert_string(p); +} + +STATIC STATUS +do_hist(move) + CHAR *(*move)(); +{ + CHAR *p; + int i; + + i = 0; + do { + if ((p = (*move)()) == NULL) + return ring_bell(); + } while (++i < Repeat); + return do_insert_hist(p); +} + +STATIC STATUS +h_next() +{ + return do_hist(next_hist); +} + +STATIC STATUS +h_prev() +{ + return do_hist(prev_hist); +} + +STATIC STATUS +h_first() +{ + return do_insert_hist(H.Lines[H.Pos = 0]); +} + +STATIC STATUS +h_last() +{ + return do_insert_hist(H.Lines[H.Pos = H.Size - 1]); +} + +/* +** Return zero if pat appears as a substring in text. +*/ +STATIC int +substrcmp(text, pat, len) + char *text; + char *pat; + int len; +{ + CHAR c; + + if ((c = *pat) == '\0') + return *text == '\0'; + for ( ; *text; text++) + if (*text == c && strncmp(text, pat, len) == 0) + return 0; + return 1; +} + +STATIC CHAR * +search_hist(search, move) + CHAR *search; + CHAR *(*move)(); +{ + static CHAR *old_search; + int len; + int pos; + int (*match)(); + char *pat; + + /* Save or get remembered search pattern. */ + if (search && *search) { + if (old_search) + DISPOSE(old_search); + old_search = (CHAR *)strdup((char *)search); + } + else { + if (old_search == NULL || *old_search == '\0') + return NULL; + search = old_search; + } + + /* Set up pattern-finder. */ + if (*search == '^') { + match = strncmp; + pat = (char *)(search + 1); + } + else { + match = substrcmp; + pat = (char *)search; + } + len = strlen(pat); + + for (pos = H.Pos; (*move)() != NULL; ) + if ((*match)((char *)H.Lines[H.Pos], pat, len) == 0) + return H.Lines[H.Pos]; + H.Pos = pos; + return NULL; +} + +STATIC STATUS +h_search() +{ + static int Searching; + CONST char *old_prompt; + CHAR *(*move)(); + CHAR *p; + + if (Searching) + return ring_bell(); + Searching = 1; + + clear_line(); + old_prompt = Prompt; + Prompt = "Search: "; + TTYputs((STRING)Prompt); + move = Repeat == NO_ARG ? prev_hist : next_hist; + p = editinput(); + Searching = 0; + if (p == NULL && Signal > 0) { + Signal = 0; + clear_line(); + Prompt = old_prompt; + return redisplay_no_nl(); + } + p = search_hist(p, move); + clear_line(); + Prompt = old_prompt; + if (p == NULL) { + (void)ring_bell(); + return redisplay_no_nl(); + } + return do_insert_hist(p); +} + +STATIC STATUS +fd_char() +{ + int i; + + i = 0; + do { + if (Point >= End) + break; + right(CSmove); + } while (++i < Repeat); + return CSstay; +} + +STATIC void +save_yank(begin, i) + int begin; + int i; +{ + if (Yanked) { + DISPOSE(Yanked); + Yanked = NULL; + } + + if (i < 1) + return; + + if ((Yanked = NEW(CHAR, (SIZE_T)i + 1)) != NULL) { + COPYFROMTO(Yanked, &Line[begin], i); + Yanked[i] = '\0'; + } +} + +STATIC STATUS +delete_string(count) + int count; +{ + int i; + CHAR *p; + + if (count <= 0 || End == Point) + return ring_bell(); + + if (count == 1 && Point == End - 1) { + /* Optimize common case of delete at end of line. */ + End--; + p = &Line[Point]; + i = 1; + TTYput(' '); + if (*p == TAB) { + /* XXX */ + } + else if (ISCTL(*p)) { + i = 2; + TTYput(' '); + } + else if (rl_meta_chars && ISMETA(*p)) { + i = 3; + TTYput(' '); + TTYput(' '); + } + TTYbackn(i); + *p = '\0'; + return CSmove; + } + if (Point + count > End && (count = End - Point) <= 0) + return CSstay; + + if (count > 1) + save_yank(Point, count); + + ceol(); + for (p = &Line[Point], i = End - (Point + count) + 1; --i >= 0; p++) + p[0] = p[count]; + End -= count; + TTYstring(&Line[Point]); + return CSmove; +} + +STATIC STATUS +bk_char() +{ + int i; + + i = 0; + do { + if (Point == 0) + break; + left(CSmove); + } while (++i < Repeat); + + return CSstay; +} + +STATIC STATUS +bk_del_char() +{ + int i; + + i = 0; + do { + if (Point == 0) + break; + left(CSmove); + } while (++i < Repeat); + + return delete_string(i); +} + +STATIC STATUS +kill_line() +{ + int i; + + if (Repeat != NO_ARG) { + if (Repeat < Point) { + i = Point; + Point = Repeat; + reposition(); + (void)delete_string(i - Point); + } + else if (Repeat > Point) { + right(CSmove); + (void)delete_string(Repeat - Point - 1); + } + return CSmove; + } + + save_yank(Point, End - Point); + ceol(); + Line[Point] = '\0'; + End = Point; + return CSstay; +} + +STATIC STATUS +insert_char(c) + int c; +{ + STATUS s; + CHAR buff[2]; + CHAR *p; + CHAR *q; + int i; + + if (Repeat == NO_ARG || Repeat < 2) { + buff[0] = c; + buff[1] = '\0'; + return insert_string(buff); + } + + if ((p = NEW(CHAR, Repeat + 1)) == NULL) + return CSstay; + for (i = Repeat, q = p; --i >= 0; ) + *q++ = c; + *q = '\0'; + Repeat = 0; + s = insert_string(p); + DISPOSE(p); + return s; +} + +STATIC STATUS +meta() +{ + unsigned int c; + KEYMAP *kp; + + if ((c = TTYget()) == EOF) + return CSeof; +#if defined(ANSI_ARROWS) + /* Also include VT-100 arrows. */ + if (c == '[' || c == 'O') + switch ((int)(c = TTYget())) { + default: return ring_bell(); + case EOF: return CSeof; + case 'A': return h_prev(); + case 'B': return h_next(); + case 'C': return fd_char(); + case 'D': return bk_char(); + } +#endif /* defined(ANSI_ARROWS) */ + + if (isdigit(c)) { + for (Repeat = c - '0'; (c = TTYget()) != EOF && isdigit(c); ) + Repeat = Repeat * 10 + c - '0'; + Pushed = 1; + PushBack = c; + return CSstay; + } + + if (isupper(c)) + return do_macro(c); + for (OldPoint = Point, kp = MetaMap; kp < &MetaMap[METAMAPSIZE]; kp++) + if (kp->Key == c && kp->Active) + return (*kp->Function)(); + + return ring_bell(); +} + +STATIC STATUS +emacs(c) + unsigned int c; +{ + STATUS s; + KEYMAP *kp; + +#if 0 + /* This test makes it impossible to enter eight-bit characters when + * meta-char mode is enabled. */ + if (rl_meta_chars && ISMETA(c)) { + Pushed = 1; + PushBack = UNMETA(c); + return meta(); + } +#endif /* 0 */ + for (kp = Map; kp < &Map[MAPSIZE]; kp++) + if (kp->Key == c && kp->Active) + break; + s = kp < &Map[MAPSIZE] ? (*kp->Function)() : insert_char((int)c); + if (!Pushed) + /* No pushback means no repeat count; hacky, but true. */ + Repeat = NO_ARG; + return s; +} + +STATIC STATUS +TTYspecial(c) + unsigned int c; +{ + if (rl_meta_chars && ISMETA(c)) + return CSdispatch; + + if (c == rl_erase || c == DEL) + return bk_del_char(); + if (c == rl_kill) { + if (Point != 0) { + Point = 0; + reposition(); + } + Repeat = NO_ARG; + return kill_line(); + } + if (c == rl_eof && Point == 0 && End == 0) + return CSeof; + if (c == rl_intr) { + Signal = SIGINT; + return CSsignal; + } + if (c == rl_quit) { + Signal = SIGQUIT; + return CSsignal; + } +#if defined(DO_SIGTSTP) + if (c == rl_susp) { + Signal = SIGTSTP; + return CSsignal; + } +#endif /* defined(DO_SIGTSTP) */ + + return CSdispatch; +} + +STATIC CHAR * +editinput() +{ + unsigned int c; + + Repeat = NO_ARG; + OldPoint = Point = Mark = End = 0; + Line[0] = '\0'; + + Signal = -1; + while ((c = TTYget()) != EOF) + switch (TTYspecial(c)) { + case CSdone: + return Line; + case CSeof: + return NULL; + case CSsignal: + return (CHAR *)""; + case CSmove: + reposition(); + break; + case CSdispatch: + switch (emacs(c)) { + case CSdone: + return Line; + case CSeof: + return NULL; + case CSsignal: + return (CHAR *)""; + case CSmove: + reposition(); + break; + case CSdispatch: + case CSstay: + break; + } + break; + case CSstay: + break; + } + return NULL; +} + +STATIC void +hist_add(p) + CHAR *p; +{ + int i; + + if ((p = (CHAR *)strdup((char *)p)) == NULL) + return; + if (H.Size < HIST_SIZE) + H.Lines[H.Size++] = p; + else { + DISPOSE(H.Lines[0]); + for (i = 0; i < HIST_SIZE - 1; i++) + H.Lines[i] = H.Lines[i + 1]; + H.Lines[i] = p; + } + H.Pos = H.Size - 1; +} + +STATIC char * +read_redirected() +{ + int size; + char *p; + char *line; + char *end; + + for (size = MEM_INC, p = line = NEW(char, size), end = p + size; ; p++) { + if (p == end) { + size += MEM_INC; + p = line = realloc(line, size); + end = p + size; + } + if (read(0, p, 1) <= 0) { + /* Ignore "incomplete" lines at EOF, just like we do for a tty. */ + free(line); + return NULL; + } + if (*p == '\n') + break; + } + *p = '\0'; + return line; +} + +/* +** For compatibility with FSF readline. +*/ +/* ARGSUSED0 */ +void +rl_reset_terminal(p) + char *p; +{ +} + +void +rl_initialize() +{ +} + +int +rl_insert(count, c) + int count; + int c; +{ + if (count > 0) { + Repeat = count; + (void)insert_char(c); + (void)redisplay_no_nl(); + } + return 0; +} + +int (*rl_event_hook)(); + +int +rl_key_action(c, flag) + int c; + char flag; +{ + KEYMAP *kp; + int size; + + if (ISMETA(c)) { + kp = MetaMap; + size = METAMAPSIZE; + } + else { + kp = Map; + size = MAPSIZE; + } + for ( ; --size >= 0; kp++) + if (kp->Key == c) { + kp->Active = c ? 1 : 0; + return 1; + } + return -1; +} + +char * +readline(prompt) + CONST char *prompt; +{ + CHAR *line; + int s; + + if (!isatty(0)) { + TTYflush(); + return read_redirected(); + } + + if (Line == NULL) { + Length = MEM_INC; + if ((Line = NEW(CHAR, Length)) == NULL) + return NULL; + } + + TTYinfo(); + rl_ttyset(0); + hist_add(NIL); + ScreenSize = SCREEN_INC; + Screen = NEW(char, ScreenSize); + Prompt = prompt ? prompt : (char *)NIL; + TTYputs((STRING)Prompt); + if ((line = editinput()) != NULL) { + line = (CHAR *)strdup((char *)line); + TTYputs((STRING)NEWLINE); + TTYflush(); + } + rl_ttyset(1); + DISPOSE(Screen); + DISPOSE(H.Lines[--H.Size]); + if (Signal > 0) { + s = Signal; + Signal = 0; + (void)kill(getpid(), s); + } + return (char *)line; +} + +void +add_history(p) + char *p; +{ + if (p == NULL || *p == '\0') + return; + +#if defined(UNIQUE_HISTORY) + if (H.Size && strcmp(p, H.Lines[H.Size - 1]) == 0) + return; +#endif /* defined(UNIQUE_HISTORY) */ + hist_add((CHAR *)p); +} + + +STATIC STATUS +beg_line() +{ + if (Point) { + Point = 0; + return CSmove; + } + return CSstay; +} + +STATIC STATUS +del_char() +{ + return delete_string(Repeat == NO_ARG ? 1 : Repeat); +} + +STATIC STATUS +end_line() +{ + if (Point != End) { + Point = End; + return CSmove; + } + return CSstay; +} + +/* +** Return allocated copy of word under cursor, moving cursor after the +** word. +*/ +STATIC CHAR * +find_word() +{ + static char SEPS[] = "\"#;&|^$=`'{}()<>\n\t "; + CHAR *p; + CHAR *new; + SIZE_T len; + + /* Move forward to end of word. */ + p = &Line[Point]; + for ( ; Point < End && strchr(SEPS, (char)*p) == NULL; Point++, p++) + right(CSstay); + + /* Back up to beginning of word. */ + for (p = &Line[Point]; p > Line && strchr(SEPS, (char)p[-1]) == NULL; p--) + continue; + len = Point - (p - Line) + 1; + if ((new = NEW(CHAR, len)) == NULL) + return NULL; + COPYFROMTO(new, p, len); + new[len - 1] = '\0'; + return new; +} + +STATIC STATUS +c_complete() +{ + CHAR *p; + CHAR *word; + int unique; + + word = find_word(); + p = (CHAR *)rl_complete((char *)word, &unique); + if (word) + DISPOSE(word); + if (p && *p) { + (void)insert_string(p); + if (!unique) + (void)ring_bell(); + DISPOSE(p); + return redisplay_no_nl(); + } + return ring_bell(); +} + +STATIC STATUS +c_possible() +{ + CHAR **av; + CHAR *word; + int ac; + + word = find_word(); + ac = rl_list_possib((char *)word, (char ***)&av); + if (word) + DISPOSE(word); + if (ac) { + columns(ac, av); + while (--ac >= 0) + DISPOSE(av[ac]); + DISPOSE(av); + return redisplay_no_nl(); + } + return ring_bell(); +} + +STATIC STATUS +accept_line() +{ + Line[End] = '\0'; + return CSdone; +} + +STATIC STATUS +transpose() +{ + CHAR c; + + if (Point) { + if (Point == End) + left(CSmove); + c = Line[Point - 1]; + left(CSstay); + Line[Point - 1] = Line[Point]; + TTYshow(Line[Point - 1]); + Line[Point++] = c; + TTYshow(c); + } + return CSstay; +} + +STATIC STATUS +quote() +{ + unsigned int c; + + return (c = TTYget()) == EOF ? CSeof : insert_char((int)c); +} + +STATIC STATUS +wipe() +{ + int i; + + if (Mark > End) + return ring_bell(); + + if (Point > Mark) { + i = Point; + Point = Mark; + Mark = i; + reposition(); + } + + return delete_string(Mark - Point); +} + +STATIC STATUS +mk_set() +{ + Mark = Point; + return CSstay; +} + +STATIC STATUS +exchange() +{ + unsigned int c; + + if ((c = TTYget()) != CTL('X')) + return c == EOF ? CSeof : ring_bell(); + + if ((c = Mark) <= End) { + Mark = Point; + Point = c; + return CSmove; + } + return CSstay; +} + +STATIC STATUS +yank() +{ + if (Yanked && *Yanked) + return insert_string(Yanked); + return CSstay; +} + +STATIC STATUS +copy_region() +{ + if (Mark > End) + return ring_bell(); + + if (Point > Mark) + save_yank(Mark, Point - Mark); + else + save_yank(Point, Mark - Point); + + return CSstay; +} + +STATIC STATUS +move_to_char() +{ + unsigned int c; + int i; + CHAR *p; + + if ((c = TTYget()) == EOF) + return CSeof; + for (i = Point + 1, p = &Line[i]; i < End; i++, p++) + if (*p == c) { + Point = i; + return CSmove; + } + return CSstay; +} + +STATIC STATUS +fd_word() +{ + return do_forward(CSmove); +} + +STATIC STATUS +fd_kill_word() +{ + int i; + + (void)do_forward(CSstay); + if (OldPoint != Point) { + i = Point - OldPoint; + Point = OldPoint; + return delete_string(i); + } + return CSstay; +} + +STATIC STATUS +bk_word() +{ + int i; + CHAR *p; + + i = 0; + do { + for (p = &Line[Point]; p > Line && !isalnum(p[-1]); p--) + left(CSmove); + + for (; p > Line && p[-1] != ' ' && isalnum(p[-1]); p--) + left(CSmove); + + if (Point == 0) + break; + } while (++i < Repeat); + + return CSstay; +} + +STATIC STATUS +bk_kill_word() +{ + (void)bk_word(); + if (OldPoint != Point) + return delete_string(OldPoint - Point); + return CSstay; +} + +STATIC int +argify(line, avp) + CHAR *line; + CHAR ***avp; +{ + CHAR *c; + CHAR **p; + CHAR **new; + int ac; + int i; + + i = MEM_INC; + if ((*avp = p = NEW(CHAR*, i))== NULL) + return 0; + + for (c = line; isspace(*c); c++) + continue; + if (*c == '\n' || *c == '\0') + return 0; + + for (ac = 0, p[ac++] = c; *c && *c != '\n'; ) { + if (isspace(*c)) { + *c++ = '\0'; + if (*c && *c != '\n') { + if (ac + 1 == i) { + new = NEW(CHAR*, i + MEM_INC); + if (new == NULL) { + p[ac] = NULL; + return ac; + } + COPYFROMTO(new, p, i * sizeof (char **)); + i += MEM_INC; + DISPOSE(p); + *avp = p = new; + } + p[ac++] = c; + } + } + else + c++; + } + *c = '\0'; + p[ac] = NULL; + return ac; +} + +STATIC STATUS +last_argument() +{ + CHAR **av; + CHAR *p; + STATUS s; + int ac; + + if (H.Size == 1 || (p = H.Lines[H.Size - 2]) == NULL) + return ring_bell(); + + if ((p = (CHAR *)strdup((char *)p)) == NULL) + return CSstay; + ac = argify(p, &av); + + if (Repeat != NO_ARG) + s = Repeat < ac ? insert_string(av[Repeat]) : ring_bell(); + else + s = ac ? insert_string(av[ac - 1]) : CSstay; + + if (ac) + DISPOSE(av); + DISPOSE(p); + return s; +} + +STATIC KEYMAP Map[MAPSIZE] = { + { CTL('@'), 1, ring_bell }, + { CTL('A'), 1, beg_line }, + { CTL('B'), 1, bk_char }, + { CTL('D'), 1, del_char }, + { CTL('E'), 1, end_line }, + { CTL('F'), 1, fd_char }, + { CTL('G'), 1, ring_bell }, + { CTL('H'), 1, bk_del_char }, + { CTL('I'), 1, c_complete }, + { CTL('J'), 1, accept_line }, + { CTL('K'), 1, kill_line }, + { CTL('L'), 1, redisplay }, + { CTL('M'), 1, accept_line }, + { CTL('N'), 1, h_next }, + { CTL('O'), 1, ring_bell }, + { CTL('P'), 1, h_prev }, + { CTL('Q'), 1, ring_bell }, + { CTL('R'), 1, h_search }, + { CTL('S'), 1, ring_bell }, + { CTL('T'), 1, transpose }, + { CTL('U'), 1, ring_bell }, + { CTL('V'), 1, quote }, + { CTL('W'), 1, wipe }, + { CTL('X'), 1, exchange }, + { CTL('Y'), 1, yank }, + { CTL('Z'), 1, ring_bell }, + { CTL('['), 1, meta }, + { CTL(']'), 1, move_to_char }, + { CTL('^'), 1, ring_bell }, + { CTL('_'), 1, ring_bell }, +}; + +STATIC KEYMAP MetaMap[16]= { + { CTL('H'), 1, bk_kill_word }, + { CTL('['), 1, c_possible }, + { DEL, 1, bk_kill_word }, + { ' ', 1, mk_set }, + { '.', 1, last_argument }, + { '<', 1, h_first }, + { '>', 1, h_last }, + { '?', 1, c_possible }, + { 'b', 1, bk_word }, + { 'd', 1, fd_kill_word }, + { 'f', 1, fd_word }, + { 'l', 1, case_down_word }, + { 'm', 1, toggle_meta_mode}, + { 'u', 1, case_up_word }, + { 'y', 1, yank }, + { 'w', 1, copy_region }, +}; diff --git a/src/extern/editline/editline.h b/src/extern/editline/editline.h new file mode 100644 index 0000000000..d14553393f --- /dev/null +++ b/src/extern/editline/editline.h @@ -0,0 +1,79 @@ +/* $Revision: 1.1 $ +** +** Internal header file for editline library. +*/ +#include +#if defined(HAVE_STDLIB) +#include +#include +#endif /* defined(HAVE_STDLIB) */ +#if defined(SYS_UNIX) +#include "unix.h" +#endif /* defined(SYS_UNIX) */ +#if defined(SYS_OS9) +#include "os9.h" +#endif /* defined(SYS_OS9) */ + +#if !defined(SIZE_T) +#define SIZE_T unsigned int +#endif /* !defined(SIZE_T) */ + +typedef unsigned char CHAR; + +#if defined(HIDE) +#define STATIC static +#else +#define STATIC /* NULL */ +#endif /* !defined(HIDE) */ + +#if !defined(CONST) +#if defined(__STDC__) +#define CONST const +#else +#define CONST +#endif /* defined(__STDC__) */ +#endif /* !defined(CONST) */ + + +#define MEM_INC 64 +#define SCREEN_INC 256 + +#define DISPOSE(p) free((char *)(p)) +#define NEW(T, c) \ + ((T *)malloc((unsigned int)(sizeof (T) * (c)))) +#define RENEW(p, T, c) \ + (p = (T *)realloc((char *)(p), (unsigned int)(sizeof (T) * (c)))) +#define COPYFROMTO(new, p, len) \ + (void)memcpy((char *)(new), (char *)(p), (int)(len)) + + +/* +** Variables and routines internal to this package. +*/ +extern int rl_eof; +extern int rl_erase; +extern int rl_intr; +extern int rl_kill; +extern int rl_quit; +#if defined(DO_SIGTSTP) +extern int rl_susp; +#endif /* defined(DO_SIGTSTP) */ +extern char *rl_complete(); +extern int rl_list_possib(); +extern void rl_ttyset(); +extern void rl_add_slash(); + +#if !defined(HAVE_STDLIB) +extern char *getenv(); +extern char *malloc(); +extern char *realloc(); +extern char *memcpy(); +extern char *strcat(); +extern char *strchr(); +extern char *strrchr(); +extern char *strcpy(); +extern char *strdup(); +extern int strcmp(); +extern int strlen(); +extern int strncmp(); +#endif /* !defined(HAVE_STDLIB) */ diff --git a/src/extern/editline/os9.h b/src/extern/editline/os9.h new file mode 100644 index 0000000000..7bb7cf3c09 --- /dev/null +++ b/src/extern/editline/os9.h @@ -0,0 +1,10 @@ +/* $Revision: 1.1 $ +** +** Editline system header file for OS-9 (on 68k). +*/ + +#define CRLF "\r\l" +#define FORWARD extern + +#include +typedef struct direct DIRENTRY; diff --git a/src/extern/editline/sysos9.c b/src/extern/editline/sysos9.c new file mode 100644 index 0000000000..fd23aa4d4f --- /dev/null +++ b/src/extern/editline/sysos9.c @@ -0,0 +1,46 @@ +/* $Revision: 1.1 $ +** +** OS-9 system-dependant routines for editline library. +*/ +#include "editline.h" +#include +#include + + +void +rl_ttyset(Reset) + int Reset; +{ + static struct sgbuf old; + struct sgbuf new; + + + if (Reset == 0) { + _gs_opt(0, &old); + _gs_opt(0, &new); + new.sg_backsp = 0; new.sg_delete = 0; new.sg_echo = 0; + new.sg_alf = 0; new.sg_nulls = 0; new.sg_pause = 0; + new.sg_page = 0; new.sg_bspch = 0; new.sg_dlnch = 0; + new.sg_eorch = 0; new.sg_eofch = 0; new.sg_rlnch = 0; + new.sg_dulnch = 0; new.sg_psch = 0; new.sg_kbich = 0; + new.sg_kbach = 0; new.sg_bsech = 0; new.sg_bellch = 0; + new.sg_xon = 0; new.sg_xoff = 0; new.sg_tabcr = 0; + new.sg_tabsiz = 0; + _ss_opt(0, &new); + rl_erase = old.sg_bspch; + rl_kill = old.sg_dlnch; + rl_eof = old.sg_eofch; + rl_intr = old.sg_kbich; + rl_quit = -1; + } + else + _ss_opt(0, &old); +} + +void +rl_add_slash(path, p) + char *path; + char *p; +{ + (void)strcat(p, access(path, S_IREAD | S_IFDIR) ? " " : "/"); +} diff --git a/src/extern/editline/sysunix.c b/src/extern/editline/sysunix.c new file mode 100644 index 0000000000..6b3517cf01 --- /dev/null +++ b/src/extern/editline/sysunix.c @@ -0,0 +1,132 @@ +/* $Revision: 1.1 $ +** +** Unix system-dependant routines for editline library. +*/ +#include "editline.h" + +#if defined(HAVE_TCGETATTR) +#include + +void +rl_ttyset(Reset) + int Reset; +{ + static struct termios old; + struct termios new; + + if (Reset == 0) { + if (tcgetattr(0, &old) < 0) perror("tcgetattr"); + rl_erase = old.c_cc[VERASE]; + rl_kill = old.c_cc[VKILL]; + rl_eof = old.c_cc[VEOF]; + rl_intr = old.c_cc[VINTR]; + rl_quit = old.c_cc[VQUIT]; +#if defined(DO_SIGTSTP) + rl_susp = old.c_cc[VSUSP]; +#endif /* defined(DO_SIGTSTP) */ + + new = old; + new.c_lflag &= ~(ECHO | ICANON | ISIG); + new.c_iflag &= ~(ISTRIP | INPCK); + new.c_cc[VMIN] = 1; + new.c_cc[VTIME] = 0; + if (tcsetattr(0, TCSADRAIN, &new) < 0) perror("tcsetattr"); + } + else + (void)tcsetattr(0, TCSADRAIN, &old); +} + +#else +#if defined(HAVE_TERMIO) +#include + +void +rl_ttyset(Reset) + int Reset; +{ + static struct termio old; + struct termio new; + + if (Reset == 0) { + (void)ioctl(0, TCGETA, &old); + rl_erase = old.c_cc[VERASE]; + rl_kill = old.c_cc[VKILL]; + rl_eof = old.c_cc[VEOF]; + rl_intr = old.c_cc[VINTR]; + rl_quit = old.c_cc[VQUIT]; +#if defined(DO_SIGTSTP) + rl_susp = old.c_cc[VSUSP]; +#endif /* defined(DO_SIGTSTP) */ + + new = old; + new.c_lflag &= ~(ECHO | ICANON | ISIG); + new.c_iflag &= ~(ISTRIP | INPCK); + new.c_cc[VMIN] = 1; + new.c_cc[VTIME] = 0; + (void)ioctl(0, TCSETAW, &new); + } + else + (void)ioctl(0, TCSETAW, &old); +} + +#else +#include + +void +rl_ttyset(Reset) + int Reset; +{ + static struct sgttyb old_sgttyb; + static struct tchars old_tchars; + struct sgttyb new_sgttyb; + struct tchars new_tchars; +#if defined(DO_SIGTSTP) + struct ltchars old_ltchars; +#endif /* defined(DO_SIGTSTP) */ + + if (Reset == 0) { + (void)ioctl(0, TIOCGETP, &old_sgttyb); + rl_erase = old_sgttyb.sg_erase; + rl_kill = old_sgttyb.sg_kill; + + (void)ioctl(0, TIOCGETC, &old_tchars); + rl_eof = old_tchars.t_eofc; + rl_intr = old_tchars.t_intrc; + rl_quit = old_tchars.t_quitc; + +#if defined(DO_SIGTSTP) + (void)ioctl(0, TIOCGLTC, &old_ltchars); + rl_susp = old_ltchars.t_suspc; +#endif /* defined(DO_SIGTSTP) */ + + new_sgttyb = old_sgttyb; + new_sgttyb.sg_flags &= ~ECHO; + new_sgttyb.sg_flags |= RAW; +#if defined(PASS8) + new_sgttyb.sg_flags |= PASS8; +#endif /* defined(PASS8) */ + (void)ioctl(0, TIOCSETP, &new_sgttyb); + + new_tchars = old_tchars; + new_tchars.t_intrc = -1; + new_tchars.t_quitc = -1; + (void)ioctl(0, TIOCSETC, &new_tchars); + } + else { + (void)ioctl(0, TIOCSETP, &old_sgttyb); + (void)ioctl(0, TIOCSETC, &old_tchars); + } +} +#endif /* defined(HAVE_TERMIO) */ +#endif /* defined(HAVE_TCGETATTR) */ + +void +rl_add_slash(path, p) + char *path; + char *p; +{ + struct stat Sb; + + if (stat(path, &Sb) >= 0) + (void)strcat(p, S_ISDIR(Sb.st_mode) ? "/" : " "); +} diff --git a/src/extern/editline/testit.c b/src/extern/editline/testit.c new file mode 100644 index 0000000000..6f1927c568 --- /dev/null +++ b/src/extern/editline/testit.c @@ -0,0 +1,64 @@ +/* $Revision: 1.1 $ +** +** A "micro-shell" to test editline library. +** If given any arguments, commands aren't executed. +*/ +#include +#if defined(HAVE_STDLIB) +#include +#endif /* defined(HAVE_STDLIB) */ + +extern char *readline(); +extern void add_history(); + +#if !defined(HAVE_STDLIB) +extern int chdir(); +extern int free(); +extern int strncmp(); +extern int system(); +extern void exit(); +extern char *getenv(); +#endif /* !defined(HAVE_STDLIB) */ + + +#if defined(NEED_PERROR) +void +perror(s) + char *s; +{ + extern int errno; + + (voidf)printf(stderr, "%s: error %d\n", s, errno); +} +#endif /* defined(NEED_PERROR) */ + + +/* ARGSUSED1 */ +int +main(ac, av) + int ac; + char *av[]; +{ + char *prompt; + char *p; + int doit; + + doit = ac == 1; + if ((prompt = getenv("TESTPROMPT")) == NULL) + prompt = "testit> "; + + while ((p = readline(prompt)) != NULL) { + (void)printf("\t\t\t|%s|\n", p); + if (doit) + if (strncmp(p, "cd ", 3) == 0) { + if (chdir(&p[3]) < 0) + perror(&p[3]); + } + else if (system(p) != 0) + perror(p); + add_history(p); + free(p); + } + exit(0); + /* NOTREACHED */ +} diff --git a/src/extern/editline/unix.h b/src/extern/editline/unix.h new file mode 100644 index 0000000000..fe6beedcec --- /dev/null +++ b/src/extern/editline/unix.h @@ -0,0 +1,22 @@ +/* $Revision: 1.1 $ +** +** Editline system header file for Unix. +*/ + +#define CRLF "\r\n" +#define FORWARD STATIC + +#include +#include + +#if defined(USE_DIRENT) +#include +typedef struct dirent DIRENTRY; +#else +#include +typedef struct direct DIRENTRY; +#endif /* defined(USE_DIRENT) */ + +#if !defined(S_ISDIR) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif /* !defined(S_ISDIR) */ diff --git a/src/include/editline.h b/src/include/editline.h new file mode 100644 index 0000000000..1d5acfbbc0 --- /dev/null +++ b/src/include/editline.h @@ -0,0 +1,56 @@ +#ifndef INCLUDE_EDITLINE_H +#define INCLUDE_EDITLINE_H + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the Licence at + * http://www.gnu.org/licences/lgpl.html + * + * As a special exception this file can also be included in modules + * with other source code as long as that source code has been + * released under an Open Source Initiative certificed licence. + * More information about OSI certification can be found at: + * http://www.opensource.org + * + * This module 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 Lesser General Public Licence for more details. + * + * This module was created by members of the firebird development + * team. All individual contributions remain the Copyright (C) of + * those individuals and all rights are reserved. Contributors to + * this file are either listed below or can be obtained from a CVS + * history command. + * + * Created by: Mark O'Donohue + * + * Contributor(s): + * + * + * $Id: editline.h,v 1.1 2002-10-07 01:29:11 skywalker Exp $ + * + */ + + +// This file defines the ansi headers for the editline library which +// did not have it's own ansi header. This is an external module +// which we have included to replace readline which does not +// have a compatible licence for us to use. MOD 7-Oct-2002 + +#ifdef __cplusplus +extern "C" { +#endif + +extern char *readline(const char*); +extern void add_history(char*); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/include/gen/autoconfig_msvc.h b/src/include/gen/autoconfig_msvc.h index d234f74fac..33cc1960d5 100644 --- a/src/include/gen/autoconfig_msvc.h +++ b/src/include/gen/autoconfig_msvc.h @@ -53,6 +53,7 @@ #define HAVE_STRING_H #define HAVE_SIGNAL_H #undef HAVE_READLINE_READLINE_H +#undef HAVE_EDITLINE_H #undef HAVE_UNISTD_H #undef HAVE_VARARGS_H #undef HAVE_VFORK_H diff --git a/src/isql/isql.epp b/src/isql/isql.epp index 399f669ed7..ab0e56e277 100644 --- a/src/isql/isql.epp +++ b/src/isql/isql.epp @@ -24,7 +24,7 @@ * */ /* - $Id: isql.epp,v 1.14 2002-09-27 01:29:50 bellardo Exp $ + $Id: isql.epp,v 1.15 2002-10-07 01:29:12 skywalker Exp $ Revision 1.5 2000/11/18 16:49:24 fsg Increased PRINT_BUFFER_LENGTH to 2048 to show larger plans Fixed Bug #122563 in extract.e get_procedure_args @@ -66,6 +66,13 @@ #include #endif + +#ifdef HAVE_EDITLINE_H +// This is a local file included in our distribution - but not always +// compiled into the system +#include "editline.h" +#endif + #ifdef HAVE_READLINE_READLINE_H #include #include @@ -679,7 +686,7 @@ static void readNextInputLine(const char* prompt) { lastInputLine = NULL; } -#ifdef HAVE_READLINE_READLINE_H +#ifdef HAVE_EDITLINE_H lastInputLine = readline((char*) prompt); if (lastInputLine != NULL && strlen(lastInputLine) != 0) { diff --git a/src/make.new/config/config.h.in b/src/make.new/config/config.h.in index 9711061c94..b063a8fc3d 100644 --- a/src/make.new/config/config.h.in +++ b/src/make.new/config/config.h.in @@ -1,4 +1,4 @@ -#ident "$Id: config.h.in,v 1.38 2002-10-01 12:03:10 dimitr Exp $" +#ident "$Id: config.h.in,v 1.39 2002-10-07 01:29:12 skywalker Exp $" /* * 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports: @@ -18,6 +18,7 @@ #undef HAVE_ASSERT_H #undef HAVE_CTYPE_H #undef HAVE_ERRNO_H +#undef HAVE_EDITLINE_H #undef HAVE_FCNTL_H #undef HAVE_GRP_H #undef HAVE_PWD_H diff --git a/src/utilities/srvrmgr.cpp b/src/utilities/srvrmgr.cpp index 3d6024a10a..c858781876 100644 --- a/src/utilities/srvrmgr.cpp +++ b/src/utilities/srvrmgr.cpp @@ -20,7 +20,7 @@ * * All Rights Reserved. * Contributor(s): ______________________________________. - * $Id: srvrmgr.cpp,v 1.6 2002-09-20 10:23:15 eku Exp $ + * $Id: srvrmgr.cpp,v 1.7 2002-10-07 01:29:12 skywalker Exp $ */ #include "firebird.h" @@ -45,6 +45,7 @@ #include "../jrd/common.h" #include "../jrd/gds.h" +#include "../jrd/gds_proto.h" #include "../jrd/gdsassert.h" #include "../jrd/svc_undoc.h" #include "../utilities/ibmgr.h"