xbase-2.0.0/0000777000000000000000000000000007316217177006341 5xbase-2.0.0/Makefile.in0000644000000000000000000003354407316217167010332 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # This file is part of the XBase libraries # Copyright (C) 1998 Denis Pershin (dyp@inetlab.com) # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # linux.techass.com # SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ GLINC = @GLINC@ GLLIB = @GLLIB@ LD = @LD@ LIBDL = @LIBDL@ LIBJPEG = @LIBJPEG@ LIBNSL = @LIBNSL@ LIBOBJS = @LIBOBJS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ NM = @NM@ PACKAGE = @PACKAGE@ PAMINC = @PAMINC@ PAMLIBPATHS = @PAMLIBPATHS@ PAMLIBS = @PAMLIBS@ RANLIB = @RANLIB@ TVPROGS = @TVPROGS@ VERSION = @VERSION@ XPMINC = @XPMINC@ XPMLIB = @XPMLIB@ XSUBDIRS = @XSUBDIRS@ X_INCLUDES = @X_INCLUDES@ X_LDFLAGS = @X_LDFLAGS@ doxygen = @doxygen@ topdir = @topdir@ x_includes = @x_includes@ x_libraries = @x_libraries@ SUBDIRS = @XSUBDIRS@ MAINTAINERCLEANFILES = Makefile.in configure aclocal.m4 libtool EXTRA_DIST = makefile.g95 bin_SCRIPTS = xbase-config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ./xbase/xbconfig.h CONFIG_CLEAN_FILES = xbase-config xbase.spec SCRIPTS = $(bin_SCRIPTS) DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in NEWS TODO acconfig.h acinclude.m4 aclocal.m4 config.guess \ config.sub configure configure.in install-sh ltconfig ltmain.sh missing \ mkinstalldirs xbase-config.in xbase.spec.in xbase/stamp-h.in \ xbase/xbconfig.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) xbase/xbconfig.h: xbase/stamp-h @if test ! -f $@; then \ rm -f xbase/stamp-h; \ $(MAKE) xbase/stamp-h; \ else :; fi xbase/stamp-h: $(srcdir)/xbase/xbconfig.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=xbase/xbconfig.h \ $(SHELL) ./config.status @echo timestamp > xbase/stamp-h 2> /dev/null $(srcdir)/xbase/xbconfig.h.in: $(srcdir)/xbase/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/xbase/stamp-h.in; \ $(MAKE) $(srcdir)/xbase/stamp-h.in; \ else :; fi $(srcdir)/xbase/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/xbase/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f xbase/xbconfig.h maintainer-clean-hdr: xbase-config: $(top_builddir)/config.status xbase-config.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status xbase.spec: $(top_builddir)/config.status xbase.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else :; fi; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) list='$(bin_SCRIPTS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive install-exec-am: install-binSCRIPTS install-exec: install-exec-recursive install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall-binSCRIPTS uninstall: uninstall-recursive all-am: Makefile $(SCRIPTS) all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-tags distclean-generic clean-am -rm -f libtool distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ uninstall-binSCRIPTS install-binSCRIPTS install-data-recursive \ uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean rpm : dist cp xbase-@VERSION@.tar.gz /usr/src/redhat/SOURCES cp xbase.spec /usr/src/redhat/SPECS (cd /usr/src/redhat/SPECS ; rpm -ba --clean xbase.spec) docs : (cd docs ; make docs) .PHONY : docs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xbase-2.0.0/README0000644000000000000000000000576207162220424007133 XBASE Version 2.0.0 WHAT IS IT? ----------- XBase is an xbase (i.e. dBase, FoxPro, etc.) compatible C++ class library originally by Gary Kunkel and others (see the AUTHORS file). XBASE is useful for accessing data in legacy dBase 3 and 4 database files as well as a general light-weight database engine. It includes support for DBF (dBase version 3 and 4) data files, NDX and NTX indexes, and DBT (dBase version 3 and 4). It supports file and record locking under *nix OS's (we hope to fix the locking support under Win32 soon). DIRECTORY LAYOUT ---------------- /bin contains various utility programs /examples contains various test programs /html contains the original xBase documentation in html format /tv turbo vision interface stuff /xbase XBase source and header files BUILDING THE LIBRARY -------------------- XBase uses autoconf and libtool to manage the build process. To configure the library for your specific system, run the "configure" shell script as follows: ./configure The configure script accepts the following options in addition to the normal default options: --enable-debug creates debugging code [default=no] --enable-shared build shared libraries [default=yes] --enable-static build static libraries [default=no] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --without-index-ndx do not compile .ndx index support --without-index-ntx do not compile .ntx index support --without-memo-fields do not compile memo fields support --without-expressions do not compile expressions support --without-ui-html do not compile HTML support --without-xbase-locking turn off XBase file locking --without-realdelete turn off XBase record deletion --without-xbase-debug turn off XBase specific debug --with-exceptions turn on exceptions --with-castellano turn on spanish date logic Once configured, execute make as follows to build the library: make Once compiled (and assuming no errors occurred), use make to install the library, header files, and utilities as follows: make install The default install directory is /usr/local. DOCUMENTATION ------------- The documentation at this point consists of the original xBase documentation (in the html directory). It is still very useful as little has changed from the original library except bugfixes and a few enhancements. We are working on incorporating comments into the source to allow generation of reference documentation using the Doxygen document generator. A small amount has been done already, but we hope to complete this effort before the next release. CONTACT ------- Please email comments, bug reports, and patches to Derry Bryson (derry@techass.com). Maintenance of this library is supported by Technology Associates, Inc. (www.techass.com). xbase-2.0.0/AUTHORS0000644000000000000000000000273407115376024007325 This is a list of the people who are or have worked on the XDB Library. Derry Bryson - current maintainer Mario Motta - testing and bugfixes ------------------------------------------------------------------------------ The following is the original AUTHORS file for the xbase library ------------------------------------------------------------------------------ This is a partial list of the people that have helped with the xbase project and something specific they worked on. Most have worked on more than what is listed. I didn't mean to leave anyone off or forget anyone - if you are missing and you should be on the list, let me know at gkunkel@startech.keller.tx.us or add yourself (list is in alpha order). Bob Cotton - Clipper NTX index support Denis Braussen - general support Denis Pershin - provided library enhancements Eirk Bachman - keeper of definitive Xbase spec Gabriel Emerson - provided logo Gary Kunkel - original author Kehl Hubertus - Xbase to Xbase C++ Perl Converter Michael Bedward - Expression logic support Paul Foster - general support Vitaly Fedrushkov - TV support and more xbase-2.0.0/COPYING0000644000000000000000000012773007162242063007311 The XBase library itself is released under the GNU Lesser General Public License, see the text of the GNU LGPL below. The executable programs in the bin, examples, and libtest directories are release under the GNU General Public License, see the text of the GNU GPL below. Any licensing questions should be directed to xbase@techass.com. ----------------------------------------------------------------------------- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ----------------------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. -----------------------------------------------------------------------------xbase-2.0.0/ChangeLog0000644000000000000000000003356507203054374010034 2000-11-10 Derry Bryson * Fixed memory leak caused by some calling xbString::ctor(). xbString::ctor() is now protected so this shouldn't happen in the future :) * Fixed error in expression processing where a node was being used after being deleted! * Many changes and additions to support compilation under Windows ------------------------------------------------------------------------------- Fri May 29, 2000 See NEWS file for changes. ------------------------------------------------------------------------------- The following is the contents of the original ChangeLog from xBase1.8.1 ------------------------------------------------------------------------------- Fri Mar 19 15:25:43 1999 Vitaly V. Fedrushkov * all includes moved to xbase/ * xbase/xbase.cpp (xbXBase): free(NULL) prevented * xbase/xbexcept.cpp (xbStrError): unreachable return fixed 1999-02-27 Gary Kunkel * created release 1.8.0b, mainly 1999-02-16 Vitaly V Fedrushkov * bin/dbfutil1.cpp, bin/dumpdbt.cpp, examples/sample3.cpp, examples/sample2.cpp: depends on XB_MEMO_FIELDS 1999-02-15 Vitaly V Fedrushkov * xbase/dbf.cpp (PackDatafiles): didn't compile without XB_MEMO_FIELDS * examples/testhtml.cpp: depends on XB_HTML * xbase/dbf.h: DumpHeader() depends on XBASE_DEBUG * bin/dbfutil1.cpp, bin/dumpdbt.cpp, bin/dumphdr.cpp, bin/checkndx.cpp: depends on XBASE_DEBUG * xbase/index.h, xbase/ndx.h, xbase/ntx.h: CheckIndexIntegrity depends on XBASE_DEBUG * configure.in: NTX support auto-configuration added fixed a bug which turned on castellano together with exceptions * xbase/lock.cpp, xbase/dbf.h: got rid of __XBDOS in favor of HAVE_FCNTL * acconfig.h: xbconfig.h.bot moved here (XB_INDEX_ANY): new define based on either XB_INDEX_NDX or XB_INDEX_NTX (XB_EXPRESSIONS): moved from xbase.h * xbase/lock.cpp, xbase/xbase.h, xbase/dbf.cpp, xbase/dbf.h: XB_INDEX_ANY used to include format-independent index processing code * xbase/index.h (class xbIndex): fixed 'const' mismatches at some declarations DumpXxx methods depend on XBASE_DEBUG * xbase/xbase.h: XB_EXPRESSIONS auto-inclusion logic moved to xbconfig.h 1999-02-14 Vitaly V Fedrushkov * xbase/index.cpp: excess #includes removed * xbase/xbcf_b32.h: New. Settings for Borland C++ 4.5. Must be copied to xbconfig.h before compilation. * xbase/xdate.h, xbase/xbexcept.h, xbase/xbase.h, xbase/html.h, xbase/stack.cpp, xbase/dbf.h, xbase/exp.h: options.h changed to xbconfig.h * xbase/options.h: Rewritten. Now contains only user-selectable options. All the rest gets set in xbconfig.h. From now on, options.h is consulted only via hand-made xbconfig.h. * xbase/xbstring.h: xbconfig.h included * xbase/ntx.cpp: added check for unistd.h. Anyone know its purpose here? * xbase/lock.cpp: HAVE_SYS_TYPES_H typo (LockIndex): unrenamed symbol SEEK_ERROR? Already had it fixed and committed, how did it survive... * xbase/html.cpp (Tally): Did not work without fcntl(). Workaround effectively disables locking support even with XB_LOCKING_ON * xbase/memo.cpp (CreateMemoFile), xbase/fields.cpp (GetField): (const char*) to (char*) cast fix * xbase/lock.cpp (LockIndex) xbase/exp.cpp (LoadExpNode) xbase/fields.cpp (GetField) xbase/index.h (class xbIndex) xbase/xbase.cpp (PutShort, PutLong, PutUShort, PutULong, PutDouble) xbase/dbf.h: fixed 'const' mismatches at some declarations 1999-02-13 Vitaly V Fedrushkov * xbase/dbf.cpp (OpenDatabase): Hexcode used instead of 8-bit char for Version * xbase/dbf.h: Ditto * bin/dbfutil1.cpp (ConvertDatabase): Uninitialized pointer fixed * bin/dumpdbt.cpp (main): '#endif XB_LOCKING_ON' fixed * xbase/expfunc.cpp (DESCEND): fixed an OCR-like typo that made DESCEND() useless. 1999-02-11 Vitaly V Fedrushkov * xbase/Makefile.am (libxbase_la_LDFLAGS): CURRENT version number incremented to reflect interface changes * tv/Makefile.am (tvxbase_SOURCES): header file was missing from distribution * Makefile.cvs (all): Fixed a bug that made 'configure' missing from 'make dist' tarball. * Makefile.am, */Makefile.am (MAINTAINERCLEANFILES): All auto-generated files are subject to 'make maintainer-clean', which should now reduce all directories to their CVS contents. 1999-02-11 Vitaly V Fedrushkov * Makefile.am (EXTRA_DIST): COPYING.LIB instead of COPYING.GPL 1999-02-08 Vitaly V Fedrushkov * html/Makefile.am: new file; HTML docs are now subject to `make dist` * Makefile.am (SUBDIRS): html added * configure.in: html/Makefile added 1999-02-08 Bob Cotton dbf.cpp fields.cpp - Added a configurable instance variable, EofChar. Defaults to "\x0D\x1A". - Added SetEofChar() - Added Clipper .NTX support. - Abstracted all referneces from ndx to index. - Added support for Clipper and FoxPro character fields longer then 255 characters. Determined by a char field and a decimal field > 0. - Added LongFieldLen to Schema to represent this. - Fix for incrementing CurRec on an AppendRecord(). - Fix in dump record to handle large fields exp.cpp and expfunc.cpp - Added DESCEND(). Only works for dates. - Added DTOS(). Date to string. - Added RECNO() returns the current record number. - Added 2 and 3 parameter versions of STR() - Added STRZERO() - Small expression parsing fix expproc.cpp - Added support for quoted strings in expressions. ndx.cpp - Changed NodeLink to NdxNodeLink - Moved common instance variables to index.cpp xbase.cpp - Added GetULong(), PutUShort(), PutULong(). Not sure if they're necessary. New Files index.cpp Index Base class for ndx and ntx classes index.h ntx.cpp Clipper NTX class. ntx.h To Do: - Some methods are almost identical in ntx.cpp and ndx.cpp. These could be moved to index.cpp. 1999-02-05 Vitaly V Fedrushkov * xbase/lock.cpp (LockIndex): unrenamed symbol Some HAVE_EXCEPTIONS cleanup: * xbase/dbf.cpp (CreateDatabase, OpenDatabase, AddNdxToIxList): xb_memory_error applied (GetNextRecord, GetPrevRecord): xb_eof_error applied * xbase/expproc.cpp (ProcessOperator): xb_memory_error applied * xbase/memo.cpp (CreateMemoFile): xb_memory_error applied * xbase/ndx.cpp (UncloneNodeChain, CreateIndex, AddKey): xb_memory_error applied (GetNextKey, GetPrevKey): xb_eof_error applied * xbase/xbase.cpp: xbexcept.h included unconditionally (AddDbfToDbfList): xb_memory_error applied * xbase/xbexcept.h: xbStrError() prototype * xbase/xbexcept.cpp (xbStrError): moved outside HAVE_EXCEPTIONS. It is useful anyway. egcs warnings fixes: * xbase/xbase.h (xbXBase::xbXBase): Redundant scope qualifier removed * xbase/xstack.h (xbStack::xbStack): Redundant scope qualifier removed * xbase/exp.h(class xbExpn): Token( void ) removed. Not seen anywhere else. 1999-02-02 Vitaly V Fedrushkov * html/Makefile.am: new file; HTML docs are now subject to `make dist` * Makefile.am (SUBDIRS): html added * configure.in: html/Makefile added 1999-02-01 Vitaly V Fedrushkov DTOS() function from Clipper added: * xbase/expfunc.cpp (DTOS): new function (ProcessFunction): DTOS() function added * xbase/exp.h: DTOS() function added This Page Last Updated 2/2/99 Format of page changed 2/2/99 to try to match GNU format If you make changes/updates to the library, please note them in here with the date, your name and email address. 2/2/99 - V1.8.0a 1999-01-29 Vitaly V Fedrushkov * xbase/Makefile.am (include_HEADERS): xbconfig.h was missing * xbase/exp.cpp (IsSeparator): was misspelled * xbase/lock.cpp (LockIndex): SEEK_ERROR renamed * xbase/ndx.h: NO_ERROR renamed * xbase/dbf.h: NO_ERROR renamed * bin/Xb2cpp.pl: NO_ERROR renamed * xbase/exp.h (struct FuncDtl): renamed to xbFuncDtl * xbase/exp.cpp (xbExpn): FuncDtl renamed * xbase/xdate.h (FMT_XXXX): renamed to XB_FMT_XXXX * xbase/dbf.cpp: FMT_XXXX renamed * xbase/xdate.cpp: FMT_XXXX renamed * xbase/expfunc.cpp (DAY, DOW): FMT_XXXX renamed * examples/testdate.cpp (main): FMT_XXXX renamed * xbase/ndx.h (NDX_NODE_SIZE): renamed to XB_NDX_NODE_SIZE * xbase/ndx.cpp: NDX_NODE_SIZE renamed * xbase/lock.cpp (LockIndex): NDX_NODE_SIZE renamed * xbase/options.h: protective define renamed to __XB_OPTIONS_H__ * xbase/ndx.h: protective define renamed to __XB_NDX_H__ * xbase/retcodes.h: protective define renamed to __XB_RETCODES_H__ (XB_OK): alias to XB_NO_ERROR * AUTHORS: Bob Cotton's email was misspelled - old style ChangeLog follows - Exception support - Denis Pershin - autoconf and automake support - Denis Pershin - fix to TRIM - Michael Bedward - added xbString support - several authors - fix to CreateDatabase for memo field size - always = 10 - Added method xbXBase::DisplayError() 10/27/98 - V1.7.4d - Continued modifications to use const where applicable - Fixes to memo fields - Dbase IV version - always end with 0x1a, 0x1a - Dbase III version - header not updated by BDE-compatability fix - Fixed library to compile when MEMO_FIELDS unvalued - Look at DBF file to determine version, not DBT file 10/26/98 - V1.7.4c - Added fix to NDX module for big endian machines - Updated PackDatabase routine to not lock non-existent memo files - Updated PackDatabase routine to create temp files in same directory as file to be packed - Converted gcvt calls to sprintf calls for enhanced portability - Renamed types.h to xtypes.h for compatibility reasons - Renamed stack.h to xstakc.h for compatibility reasons - Added fix to NDX which was related to NDX not updated on revise - Added additional expression function RECNO() - Installed portability fix in PutFloatField - autoconf support added - Denis Pershin - updates to us const CHAR * where possible - Denis Pershin 6/9/98 - V1.7.4b - Added methods DBF::CalcCheckSum(), HTML::PrintEncodedChar and PrintEncodedString() - Fixed bug in HTML::DeleteEscChars - Fixed memory leak encountered when closing database - General code cleanup - Fix to CopyDbfStructure - Changed date defines WEEK,MONTH and YEAR to FMT_WEEK,FMT_MONTH and FMT_YEAR due to conflicts with the expression logic - Changed define type in CreateDatabase - Changed define type XFLOAT to FLOAT - Alpha release of expression logic routines 6/3/98 - V1.7.3 - Added methods DBF::Zap(), DBF::DeleteAllRecords(), DBF::UndeleteAllRecords(), DBF::RebuildAllIndices() and DBF::CopyDbfStructure() 5/25/98 - V1.7.1 - Fix in NDX::GetPrevRecord when skipping previous to first record - Added support for Big Endian computers (Intel is Little Endian) - renamed HTML::EndPage to HTML::EndHtmlPage - modified HTML::StartHtmlPage to include and title - Added methods DBF::ValidLogicalData and DBF::ValidNumericData - Add Dbase III compatible memo field support 4/15/98 - V1.6b - Numeric key index support - Added field methods GetDoubleField and PutDoubleField - removed ';' from #endif statements in memo.cc and dbf.cc - renamed all .cc files to .cpp files - included notes for compiling with OpenVMS - thanks Jourquin - added record locking enhancements - thanks Michael 4/1/98 - V1.6a - Included beta version for expression support - Multi-field Index Key support - New XBASE Global Level Class for all date and expression functions - Support for non Linux platforms w/ makefiles - Fixed reported bugs - Changed define DEBUG to XBASE_DEBUG due to conflicts when using Xbase DBMS with other libraries - Added "return 0" to the end of SplitLeafNode() in ndx.cc - Fixed SIGSEGV core dump prob when creating index - Changed Status to DbfStatus in dbf.cc and dbf.h to avoid a conflist with Solaris function Status() - Made io.h includes conditional only for DOS compiles in ndx.cc and dbf.cc - Modified version byte in DBF file header to be 83 is memo fields 1/2/98 - V1.5 - Added Dbase IV memo field support - Added field method FieldCount() - Added field method GetFieldName() - Fixed bug in PackDatabase method 12/7/97 - V1.2b - Fixed an unbalanced if statement in the fields.cc logic. 11/20/97 - V1.2 - Updated and added several new methods to the HTML/CGI class. 10/28/97 - V1.05 - Added date method to determine last day of month for given date - Modified PutField method to handle decimal points - Added field methods GetFloatField - Added field methods PutFloatField - Modified PutField method to handle decimal points with floats - Added additional logic to DateIsValid method 10/23/97 - V 1.02 - Added method PackDatabase - Added method ReIndex - Added method KeyExists - Cleaned up ndx.cc source code - Modified header logic to only update counters, not entire node - Added logic to look for last matching key on non-unique indexes to reduce number of node splits 10/15/97 - Release of V 1.0 - Basic DBF and NDX release xbase-2.0.0/INSTALL0000644000000000000000000001700207115376045007303 Basic Installation ================== Please Note: This is the standard install file for the automake/autoconf package. For Xbase documentation notes, see Chapter 1 in the manual on getting started. - Gary gkunkel@startech.keller.tx.us These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/kde/bin', `/usr/local/kde/lib', etc. You can specify an installation prefix other than `/usr/local/kde' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. xbase-2.0.0/Makefile.am0000644000000000000000000000277307316161675010323 ## Process this file with automake to produce Makefile.in ## # This file is part of the XBase libraries # Copyright (C) 1998 Denis Pershin (dyp@inetlab.com) # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # linux.techass.com # SUBDIRS = @XSUBDIRS@ MAINTAINERCLEANFILES = Makefile.in configure aclocal.m4 libtool EXTRA_DIST = \ makefile.g95 bin_SCRIPTS = xbase-config rpm : dist cp xbase-@VERSION@.tar.gz /usr/src/redhat/SOURCES cp xbase.spec /usr/src/redhat/SPECS (cd /usr/src/redhat/SPECS ; rpm -ba --clean xbase.spec) docs : (cd docs ; make docs) .PHONY : docsxbase-2.0.0/NEWS0000644000000000000000000000614607162220424006747 XBase Version 2.0.0 (?????) --------------------------- Changed name back to XBase due to trademark problem with XDB. Changed directory structure, library names, and include directory back to xbase. XDB Version 1.2.0 (May 29, 2000) -------------------------------- Fixed bugs introduced in 1.0.0 (with the exception of NTX index problems which haven't been fixed yet). Addition of support for variable node sizes to NDX indexes. The default node size for dBase NDX files is 512 bytes. Increasing the node size allows more keys to fit in a given node and can increase performance on larger tables. Use the SetNodeSize() method of an index to set the node size before creation of the index, for example: ndx->SetNodeSize(2048); sets the node size to 2048. Valid node sizes are from 512-4096 in 512 byte increments. Once the NDX index is created, the node size is determined automatically. Various bugfixes to the expression parsing/evaluation code including the addition (enabling?) of the logical operators .AND., .OR. and .NOT.. Modified the GetFieldNo() method of xbDbf to do a non-case-sensitive comparsion to support NDX files created by the real dBase program. XDB Version 1.0.0 (Feb 4, 2000) ------------------------------- Many bugfixes. Most notable being fixes to the locking code to allow actual multi-user access and the use of a binary search instead of a linear search for key values within NDX nodes. Addition of code to support "real" deletes. The normal behavior for dBase files is to mark records as deleted, but they remain in the database (and indexes) until the database is "packed" and reindexed. XDB now supports actual delete and reuse of deleted records (i.e. deleted records no longer appear in the database and are removed from indexes when deleted). The default behavior is still the dBase behavior; however you can use the RealDeleteOn() method of the xbDbf class to enable real deletes. Note that real deletes should be "turned on" before creation the database and each time the database is opened to work correctly. ------------------------------------------------------------------------------ The following is the NEWS file from the original xBase1.8.1 release ------------------------------------------------------------------------------ Release 1.8.1 created 3/31/99 - in preperation for next wave of development code as discussed in the mailing list All includes moved to xbase/ directory. From now on, use: #include Release 1.8.0b release 2/27/99 Has some misc bug fixes from release 1.8.0a, mainly includes a missing configure script. 1.8.0b was released to address misc 1.8.0a distribution problems. The NTX index logic is still in alpha. It does not appear to generate correct indices in all circumstances. So for now, you may want to continue using the NDX indices. Release 1.8.0a Significant enhancements 1) Exception processing 2) GNU Autoconf support 3) Directory structure rename 4) Memo field processing fixes and enhancements 5) Additional string class support 6) Rename of major classes See also the Changelog file for specific information Gary.. xbase-2.0.0/TODO0000644000000000000000000001604007117511225006734 XDB TODO's (not necessarily in this order!) ------------------------------------------- 1) Complete Doxygen support 2) Fix exeception handling 3) Transaction support 4) Safe update/modification support 5) Enhance performance 6) Add client/server support 7) Get this thing into CVS ------------------------------------------------------------------------------ The following is the contents of the TODO file from the original xBase library ------------------------------------------------------------------------------ Please feel free to put your name next to any item or category of items that you would like to work on. Then we will know who to keep asking if it is done yet -)). Also, if you fix anything, please update this list appropriately. Proposed Version Release Plan and Schedule ------------------------------------------ 1) 1.9.x - Development release - ANSI C++ where possible - General code cleanup - xbString - new/delete to replace malloc/free usage - lint errors - clean up cr/lf in source files - see the email at the end of this todo list - Other code contributions as donated - Develop Regresion testing scenarios and programs Willy's comments on testingg: "I started thinking of a test suite. DejaGNU looks like an overkill. Instead I thought of record-by-line dump utility and diff. - Other misc bug fixes as submitted - Additional Makefiles 2) 2.0 Next Stable release 3) 2.1 Next Development release - post 2.0 ----------------------------------------------------------------------------- Specific Items on the TODO list ------------------------------- I. General code cleanup, minor bugs, and ansi code usage things - Replace malloc/free with new/delete where possible - Replace string usage with xbString usage - Expression functions in need of fixing 1) RECNO is broke 2) STR( "ccc", 2 ) -> returns "ccc" even though length is 2 3) STR( -52.345, 3 ) -> return -52.345 even though length is 3 4) DESCEND does not work, not sure what is should do 5) DTOC function in testdate program does not work II. Design - Enhance common abstract layer under xbDbf/xbIndex/xbNdx/xbNtx. Use old thread on "New index class design" as a basis. - Redesign / rebuild / retest field logic - Record and File Locking Enhancements needed Analysis is required to determine how Dbase, FoxPro and Clipper perform file and record locking, and determine a scheme for getting Xbase to peacefully coexist in those environments where similar locking protocols are required. html.cpp code relies on XB_LOCKING_ON to use 'struct flock'. In real world, even checking for HAVE_FCNTL_H won't help to verify flock() availability. Something is to be done to get html.cpp compile under Windows with XB_LOCKING_ON. III. Enhancements.cheap A) i18n: get rid of XB_CASTELLANO and use static xbDate members instead; release 2.1 B) i18n: same for xbStrError. Make it xbXBase member; C) Date: Wed, 10 Feb 1999 16:10:41 +0500 (YEKT) From: Vitaly Fedrushkov Expressions like these are not supported: DATE - DATE (= NUM) DATE - NUM (= DATE) DATE + NUM (= DATE) D) Empty date (like CTOD(" / / ") ) is not handled in many cases. In fact, EMPTY() function is not implemented either. IV. Install - Write a set of makefiles/configs for all supported platforms; - From spits@MailAndNews.com Sun Feb 14 14:15:21 1999 Date: Tue, 9 Feb 1999 06:57:52 -0500 From: Warren Spits There is a problem with the Makefiles for the bin and example directories. When compiled with a VPATH different from the original source directory, the compiler fails to find xbase.h. This is because on the command line the c compiler has -I../xbase instead of -I$(top_srcdir)/xbase. I didn't attach a diff because I don't know much about automake. V. Half Cooked requests - Record and File Locking Enhancements needed a) finish/test locking logic to support DOS/Windows/NT environments b) Verify locking works with other xbase products - Dbase, Foxbase and Clipper VI. Docs - Doc++ - Create Xbase How To - Create Xbase FAQ - Create Xbase HACKING - Update xbString documentation chapter - Update Turbo Vision documentation chapter - Expand expression processing documentation VII. Wish list - map the xbase function names to standard Dbase names - Add filter processing - several people have asked for this one and opionally make some type of database rebuild process which can read the log files and rebuild a database from it - Additional index types (.IDX,.MDX) support - Transaction processing - this is a big one - Create a logging routine - put hooks in the PutRecord function to log date - Create a client/server Linux/Unix daemon server process for running - Create a command processing environment -------------------------------------------------------------------------- This email lists things that need worked on during development version 1.9 From paulf@quillandmouse.com Sun Feb 14 16:06:20 1999 Date: Fri, 12 Feb 1999 19:09:53 -0500 (EST) From: "Paul M. Foster" Reply-To: xbase@startech.keller.tx.us Subject: Re: Interface backwards compatibility? > Well, a few minutes ago I finished source linting with '-ansi > -pedantic -Wall -W -Wshadow -Wbad-function-cast -Wcast-qual > -Wwrite-strings -Wconversion -Wmissing-prototypes > -Wmissing-declarations -Woverloaded-virtual'. Here are my kills: > > 1. strdup() is enabled by _GNU_SOURCE. Shouldn't cause any problem > with most compilers > > 2. gcvt() is a SYSV-ism. Ditto. > This is problematic. It isn't ANSI, but many compilers have it. Conversion to and from numbers/strings in C is a pain. > 3. fileno() -- not sure about its origin. Works everywhere? I saw > even _fileno in NTX code. > This is a unixism. It's meant to allow a bridge from the ANSI C FILE* way of doing things to the old unix way. It is *not* ANSI. > 4. strcasecmp() is a BSD feature. In Borland, stricmp() works as > substitute. > > 5. Some '#endif FOO' cases. > > 6. Many files are written in CRLF convention. Not sure what to do > here. > DOS files. No choice here? > 7. Numerous (const char*) to (char*) casts. May make BC 4.x angry. > > 8. Other nondeadly sins include unused args and unreachable returns > and data members shadowed by function parameters, including pearls > like 'this->size = size' :( > These should really be cleaned up. > There were no serious troubles seen. > > So it looks like we're far from pure ANSI code, but is it bad? > Yes and no. Lint kills don't necessarily mean non-ANSI. I'd say the code should be ANSI, so we can reasonably expect any compiler to handle it. Compilers that can't-- sorry, not supported. On the other hand, there will be some places (like file locking, process control), where we can't help but be platform-specific. Those should be isolated in their own files if possible. Paul M. Foster xbase-2.0.0/acconfig.h0000644000000000000000000000351107316162264010173 /* $Id: acconfig.h,v 1.2 2001/06/26 19:38:28 dbryson Exp $ */ /* Define if the C++ compiler supports BOOL */ #undef HAVE_BOOL /* defines if having libgif (always 1) */ #undef HAVE_LIBGIF /* defines if having libjpeg (always 1) */ #undef HAVE_LIBJPEG /* defines which to take for ksize_t */ #undef ksize_t /* define if you have setenv */ #undef HAVE_FUNC_SETENV /* Define to 1 if NLS is requested. */ #undef ENABLE_NLS /* Define as 1 if you have the stpcpy function. */ #undef HAVE_STPCPY /* Define if your locale.h file contains LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define if you need the GNU extensions to compile */ #undef _GNU_SOURCE /* Define if you need to have .ndx indexes */ #undef XB_INDEX_NDX /* Define if you need to have .ntx indexes */ #undef XB_INDEX_NTX /* Define if you need to support memo fields */ #undef XB_MEMO_FIELDS /* Define if you need expressions */ #undef XB_EXPRESSIONS /* Define if you need html support */ #undef XB_HTML /* Define if you need locking support */ #undef XB_LOCKING_ON /* Define if you need to turn on XBase specific debug */ #undef XBASE_DEBUG /* Define if your compiler support exceptions */ #undef HAVE_EXCEPTIONS /* Define if you want Castellano (Spanish) Dates */ #undef XB_CASTELLANO /* Define if using real deletes */ #undef XB_REAL_DELETE /* Define if need filters */ #undef XB_FILTERS @BOTTOM@ /* Should we include generic index support? */ #if defined(XB_INDEX_NDX) || defined(XB_INDEX_NTX) #define XB_INDEX_ANY 1 #endif /* expressions required for indexes */ #if defined(XB_INDEX_ANY) && !defined(XB_EXPRESSIONS) #define XB_EXPRESSIONS 1 #endif /* default memo block size */ #define XB_DBT_BLOCK_SIZE 512 /* filename path separator */ #define PATH_SEPARATOR '/' #ifndef HAVE_BOOL #define HAVE_BOOL 1 typedef int bool; const bool false = 0; const bool true = 1; #endif xbase-2.0.0/acinclude.m40000644000000000000000000007035107115376063010451 ## This file is part of the XBase libraries/packages ## Copyright (C) 1998 Denis Pershin ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ## ## ------------------------------------------------------------------------ ## Find a file (or one of more files in a list of dirs) ## ------------------------------------------------------------------------ ## AC_DEFUN(AC_FIND_FILE, [ $3=NO for i in $2; do for j in $1; do if test -r "$i/$j"; then $3=$i break 2 fi done done ]) ## ------------------------------------------------------------------------ ## Find the meta object compiler in the PATH, in $QTDIR/bin, and some ## more usual places ## ------------------------------------------------------------------------ ## ## ------------------------------------------------------------------------ ## Find the header files and libraries for X-Windows. Extended the ## macro AC_PATH_X ## ------------------------------------------------------------------------ ## AC_DEFUN(K_PATH_X, [ AC_MSG_CHECKING(for X) AC_CACHE_VAL(ac_cv_have_x, [# One or both of the vars are not set, and there is no cached value. ac_x_includes=NO ac_x_libraries=NO AC_PATH_X_DIRECT AC_PATH_X_XMKMF if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!]) else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi])dnl eval "$ac_cv_have_x" if test "$have_x" != yes; then AC_MSG_RESULT($have_x) no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) fi if test -z "$x_includes" || test "x$x_includes" = xNONE; then X_INCLUDES="" x_includes="."; dnl better than nothing :- else X_INCLUDES="-I$x_includes" fi if test -z "$x_libraries" || test "x$x_libraries" = xNONE; then X_LDFLAGS="" x_libraries="/usr/lib"; dnl better than nothing :- all_libraries="" else X_LDFLAGS="-L$x_libraries" all_libraries=$X_LDFLAGS fi AC_SUBST(X_INCLUDES) AC_SUBST(X_LDFLAGS) AC_SUBST(x_libraries) AC_SUBST(x_includes) all_includes=$X_INCLUDES ]) dnl slightly changed version of AC_CHECK_FUNC(setenv) AC_DEFUN(AC_CHECK_SETENV, [AC_MSG_CHECKING([for setenv]) AC_CACHE_VAL(ac_cv_func_setenv, [AC_LANG_C AC_TRY_LINK( dnl Don't include because on OSF/1 3.0 it includes dnl which includes which contains a prototype for dnl select. Similarly for bzero. [#include ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus extern "C" #endif ])dnl [/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #include ], [ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$1) || defined (__stub___$1) choke me #else setenv("TEST", "alle", 1); #endif ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")]) if test "$ac_cv_func_setenv" = "yes"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV) else AC_MSG_RESULT(no) fi ]) AC_DEFUN(AC_CHECK_GETDOMAINNAME, [ AC_LANG_CPLUSPLUS save_CXXFLAGS=$CXXFLAGS if test "$GCC" = "yes"; then CXXFLAGS="$CXXFLAGS -pedantic-errors" fi AC_MSG_CHECKING(for getdomainname) AC_CACHE_VAL(ac_cv_func_getdomainname, [ AC_TRY_COMPILE([ #include #include ], [ char buffer[200]; getdomainname(buffer, 200); ], ac_cv_func_getdomainname=yes, ac_cv_func_getdomainname=no) ]) AC_MSG_RESULT($ac_cv_func_getdomainname) if eval "test \"`echo `$ac_cv_func_getdomainname\" = yes"; then AC_DEFINE(HAVE_GETDOMAINNAME) fi CXXFLAGS=$save_CXXFLAGS ]) AC_DEFUN(AC_CHECK_GETHOSTNAME, [ AC_LANG_CPLUSPLUS save_CXXFLAGS=$CXXFLAGS if test "$GCC" = "yes"; then CXXFLAGS="$CXXFLAGS -pedantic-errors" fi AC_MSG_CHECKING([for gethostname]) AC_CACHE_VAL(ac_cv_func_gethostname, [ AC_TRY_COMPILE([ #include #include ], [ char buffer[200]; gethostname(buffer, 200); ], ac_cv_func_gethostname=yes, ac_cv_func_gethostname=no) ]) AC_MSG_RESULT($ac_cv_func_gethostname) if eval "test \"`echo `$ac_cv_func_gethostname\" = yes"; then AC_DEFINE(HAVE_GETHOSTNAME) fi CXXFLAGS=$save_CXXFLAGS ]) AC_DEFUN(AC_CHECK_USLEEP, [ AC_LANG_CPLUSPLUS AC_MSG_CHECKING([for usleep]) AC_CACHE_VAL(ac_cv_func_usleep, [ ac_libs_safe=$LIBS LIBS="$LIBS $LIBUCB" AC_TRY_LINK([ #include #include ], [ usleep(200); ], ac_cv_func_usleep=yes, ac_cv_func_usleep=no) ]) AC_MSG_RESULT($ac_cv_func_usleep) if eval "test \"`echo `$ac_cv_func_usleep\" = yes"; then AC_DEFINE(HAVE_USLEEP) fi LIBS=$ac_libs_safe ]) AC_DEFUN(AC_FIND_GIF, [AC_MSG_CHECKING([for giflib]) AC_CACHE_VAL(ac_cv_lib_gif, [ac_save_LIBS="$LIBS" LIBS="$all_libraries -lgif -lX11 $LIBSOCKET" AC_TRY_LINK(dnl [ #ifdef __cplusplus extern "C" { #endif int GifLastError(void); #ifdef __cplusplus } #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ ], [return GifLastError();], eval "ac_cv_lib_gif=yes", eval "ac_cv_lib_gif=no") LIBS="$ac_save_LIBS" ])dnl if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_LIBGIF) else AC_MSG_ERROR(You need giflib23.) fi ]) AC_DEFUN(AC_FIND_JPEG, [AC_MSG_CHECKING([for jpeglib]) AC_CACHE_VAL(ac_cv_lib_jpeg, [ac_save_LIBS="$LIBS" LIBS="$all_libraries -ljpeg -lm" AC_TRY_LINK( [/* Override any gcc2 internal prototype to avoid an error. */ struct jpeg_decompress_struct; typedef struct jpeg_decompress_struct * j_decompress_ptr; typedef int size_t; #ifdef __cplusplus extern "C" { #endif void jpeg_CreateDecompress(j_decompress_ptr cinfo, int version, size_t structsize); #ifdef __cplusplus } #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ ], [jpeg_CreateDecompress(0L, 0, 0);], eval "ac_cv_lib_jpeg=-ljpeg", eval "ac_cv_lib_jpeg=no") LIBS="$ac_save_LIBS" dnl what to do, if the normal way fails: if eval "test \"`echo $ac_cv_lib_jpeg`\" = no"; then if test -f "$kde_libraries/libjpeg.so"; then test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so ac_cv_lib_jpeg="-L\${topdir} -ljpegkde" else if test -f "$kde_libraries/libjpeg.sl"; then test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl ac_cv_lib_jpeg="-L\${topdir} -ljpegkde" else if test -f "$kde_libraries/libjpeg.a"; then test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a ac_cv_lib_jpeg="-L\${topdir} -ljpegkde" else AC_MSG_ERROR([ You need jpeglib6a. ]) fi fi fi fi ])dnl if eval "test ! \"`echo $ac_cv_lib_jpeg`\" = no"; then LIBJPEG=$ac_cv_lib_jpeg AC_SUBST(LIBJPEG) AC_MSG_RESULT($ac_cv_lib_jpeg) AC_DEFINE_UNQUOTED(HAVE_LIBJPEG) fi ]) AC_DEFUN(AC_CHECK_BOOL, [ AC_MSG_CHECKING([for bool]) AC_CACHE_VAL(ac_cv_have_bool, [ AC_LANG_CPLUSPLUS AC_TRY_COMPILE([], [bool aBool = true;], [ac_cv_have_bool="yes"], [ac_cv_have_bool="no"]) ]) dnl end AC_CHECK_VAL AC_MSG_RESULT($ac_cv_have_bool) if test "$ac_cv_have_bool" = "yes"; then AC_DEFINE(HAVE_BOOL) fi ]) AC_DEFUN(AC_CHECK_GNU_EXTENSIONS, [ AC_MSG_CHECKING(if you need GNU extensions) AC_CACHE_VAL(ac_cv_gnu_extensions, [ cat > conftest.c << EOF #include #ifdef __GNU_LIBRARY__ yes #endif EOF if (eval "$ac_cpp conftest.c") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* ac_cv_gnu_extensions=yes else ac_cv_gnu_extensions=no fi ]) AC_MSG_RESULT($ac_cv_gnu_extensions) if test "$ac_cv_gnu_extensions" = "yes"; then AC_DEFINE_UNQUOTED(_GNU_SOURCE) fi ]) AC_DEFUN(AC_CHECK_COMPILERS, [ dnl this is somehow a fat lie, but prevents other macros from double checking AC_PROVIDE([AC_PROG_CC]) AC_PROVIDE([AC_PROG_CPP]) AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]], [ if test $enableval = "no"; dnl then ac_use_debug_code="no" else ac_use_debug_code="yes" fi ], [ac_use_debug_code="no"]) dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it AC_MSG_CHECKING(for a C-Compiler) dnl if there is one, print out. if not, don't matter AC_MSG_RESULT($CC) if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) AC_PROG_CC_WORKS AC_PROG_CC_GNU if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi if test -z "$CFLAGS"; then if test "$ac_use_debug_code" = "yes"; then AC_PROG_CC_G if test $ac_cv_prog_cc_g = yes; then CFLAGS="-g" fi else if test "$GCC" = "yes"; then CFLAGS="-O2" else CFLAGS="" fi fi if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall" fi fi if test -z "$LDFLAGS" && test "$ac_use_debug_code" = "no" && test "$GCC" = "yes"; then LDFLAGS="-s" fi dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?) AC_MSG_CHECKING(how to run the C preprocessor) # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then AC_CACHE_VAL(ac_cv_prog_CPP, [ # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. dnl Use a header file that comes with gcc, so configuring glibc dnl with a fresh cross-compiler works. AC_TRY_CPP([#include Syntax Error], , CPP="${CC-cc} -E -traditional-cpp" AC_TRY_CPP([#include Syntax Error], , CPP=/lib/cpp)) ac_cv_prog_CPP="$CPP"])dnl CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi AC_MSG_RESULT($CPP) AC_SUBST(CPP)dnl AC_MSG_CHECKING(for a C++-Compiler) dnl if there is one, print out. if not, don't matter AC_MSG_RESULT($CXX) if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH]) AC_PROG_CXX_WORKS AC_PROG_CXX_GNU if test $ac_cv_prog_gxx = yes; then GXX=yes else AC_MSG_CHECKING(whether we are using SPARC CC) GXX= cat > conftest.C << EOF #ifdef __SUNPRO_CC yes; #endif EOF ac_try="$CXX -E conftest.C" if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_CC=yes else ac_cv_prog_CC=no fi AC_MSG_RESULT($ac_cv_prog_CC) fi if test -z "$CXXFLAGS"; then if test "$ac_use_debug_code" = "yes"; then AC_PROG_CXX_G if test $ac_cv_prog_cxx_g = yes; then CXXFLAGS="-g" fi if test "$ac_cv_prog_CC" = "yes"; then CXXFLAGS="$CXXFLAGS -pto" fi else if test "$GXX" = "yes"; then CXXFLAGS="-O2" else if test "$ac_cv_prog_CC" = "yes"; then CXXFLAGS="-pto -O2" else CXXFLAGS="" fi fi fi if test "$GXX" = "yes"; then CXXFLAGS="$CXXFLAGS -Wall" fi fi ]) dnl just a wrapper to clean up configure.in AC_DEFUN(KDE_PROG_LIBTOOL, [ dnl libtool is only for C, so I must force him dnl to find the correct flags for C++ ac_save_cc=$CC ac_save_cflags=$CFLAGS CC=$CXX CFLAGS=$CXXFLAGS AM_ENABLE_SHARED(yes) AM_ENABLE_STATIC(no) AM_PROG_LIBTOOL dnl for libraries CC=$ac_save_cc CFLAGS=$ac_save_cflags ]) dnl Check for the type of the third argument of getsockname AC_DEFUN(AC_CHECK_KSIZE_T, [AC_MSG_CHECKING(for the third argument of getsockname) AC_LANG_CPLUSPLUS AC_CACHE_VAL(ac_cv_ksize_t_int, [AC_TRY_COMPILE([#include #include ],[int a=0; getsockname(0,(struct sockaddr*)0, &a);], eval "ac_cv_ksize_t_int=yes", eval "ac_cv_ksize_t_int=no")]) if eval "test \"`echo `$ac_cv_ksize_t_int\" = yes"; then AC_MSG_RESULT(int) AC_DEFINE(ksize_t, int) else AC_MSG_RESULT(size_t) AC_DEFINE(ksize_t, size_t) fi ]) dnl From Jim Meyering. Use this if you use the GNU error.[ch]. dnl FIXME: Migrate into libit AC_DEFUN(AM_FUNC_ERROR_AT_LINE, [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line, [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");], am_cv_lib_error_at_line=yes, am_cv_lib_error_at_line=no)]) if test $am_cv_lib_error_at_line = no; then LIBOBJS="$LIBOBJS error.o" fi AC_SUBST(LIBOBJS)dnl ]) # Macro to add for using GNU gettext. # Ulrich Drepper , 1995. AC_DEFUN(AC_HAVE_XPM, [AC_REQUIRE_CPP()dnl test -z "$XPM_LDFLAGS" && XPM_LDFLAGS= test -z "$XPM_INCLUDE" && XPM_INCLUDE= AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests], xpm_test=$withval, xpm_test="yes") if test "x$xpm_test" = xno; then ac_cv_have_xpm=no else AC_MSG_CHECKING(for XPM) AC_CACHE_VAL(ac_cv_have_xpm, [ AC_LANG_C ac_save_ldflags=$LDFLAGS ac_save_cflags=$CFLAGS LDFLAGS="$LDFLAGS $XPM_LDFLAGS $X_LDFLAGS $QT_LDFLAGS -lXpm -lX11 -lXext $LIBSOCKET" CFLAGS="$CFLAGS $X_INCLUDES" test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS" AC_TRY_LINK([#include ],[], ac_cv_have_xpm="yes",ac_cv_have_xpm="no") LDFLAGS=$ac_save_ldflags CFLAGS=$ac_save_cflags ])dnl if test "$ac_cv_have_xpm" = no; then AC_MSG_RESULT(no) XPM_LDFLAGS="" XPMINC="" $2 else AC_DEFINE(HAVE_XPM) if test "$XPM_LDFLAGS" = ""; then XPMLIB="-lXpm" else XPMLIB="-L$XPM_LDFLAGS -lXpm" fi if test "$XPM_INCLUDE" = ""; then XPMINC="" else XPMINC="-I$XPM_INCLUDE" fi AC_MSG_RESULT(yes) $1 fi fi AC_SUBST(XPMINC) AC_SUBST(XPMLIB) ]) AC_DEFUN(AC_HAVE_GL, [AC_REQUIRE_CPP()dnl test -z "$GL_LDFLAGS" && GL_LDFLAGS= test -z "$GL_INCLUDE" && GL_INCLUDE= AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes], gl_test=$withval, gl_test="yes") if test "x$gl_test" = xno; then ac_cv_have_gl=no else AC_MSG_CHECKING(for GL) AC_CACHE_VAL(ac_cv_have_gl, [ AC_LANG_C ac_save_ldflags=$LDFLAGS ac_save_cflags=$CFLAGS LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $QT_LDFLAGS -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET" CFLAGS="$CFLAGS $X_INCLUDES" test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" AC_TRY_LINK([],[], ac_cv_have_gl="yes",ac_cv_have_gl="no") LDFLAGS=$ac_save_ldflags CFLAGS=$ac_save_cflags ])dnl if test "$ac_cv_have_gl" = no; then AC_MSG_RESULT(no) GL_LDFLAGS="" GLINC="" $2 else AC_DEFINE(HAVE_GL) if test "$GL_LDFLAGS" = ""; then GLLIB="-lMesaGL -lMesaGLU" else GLLIB="-L$GL_LDFLAGS -lMesaGL -lMesaGLU" fi if test "$GL_INCLUDE" = ""; then GLINC="" else GLINC="-I$GL_INCLUDE" fi AC_MSG_RESULT(yes) $1 fi fi AC_SUBST(GLINC) AC_SUBST(GLLIB) ]) dnl PAM pam dnl Should test for PAM (Pluggable Authentication Modules) AC_DEFUN(AC_PATH_PAM_DIRECT, [test -z "$pam_direct_test_library" && pam_direct_test_library=pam test -z "$pam_direct_test_library" && pam_direct_test_library=pam_misc test -z "$pam_direct_test_library" && pam_direct_test_library=dl test -z "$pam_direct_test_function" && pam_direct_test_function=pam_start test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_misc.h for ac_dir in \ \ /usr/local/include \ /usr/include \ /usr/unsupported/include \ /opt/include \ /usr/pam/include \ /usr/local/pam/include \ /usr/lib/pam/include \ \ $extra_include \ ; \ do if test -r "$ac_dir/$pam_direct_test_include"; then no_pam= ac_pam_includes=$ac_dir break fi done # Check for the libraries. # See if we find them without any special options. # Do not add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="-l$pam_direct_test_library $LIBS" # First see if replacing the include by lib works. for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \ \ /lib \ /usr/lib \ /usr/local/lib \ /usr/unsupported/lib \ /lib/security \ /usr/security/lib \ $extra_lib \ ; \ do for ac_extension in a so sl; do if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then no_pam= ac_pam_libraries=$ac_dir break 2 fi done done LIBS="$ac_save_LIBS" ]) AC_DEFUN(AC_PATH_PAM, [AC_REQUIRE_CPP()dnl pam_includes=NONE pam_libraries=NONE AC_MSG_CHECKING(for PAM) AC_ARG_WITH(pam, [ --without-pam disable Pluggable Authentication Modules]) if test "x$with_pam" = xno; then no_pam=yes else if test "x$pam_includes" != xNONE && test "x$pam_libraries" != xNONE; then no_pam= else AC_CACHE_VAL(ac_cv_path_pam, [# One or both of these vars are not set, and there is no cached value. no_pam=yes AC_PATH_PAM_DIRECT if test "$no_pam" = yes; then ac_cv_path_pam="no_pam=yes" else ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries" fi])dnl fi eval "$ac_cv_path_pam" fi # with_pam != no if test "$no_pam" = yes; then AC_MSG_RESULT(no) else AC_DEFINE(HAVE_PAM) PAMLIBS="-lpam -lpam_misc -ldl" test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries ac_cv_path_pam="no_pam= ac_pam_includes=$pam_includes ac_pam_libraries=$pam_libraries" AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes]) fi if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then PAMLDFLAGS=":$pam_libraries" PAMLIBPATHS="-L$pam_libraries" fi if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then PAMINC="-I$pam_includes" fi AC_SUBST(PAMINC) AC_SUBST(PAMLIBS) AC_SUBST(PAMLIBPATHS) ]) AC_DEFUN(XB_CHECK_DLOPEN, [ AC_CHECK_LIB(dl, dlopen, [ LIBDL="-ldl" ac_cv_have_dlfcn=yes ]) AC_CHECK_LIB(dld, shl_unload, [ LIBDL="-ldld" ac_cv_have_shload=yes ]) AC_SUBST(LIBDL) AC_CHECK_HEADERS(dlfcn.h dl.h) if test "$ac_cv_header_dlfcn_h" = "no"; then ac_cv_have_dlfcn=no fi if test "$ac_cv_header_dl_h" = "no"; then ac_cv_have_shload=no fi AC_ARG_ENABLE(dlopen, [ --disable-dlopen link staticly [default=no]] , [if test "$enableval" = yes; then enable_dlopen=yes else enable_dlopen=no fi], enable_dlopen=yes) # override the user's opinion, if we know it better ;) if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then enable_dlopen=no fi if test "$ac_cv_have_dlfcn" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_DLFCN) fi if test "$ac_cv_have_shload" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_SHLOAD) fi if test "$enable_dlopen" = no ; then $1 else $2 fi ]) AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING, [ KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no) KDE_PROG_LIBTOOL AC_MSG_CHECKING([dynamic loading]) eval "`egrep '^build_libtool_libs=' libtool`" if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then dynamic_loading=yes AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING) else dynamic_loading=no fi AC_MSG_RESULT($dynamic_loading) if test "$dynamic_loading" = "yes"; then $1 else $2 fi ]) ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- ## Copyright (C) 1996-1998 Free Software Foundation, Inc. ## Gordon Matzigkeit , 1996 ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## ## As a special exception to the GNU General Public License, if you ## distribute this file as part of a program that contains a ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. # serial 20 AM_PROG_LIBTOOL AC_DEFUN(AM_PROG_LIBTOOL, [AC_REQUIRE([AM_ENABLE_SHARED])dnl AC_REQUIRE([AM_ENABLE_STATIC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AM_PROG_LD])dnl AC_REQUIRE([AM_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl dnl # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent' AC_SUBST(LIBTOOL)dnl # Check for any special flags to pass to ltconfig. libtool_flags= test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$silent" = yes && libtool_flags="$libtool_flags --silent" test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Some flags need to be propagated to the compiler or linker for good # libtool support. case "$host" in *-*-irix*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. CFLAGS="$CFLAGS -belf" ;; esac # Actually configure libtool. ac_aux_dir is where install-sh is found. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ || AC_MSG_ERROR([libtool configure failed]) ]) # AM_ENABLE_SHARED - implement the --enable-shared flag # Usage: AM_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AM_ENABLE_SHARED, [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [if test "$enableval" = no; then enable_shared=no else enable_shared=yes fi], enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl ]) # AM_DISABLE_SHARED - set the default shared flag to --disable-static AC_DEFUN(AM_DISABLE_SHARED, [AM_ENABLE_SHARED(no)]) # AM_DISABLE_STATIC - set the default static flag to --disable-static AC_DEFUN(AM_DISABLE_STATIC, [AM_ENABLE_STATIC(no)]) # AM_ENABLE_STATIC - implement the --enable-static flag # Usage: AM_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AM_ENABLE_STATIC, [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [if test "$enableval" = no; then enable_static=no else enable_static=yes fi], enable_static=AM_ENABLE_STATIC_DEFAULT)dnl ]) # AM_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN(AM_PROG_LD, [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC]) ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. /*) test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(ac_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog"; then ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else ac_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$ac_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_SUBST(LD) AM_PROG_LD_GNU ]) AC_DEFUN(AM_PROG_LD_GNU, [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then ac_cv_prog_gnu_ld=yes else ac_cv_prog_gnu_ld=no fi]) ]) # AM_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN(AM_PROG_NM, [AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(ac_cv_path_NM, [case "$NM" in /*) ac_cv_path_NM="$NM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do test -z "$ac_dir" && dir=. if test -f $ac_dir/nm; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1!d' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -B" elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -p" else ac_cv_path_NM="$ac_dir/nm" fi break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm ;; esac]) NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) AC_SUBST(NM) ]) xbase-2.0.0/aclocal.m40000644000000000000000000007357607316216671010135 dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. AC_DEFUN(AC_FIND_FILE, [ $3=NO for i in $2; do for j in $1; do if test -r "$i/$j"; then $3=$i break 2 fi done done ]) AC_DEFUN(K_PATH_X, [ AC_MSG_CHECKING(for X) AC_CACHE_VAL(ac_cv_have_x, [# One or both of the vars are not set, and there is no cached value. ac_x_includes=NO ac_x_libraries=NO AC_PATH_X_DIRECT AC_PATH_X_XMKMF if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!]) else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi])dnl eval "$ac_cv_have_x" if test "$have_x" != yes; then AC_MSG_RESULT($have_x) no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) fi if test -z "$x_includes" || test "x$x_includes" = xNONE; then X_INCLUDES="" x_includes="."; dnl better than nothing :- else X_INCLUDES="-I$x_includes" fi if test -z "$x_libraries" || test "x$x_libraries" = xNONE; then X_LDFLAGS="" x_libraries="/usr/lib"; dnl better than nothing :- all_libraries="" else X_LDFLAGS="-L$x_libraries" all_libraries=$X_LDFLAGS fi AC_SUBST(X_INCLUDES) AC_SUBST(X_LDFLAGS) AC_SUBST(x_libraries) AC_SUBST(x_includes) all_includes=$X_INCLUDES ]) dnl slightly changed version of AC_CHECK_FUNC(setenv) AC_DEFUN(AC_CHECK_SETENV, [AC_MSG_CHECKING([for setenv]) AC_CACHE_VAL(ac_cv_func_setenv, [AC_LANG_C AC_TRY_LINK( dnl Don't include because on OSF/1 3.0 it includes dnl which includes which contains a prototype for dnl select. Similarly for bzero. [#include ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus extern "C" #endif ])dnl [/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #include ], [ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$1) || defined (__stub___$1) choke me #else setenv("TEST", "alle", 1); #endif ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")]) if test "$ac_cv_func_setenv" = "yes"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV) else AC_MSG_RESULT(no) fi ]) AC_DEFUN(AC_CHECK_GETDOMAINNAME, [ AC_LANG_CPLUSPLUS save_CXXFLAGS=$CXXFLAGS if test "$GCC" = "yes"; then CXXFLAGS="$CXXFLAGS -pedantic-errors" fi AC_MSG_CHECKING(for getdomainname) AC_CACHE_VAL(ac_cv_func_getdomainname, [ AC_TRY_COMPILE([ #include #include ], [ char buffer[200]; getdomainname(buffer, 200); ], ac_cv_func_getdomainname=yes, ac_cv_func_getdomainname=no) ]) AC_MSG_RESULT($ac_cv_func_getdomainname) if eval "test \"`echo `$ac_cv_func_getdomainname\" = yes"; then AC_DEFINE(HAVE_GETDOMAINNAME) fi CXXFLAGS=$save_CXXFLAGS ]) AC_DEFUN(AC_CHECK_GETHOSTNAME, [ AC_LANG_CPLUSPLUS save_CXXFLAGS=$CXXFLAGS if test "$GCC" = "yes"; then CXXFLAGS="$CXXFLAGS -pedantic-errors" fi AC_MSG_CHECKING([for gethostname]) AC_CACHE_VAL(ac_cv_func_gethostname, [ AC_TRY_COMPILE([ #include #include ], [ char buffer[200]; gethostname(buffer, 200); ], ac_cv_func_gethostname=yes, ac_cv_func_gethostname=no) ]) AC_MSG_RESULT($ac_cv_func_gethostname) if eval "test \"`echo `$ac_cv_func_gethostname\" = yes"; then AC_DEFINE(HAVE_GETHOSTNAME) fi CXXFLAGS=$save_CXXFLAGS ]) AC_DEFUN(AC_CHECK_USLEEP, [ AC_LANG_CPLUSPLUS AC_MSG_CHECKING([for usleep]) AC_CACHE_VAL(ac_cv_func_usleep, [ ac_libs_safe=$LIBS LIBS="$LIBS $LIBUCB" AC_TRY_LINK([ #include #include ], [ usleep(200); ], ac_cv_func_usleep=yes, ac_cv_func_usleep=no) ]) AC_MSG_RESULT($ac_cv_func_usleep) if eval "test \"`echo `$ac_cv_func_usleep\" = yes"; then AC_DEFINE(HAVE_USLEEP) fi LIBS=$ac_libs_safe ]) AC_DEFUN(AC_FIND_GIF, [AC_MSG_CHECKING([for giflib]) AC_CACHE_VAL(ac_cv_lib_gif, [ac_save_LIBS="$LIBS" LIBS="$all_libraries -lgif -lX11 $LIBSOCKET" AC_TRY_LINK(dnl [ #ifdef __cplusplus extern "C" { #endif int GifLastError(void); #ifdef __cplusplus } #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ ], [return GifLastError();], eval "ac_cv_lib_gif=yes", eval "ac_cv_lib_gif=no") LIBS="$ac_save_LIBS" ])dnl if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_LIBGIF) else AC_MSG_ERROR(You need giflib23.) fi ]) AC_DEFUN(AC_FIND_JPEG, [AC_MSG_CHECKING([for jpeglib]) AC_CACHE_VAL(ac_cv_lib_jpeg, [ac_save_LIBS="$LIBS" LIBS="$all_libraries -ljpeg -lm" AC_TRY_LINK( [/* Override any gcc2 internal prototype to avoid an error. */ struct jpeg_decompress_struct; typedef struct jpeg_decompress_struct * j_decompress_ptr; typedef int size_t; #ifdef __cplusplus extern "C" { #endif void jpeg_CreateDecompress(j_decompress_ptr cinfo, int version, size_t structsize); #ifdef __cplusplus } #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ ], [jpeg_CreateDecompress(0L, 0, 0);], eval "ac_cv_lib_jpeg=-ljpeg", eval "ac_cv_lib_jpeg=no") LIBS="$ac_save_LIBS" dnl what to do, if the normal way fails: if eval "test \"`echo $ac_cv_lib_jpeg`\" = no"; then if test -f "$kde_libraries/libjpeg.so"; then test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so ac_cv_lib_jpeg="-L\${topdir} -ljpegkde" else if test -f "$kde_libraries/libjpeg.sl"; then test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl ac_cv_lib_jpeg="-L\${topdir} -ljpegkde" else if test -f "$kde_libraries/libjpeg.a"; then test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a ac_cv_lib_jpeg="-L\${topdir} -ljpegkde" else AC_MSG_ERROR([ You need jpeglib6a. ]) fi fi fi fi ])dnl if eval "test ! \"`echo $ac_cv_lib_jpeg`\" = no"; then LIBJPEG=$ac_cv_lib_jpeg AC_SUBST(LIBJPEG) AC_MSG_RESULT($ac_cv_lib_jpeg) AC_DEFINE_UNQUOTED(HAVE_LIBJPEG) fi ]) AC_DEFUN(AC_CHECK_BOOL, [ AC_MSG_CHECKING([for bool]) AC_CACHE_VAL(ac_cv_have_bool, [ AC_LANG_CPLUSPLUS AC_TRY_COMPILE([], [bool aBool = true;], [ac_cv_have_bool="yes"], [ac_cv_have_bool="no"]) ]) dnl end AC_CHECK_VAL AC_MSG_RESULT($ac_cv_have_bool) if test "$ac_cv_have_bool" = "yes"; then AC_DEFINE(HAVE_BOOL) fi ]) AC_DEFUN(AC_CHECK_GNU_EXTENSIONS, [ AC_MSG_CHECKING(if you need GNU extensions) AC_CACHE_VAL(ac_cv_gnu_extensions, [ cat > conftest.c << EOF #include #ifdef __GNU_LIBRARY__ yes #endif EOF if (eval "$ac_cpp conftest.c") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* ac_cv_gnu_extensions=yes else ac_cv_gnu_extensions=no fi ]) AC_MSG_RESULT($ac_cv_gnu_extensions) if test "$ac_cv_gnu_extensions" = "yes"; then AC_DEFINE_UNQUOTED(_GNU_SOURCE) fi ]) AC_DEFUN(AC_CHECK_COMPILERS, [ dnl this is somehow a fat lie, but prevents other macros from double checking AC_PROVIDE([AC_PROG_CC]) AC_PROVIDE([AC_PROG_CPP]) AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]], [ if test $enableval = "no"; dnl then ac_use_debug_code="no" else ac_use_debug_code="yes" fi ], [ac_use_debug_code="no"]) dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it AC_MSG_CHECKING(for a C-Compiler) dnl if there is one, print out. if not, don't matter AC_MSG_RESULT($CC) if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) AC_PROG_CC_WORKS AC_PROG_CC_GNU if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi if test -z "$CFLAGS"; then if test "$ac_use_debug_code" = "yes"; then AC_PROG_CC_G if test $ac_cv_prog_cc_g = yes; then CFLAGS="-g" fi else if test "$GCC" = "yes"; then CFLAGS="-O2" else CFLAGS="" fi fi if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall" fi fi if test -z "$LDFLAGS" && test "$ac_use_debug_code" = "no" && test "$GCC" = "yes"; then LDFLAGS="-s" fi dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?) AC_MSG_CHECKING(how to run the C preprocessor) # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then AC_CACHE_VAL(ac_cv_prog_CPP, [ # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. dnl Use a header file that comes with gcc, so configuring glibc dnl with a fresh cross-compiler works. AC_TRY_CPP([#include Syntax Error], , CPP="${CC-cc} -E -traditional-cpp" AC_TRY_CPP([#include Syntax Error], , CPP=/lib/cpp)) ac_cv_prog_CPP="$CPP"])dnl CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi AC_MSG_RESULT($CPP) AC_SUBST(CPP)dnl AC_MSG_CHECKING(for a C++-Compiler) dnl if there is one, print out. if not, don't matter AC_MSG_RESULT($CXX) if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH]) AC_PROG_CXX_WORKS AC_PROG_CXX_GNU if test $ac_cv_prog_gxx = yes; then GXX=yes else AC_MSG_CHECKING(whether we are using SPARC CC) GXX= cat > conftest.C << EOF #ifdef __SUNPRO_CC yes; #endif EOF ac_try="$CXX -E conftest.C" if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_CC=yes else ac_cv_prog_CC=no fi AC_MSG_RESULT($ac_cv_prog_CC) fi if test -z "$CXXFLAGS"; then if test "$ac_use_debug_code" = "yes"; then AC_PROG_CXX_G if test $ac_cv_prog_cxx_g = yes; then CXXFLAGS="-g" fi if test "$ac_cv_prog_CC" = "yes"; then CXXFLAGS="$CXXFLAGS -pto" fi else if test "$GXX" = "yes"; then CXXFLAGS="-O2" else if test "$ac_cv_prog_CC" = "yes"; then CXXFLAGS="-pto -O2" else CXXFLAGS="" fi fi fi if test "$GXX" = "yes"; then CXXFLAGS="$CXXFLAGS -Wall" fi fi ]) dnl just a wrapper to clean up configure.in AC_DEFUN(KDE_PROG_LIBTOOL, [ dnl libtool is only for C, so I must force him dnl to find the correct flags for C++ ac_save_cc=$CC ac_save_cflags=$CFLAGS CC=$CXX CFLAGS=$CXXFLAGS AM_ENABLE_SHARED(yes) AM_ENABLE_STATIC(no) AM_PROG_LIBTOOL dnl for libraries CC=$ac_save_cc CFLAGS=$ac_save_cflags ]) dnl Check for the type of the third argument of getsockname AC_DEFUN(AC_CHECK_KSIZE_T, [AC_MSG_CHECKING(for the third argument of getsockname) AC_LANG_CPLUSPLUS AC_CACHE_VAL(ac_cv_ksize_t_int, [AC_TRY_COMPILE([#include #include ],[int a=0; getsockname(0,(struct sockaddr*)0, &a);], eval "ac_cv_ksize_t_int=yes", eval "ac_cv_ksize_t_int=no")]) if eval "test \"`echo `$ac_cv_ksize_t_int\" = yes"; then AC_MSG_RESULT(int) AC_DEFINE(ksize_t, int) else AC_MSG_RESULT(size_t) AC_DEFINE(ksize_t, size_t) fi ]) dnl From Jim Meyering. Use this if you use the GNU error.[ch]. dnl FIXME: Migrate into libit AC_DEFUN(AM_FUNC_ERROR_AT_LINE, [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line, [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");], am_cv_lib_error_at_line=yes, am_cv_lib_error_at_line=no)]) if test $am_cv_lib_error_at_line = no; then LIBOBJS="$LIBOBJS error.o" fi AC_SUBST(LIBOBJS)dnl ]) # Macro to add for using GNU gettext. # Ulrich Drepper , 1995. AC_DEFUN(AC_HAVE_XPM, [AC_REQUIRE_CPP()dnl test -z "$XPM_LDFLAGS" && XPM_LDFLAGS= test -z "$XPM_INCLUDE" && XPM_INCLUDE= AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests], xpm_test=$withval, xpm_test="yes") if test "x$xpm_test" = xno; then ac_cv_have_xpm=no else AC_MSG_CHECKING(for XPM) AC_CACHE_VAL(ac_cv_have_xpm, [ AC_LANG_C ac_save_ldflags=$LDFLAGS ac_save_cflags=$CFLAGS LDFLAGS="$LDFLAGS $XPM_LDFLAGS $X_LDFLAGS $QT_LDFLAGS -lXpm -lX11 -lXext $LIBSOCKET" CFLAGS="$CFLAGS $X_INCLUDES" test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS" AC_TRY_LINK([#include ],[], ac_cv_have_xpm="yes",ac_cv_have_xpm="no") LDFLAGS=$ac_save_ldflags CFLAGS=$ac_save_cflags ])dnl if test "$ac_cv_have_xpm" = no; then AC_MSG_RESULT(no) XPM_LDFLAGS="" XPMINC="" $2 else AC_DEFINE(HAVE_XPM) if test "$XPM_LDFLAGS" = ""; then XPMLIB="-lXpm" else XPMLIB="-L$XPM_LDFLAGS -lXpm" fi if test "$XPM_INCLUDE" = ""; then XPMINC="" else XPMINC="-I$XPM_INCLUDE" fi AC_MSG_RESULT(yes) $1 fi fi AC_SUBST(XPMINC) AC_SUBST(XPMLIB) ]) AC_DEFUN(AC_HAVE_GL, [AC_REQUIRE_CPP()dnl test -z "$GL_LDFLAGS" && GL_LDFLAGS= test -z "$GL_INCLUDE" && GL_INCLUDE= AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes], gl_test=$withval, gl_test="yes") if test "x$gl_test" = xno; then ac_cv_have_gl=no else AC_MSG_CHECKING(for GL) AC_CACHE_VAL(ac_cv_have_gl, [ AC_LANG_C ac_save_ldflags=$LDFLAGS ac_save_cflags=$CFLAGS LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $QT_LDFLAGS -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET" CFLAGS="$CFLAGS $X_INCLUDES" test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" AC_TRY_LINK([],[], ac_cv_have_gl="yes",ac_cv_have_gl="no") LDFLAGS=$ac_save_ldflags CFLAGS=$ac_save_cflags ])dnl if test "$ac_cv_have_gl" = no; then AC_MSG_RESULT(no) GL_LDFLAGS="" GLINC="" $2 else AC_DEFINE(HAVE_GL) if test "$GL_LDFLAGS" = ""; then GLLIB="-lMesaGL -lMesaGLU" else GLLIB="-L$GL_LDFLAGS -lMesaGL -lMesaGLU" fi if test "$GL_INCLUDE" = ""; then GLINC="" else GLINC="-I$GL_INCLUDE" fi AC_MSG_RESULT(yes) $1 fi fi AC_SUBST(GLINC) AC_SUBST(GLLIB) ]) dnl PAM pam dnl Should test for PAM (Pluggable Authentication Modules) AC_DEFUN(AC_PATH_PAM_DIRECT, [test -z "$pam_direct_test_library" && pam_direct_test_library=pam test -z "$pam_direct_test_library" && pam_direct_test_library=pam_misc test -z "$pam_direct_test_library" && pam_direct_test_library=dl test -z "$pam_direct_test_function" && pam_direct_test_function=pam_start test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_misc.h for ac_dir in \ \ /usr/local/include \ /usr/include \ /usr/unsupported/include \ /opt/include \ /usr/pam/include \ /usr/local/pam/include \ /usr/lib/pam/include \ \ $extra_include \ ; \ do if test -r "$ac_dir/$pam_direct_test_include"; then no_pam= ac_pam_includes=$ac_dir break fi done # Check for the libraries. # See if we find them without any special options. # Do not add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="-l$pam_direct_test_library $LIBS" # First see if replacing the include by lib works. for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \ \ /lib \ /usr/lib \ /usr/local/lib \ /usr/unsupported/lib \ /lib/security \ /usr/security/lib \ $extra_lib \ ; \ do for ac_extension in a so sl; do if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then no_pam= ac_pam_libraries=$ac_dir break 2 fi done done LIBS="$ac_save_LIBS" ]) AC_DEFUN(AC_PATH_PAM, [AC_REQUIRE_CPP()dnl pam_includes=NONE pam_libraries=NONE AC_MSG_CHECKING(for PAM) AC_ARG_WITH(pam, [ --without-pam disable Pluggable Authentication Modules]) if test "x$with_pam" = xno; then no_pam=yes else if test "x$pam_includes" != xNONE && test "x$pam_libraries" != xNONE; then no_pam= else AC_CACHE_VAL(ac_cv_path_pam, [# One or both of these vars are not set, and there is no cached value. no_pam=yes AC_PATH_PAM_DIRECT if test "$no_pam" = yes; then ac_cv_path_pam="no_pam=yes" else ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries" fi])dnl fi eval "$ac_cv_path_pam" fi # with_pam != no if test "$no_pam" = yes; then AC_MSG_RESULT(no) else AC_DEFINE(HAVE_PAM) PAMLIBS="-lpam -lpam_misc -ldl" test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries ac_cv_path_pam="no_pam= ac_pam_includes=$pam_includes ac_pam_libraries=$pam_libraries" AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes]) fi if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then PAMLDFLAGS=":$pam_libraries" PAMLIBPATHS="-L$pam_libraries" fi if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then PAMINC="-I$pam_includes" fi AC_SUBST(PAMINC) AC_SUBST(PAMLIBS) AC_SUBST(PAMLIBPATHS) ]) AC_DEFUN(XB_CHECK_DLOPEN, [ AC_CHECK_LIB(dl, dlopen, [ LIBDL="-ldl" ac_cv_have_dlfcn=yes ]) AC_CHECK_LIB(dld, shl_unload, [ LIBDL="-ldld" ac_cv_have_shload=yes ]) AC_SUBST(LIBDL) AC_CHECK_HEADERS(dlfcn.h dl.h) if test "$ac_cv_header_dlfcn_h" = "no"; then ac_cv_have_dlfcn=no fi if test "$ac_cv_header_dl_h" = "no"; then ac_cv_have_shload=no fi AC_ARG_ENABLE(dlopen, [ --disable-dlopen link staticly [default=no]] , [if test "$enableval" = yes; then enable_dlopen=yes else enable_dlopen=no fi], enable_dlopen=yes) # override the user's opinion, if we know it better ;) if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then enable_dlopen=no fi if test "$ac_cv_have_dlfcn" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_DLFCN) fi if test "$ac_cv_have_shload" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_SHLOAD) fi if test "$enable_dlopen" = no ; then $1 else $2 fi ]) AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING, [ KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no) KDE_PROG_LIBTOOL AC_MSG_CHECKING([dynamic loading]) eval "`egrep '^build_libtool_libs=' libtool`" if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then dynamic_loading=yes AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING) else dynamic_loading=no fi AC_MSG_RESULT($dynamic_loading) if test "$dynamic_loading" = "yes"; then $1 else $2 fi ]) # serial 20 AM_PROG_LIBTOOL AC_DEFUN(AM_PROG_LIBTOOL, [AC_REQUIRE([AM_ENABLE_SHARED])dnl AC_REQUIRE([AM_ENABLE_STATIC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AM_PROG_LD])dnl AC_REQUIRE([AM_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl dnl # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent' AC_SUBST(LIBTOOL)dnl # Check for any special flags to pass to ltconfig. libtool_flags= test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$silent" = yes && libtool_flags="$libtool_flags --silent" test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Some flags need to be propagated to the compiler or linker for good # libtool support. case "$host" in *-*-irix*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. CFLAGS="$CFLAGS -belf" ;; esac # Actually configure libtool. ac_aux_dir is where install-sh is found. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ || AC_MSG_ERROR([libtool configure failed]) ]) # AM_ENABLE_SHARED - implement the --enable-shared flag # Usage: AM_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AM_ENABLE_SHARED, [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [if test "$enableval" = no; then enable_shared=no else enable_shared=yes fi], enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl ]) # AM_DISABLE_SHARED - set the default shared flag to --disable-static AC_DEFUN(AM_DISABLE_SHARED, [AM_ENABLE_SHARED(no)]) # AM_DISABLE_STATIC - set the default static flag to --disable-static AC_DEFUN(AM_DISABLE_STATIC, [AM_ENABLE_STATIC(no)]) # AM_ENABLE_STATIC - implement the --enable-static flag # Usage: AM_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AM_ENABLE_STATIC, [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [if test "$enableval" = no; then enable_static=no else enable_static=yes fi], enable_static=AM_ENABLE_STATIC_DEFAULT)dnl ]) # AM_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN(AM_PROG_LD, [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC]) ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. /*) test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(ac_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog"; then ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else ac_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$ac_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_SUBST(LD) AM_PROG_LD_GNU ]) AC_DEFUN(AM_PROG_LD_GNU, [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then ac_cv_prog_gnu_ld=yes else ac_cv_prog_gnu_ld=no fi]) ]) # AM_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN(AM_PROG_NM, [AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(ac_cv_path_NM, [case "$NM" in /*) ac_cv_path_NM="$NM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do test -z "$ac_dir" && dir=. if test -f $ac_dir/nm; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1!d' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -B" elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -p" else ac_cv_path_NM="$ac_dir/nm" fi break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm ;; esac]) NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) AC_SUBST(NM) ]) # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) xbase-2.0.0/config.guess0000755000000000000000000005733007115376105010577 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # The master version of this file is at the FSF in /home/gd/gnu/lib. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit system type (host/target name). # # Only a few systems have been added to this list; please add others # (but try to keep the structure clean). # # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 8/24/94.) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <dummy.s .globl main .ent main main: .frame \$30,0,\$26,0 .prologue 0 .long 0x47e03d80 # implver $0 lda \$2,259 .long 0x47e20c21 # amask $2,$1 srl \$1,8,\$2 sll \$2,2,\$2 sll \$0,3,\$0 addl \$1,\$0,\$0 addl \$2,\$0,\$0 ret \$31,(\$26),1 .end main EOF ${CC-cc} dummy.s -o dummy 2>/dev/null if test "$?" = 0 ; then ./dummy case "$?" in 7) UNAME_MACHINE="alpha" ;; 15) UNAME_MACHINE="alphaev5" ;; 14) UNAME_MACHINE="alphaev56" ;; 10) UNAME_MACHINE="alphapca56" ;; 16) UNAME_MACHINE="alphaev6" ;; esac fi rm -f dummy.s dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-cbm-sysv4 exit 0;; amiga:NetBSD:*:*) echo m68k-cbm-netbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; arm32:NetBSD:*:*) echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; SR2?01:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; atari*:NetBSD:*:*) echo m68k-atari-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >dummy.c int main (argc, argv) int argc; char **argv; { #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF ${CC-cc} dummy.c -o dummy \ && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i?86:AIX:*:*) echo i386-ibm-aix exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then sed 's/^ //' << EOF >dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:4) if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=4.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[3478]??:HP-UX:*:*) case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; 9000/8?? ) HP_ARCH=hppa1.0 ;; esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) sed 's/^ //' << EOF >dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i?86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F300:UNIX_System_V:*:*) FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; F301:UNIX_System_V:*:*) echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` exit 0 ;; hp3[0-9][05]:NetBSD:*:*) echo m68k-hp-netbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i?86:BSD/386:*:* | *:BSD/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:NetBSD:*:*) echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo i386-pc-cygwin32 exit 0 ;; i*:MINGW*:*) echo i386-pc-mingw32 exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin32 exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. ld_help_string=`ld --help 2>&1` ld_supported_emulations=`echo $ld_help_string \ | sed -ne '/supported emulations:/!d s/[ ][ ]*/ /g s/.*supported emulations: *// s/ .*// p'` case "$ld_supported_emulations" in i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then sed 's/^ //' <dummy.s .globl main .ent main main: .frame \$30,0,\$26,0 .prologue 0 .long 0x47e03d80 # implver $0 lda \$2,259 .long 0x47e20c21 # amask $2,$1 srl \$1,8,\$2 sll \$2,2,\$2 sll \$0,3,\$0 addl \$1,\$0,\$0 addl \$2,\$0,\$0 ret \$31,(\$26),1 .end main EOF LIBC="" ${CC-cc} dummy.s -o dummy 2>/dev/null if test "$?" = 0 ; then ./dummy case "$?" in 7) UNAME_MACHINE="alpha" ;; 15) UNAME_MACHINE="alphaev5" ;; 14) UNAME_MACHINE="alphaev56" ;; 10) UNAME_MACHINE="alphapca56" ;; 16) UNAME_MACHINE="alphaev6" ;; esac objdump --private-headers dummy | \ grep ld.so.1 > /dev/null if test "$?" = 0 ; then LIBC="libc1" fi fi rm -f dummy.s dummy echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 elif test "${UNAME_MACHINE}" = "mips" ; then cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 rm -f dummy.c dummy else # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. # If ld does not provide *any* "supported emulations:" # that means it is gnuoldld. echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 case "${UNAME_MACHINE}" in i?86) VENDOR=pc; ;; *) VENDOR=unknown; ;; esac # Determine whether the default compiler is a.out or elf cat >dummy.c < main(argc, argv) int argc; char *argv[]; { #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); # else printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); #endif return 0; } EOF ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 rm -f dummy.c dummy fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; i?86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; i?86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i?86:LynxOS:2.*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:*:6*) echo mips-sony-newsos6 exit 0 ;; R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 cat >dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) printf ("vax-dec-bsd\n"); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi #echo '(Unable to guess system type)' 1>&2 exit 1 xbase-2.0.0/config.sub0000755000000000000000000004653207115376114010244 #! /bin/sh # Configuration validation subroutine script, version 1.1. # Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. if [ x$1 = x ] then echo Configuration name missing. 1>&2 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 echo "or $0 ALIAS" 1>&2 echo where ALIAS is a recognized configuration type. 1>&2 exit 1 fi # First pass through any local machine types. case $1 in *local*) echo $1 exit 0 ;; *) ;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple) os= basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 \ | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \ | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ | mipstx39 | mipstx39el \ | sparc | sparclet | sparclite | sparc64 | v850) basic_machine=$basic_machine-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i[3456]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \ | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparc64-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \ | mipstx39-* | mipstx39el-* \ | f301-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-cbm ;; amigaos | amigados) basic_machine=m68k-cbm os=-amigaos ;; amigaunix | amix) basic_machine=m68k-cbm os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [ctj]90-cray) basic_machine=c90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; i370-ibm* | ibm*) basic_machine=i370-ibm os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i[3456]86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i[3456]86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i[3456]86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i[3456]86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; miniframe) basic_machine=m68000-convergent ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; np1) basic_machine=np1-gould ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5) basic_machine=i586-intel ;; pentiumpro | p6) basic_machine=i686-intel ;; pentium-* | p5-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; k5) # We don't have specific support for AMD's K5 yet, so just call it a Pentium basic_machine=i586-amd ;; nexen) # We don't have specific support for Nexgen yet, so just call it a Pentium basic_machine=i586-nexgen ;; pn) basic_machine=pn-gould ;; power) basic_machine=rs6000-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; symmetry) basic_machine=i386-sequent os=-dynix ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sparc) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv*) # Remember, each alternative MUST END IN *, to match a version number. ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -xenix) os=-xenix ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-semi) os=-aout ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-ibm) os=-aix ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f301-fujitsu) os=-uxpv ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -hpux*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os xbase-2.0.0/configure0000755000000000000000000030434707316216672010176 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --enable-debug creates debugging code [default=no]" ac_help="$ac_help --enable-shared build shared libraries [default=yes]" ac_help="$ac_help --enable-static build static libraries [default=no]" ac_help="$ac_help --with-gnu-ld assume the C compiler uses GNU ld [default=no]" ac_help="$ac_help --without-index-ndx do not compile .ndx index support " ac_help="$ac_help --without-index-ntx do not compile .ntx index support " ac_help="$ac_help --without-memo-fields do not compile memo fields support " ac_help="$ac_help --without-expressions do not compile expressions support " ac_help="$ac_help --without-ui-html do not compile HTML support " ac_help="$ac_help --without-xbase-locking turn off XBase file locking " ac_help="$ac_help --without-realdelete turn off XBase record deletion " ac_help="$ac_help --without-xbase-filters turn off XBase filter logic " ac_help="$ac_help --without-xbase-debug turn off XBase specific debug " ac_help="$ac_help --with-exceptions turn on exceptions " ac_help="$ac_help --with-castellano turn on spanish date logic " # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=acinclude.m4 # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Do some error checking and defaulting for the host and target type. # The inputs are: # configure --host=HOST --target=TARGET --build=BUILD NONOPT # # The rules are: # 1. You are not allowed to specify --host, --target, and nonopt at the # same time. # 2. Host defaults to nonopt. # 3. If nonopt is not specified, then host defaults to the current host, # as determined by config.guess. # 4. Target and build default to nonopt. # 5. If nonopt is not specified, then target and build default to host. # The aliases save the names the user supplied, while $host etc. # will get canonicalized. case $host---$target---$nonopt in NONE---*---* | *---NONE---* | *---*---NONE) ;; *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; esac # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 echo "configure:601: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 echo "configure:622: checking target system type" >&5 target_alias=$target case "$target_alias" in NONE) case $nonopt in NONE) target_alias=$host_alias ;; *) target_alias=$nonopt ;; esac ;; esac target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 echo "configure:640: checking build system type" >&5 build_alias=$build case "$build_alias" in NONE) case $nonopt in NONE) build_alias=$host_alias ;; *) build_alias=$nonopt ;; esac ;; esac build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$build" 1>&6 test "$host_alias" != "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," XSUBDIRS="xbase examples bin html libtest tv" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:697: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo "configure:750: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:788: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=xbase VERSION=2.0.0 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 echo "configure:827: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$ac_t""found" 1>&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo "configure:840: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$ac_t""found" 1>&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo "configure:853: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$ac_t""found" 1>&6 else AUTOMAKE="$missing_dir/missing automake" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo "configure:866: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$ac_t""found" 1>&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo "configure:879: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$ac_t""found" 1>&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$ac_t""missing" 1>&6 fi # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" if test $enableval = "no"; then ac_use_debug_code="no" else ac_use_debug_code="yes" fi else ac_use_debug_code="no" fi echo $ac_n "checking for a C-Compiler""... $ac_c" 1>&6 echo "configure:912: checking for a C-Compiler" >&5 echo "$ac_t""$CC" 1>&6 if test -z "$CC"; then # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:918: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:947: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test -z "$CC"; then # Extract the first word of "xlc", so it can be a program name with args. set dummy xlc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:995: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="xlc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1024: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 1035 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:1040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1066: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:1071: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi if test -z "$CFLAGS"; then if test "$ac_use_debug_code" = "yes"; then echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:1098: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test $ac_cv_prog_cc_g = yes; then CFLAGS="-g" fi else if test "$GCC" = "yes"; then CFLAGS="-O2" else CFLAGS="" fi fi if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall" fi fi if test -z "$LDFLAGS" && test "$ac_use_debug_code" = "no" && test "$GCC" = "yes"; then LDFLAGS="-s" fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1137: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for a C++-Compiler""... $ac_c" 1>&6 echo "configure:1199: checking for a C++-Compiler" >&5 echo "$ac_t""$CXX" 1>&6 if test -z "$CXX"; then # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1205: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="g++" break fi done IFS="$ac_save_ifs" fi fi CXX="$ac_cv_prog_CXX" if test -n "$CXX"; then echo "$ac_t""$CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test -z "$CXX"; then # Extract the first word of "CC", so it can be a program name with args. set dummy CC; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1234: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="CC" break fi done IFS="$ac_save_ifs" fi fi CXX="$ac_cv_prog_CXX" if test -n "$CXX"; then echo "$ac_t""$CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test -z "$CXX"; then # Extract the first word of "xlC", so it can be a program name with args. set dummy xlC; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1263: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="xlC" break fi done IFS="$ac_save_ifs" fi fi CXX="$ac_cv_prog_CXX" if test -n "$CXX"; then echo "$ac_t""$CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test -z "$CXX"; then # Extract the first word of "DCC", so it can be a program name with args. set dummy DCC; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1292: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="DCC" break fi done IFS="$ac_save_ifs" fi fi CXX="$ac_cv_prog_CXX" if test -n "$CXX"; then echo "$ac_t""$CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi fi test -z "$CXX" && { echo "configure: error: no acceptable C++-compiler found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1321: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF #line 1332 "configure" #include "confdefs.h" int main(){return(0);} EOF if { (eval echo configure:1337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cxx_cross=no else ac_cv_prog_cxx_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1363: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 echo "configure:1368: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no fi fi echo "$ac_t""$ac_cv_prog_gxx" 1>&6 if test $ac_cv_prog_gxx = yes; then GXX=yes else echo $ac_n "checking whether we are using SPARC CC""... $ac_c" 1>&6 echo "configure:1390: checking whether we are using SPARC CC" >&5 GXX= cat > conftest.C << EOF #ifdef __SUNPRO_CC yes; #endif EOF ac_try="$CXX -E conftest.C" if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_CC=yes else ac_cv_prog_CC=no fi echo "$ac_t""$ac_cv_prog_CC" 1>&6 fi if test -z "$CXXFLAGS"; then if test "$ac_use_debug_code" = "yes"; then echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 echo "configure:1410: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.cc if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 if test $ac_cv_prog_cxx_g = yes; then CXXFLAGS="-g" fi if test "$ac_cv_prog_CC" = "yes"; then CXXFLAGS="$CXXFLAGS -pto" fi else if test "$GXX" = "yes"; then CXXFLAGS="-O2" else if test "$ac_cv_prog_CC" = "yes"; then CXXFLAGS="-pto -O2" else CXXFLAGS="" fi fi fi if test "$GXX" = "yes"; then CXXFLAGS="$CXXFLAGS -Wall" fi fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1452: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 echo "configure:1492: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. /*) test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 echo "configure:1510: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "configure:1513: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog"; then ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else ac_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$ac_cv_path_LD" if test -n "$LD"; then echo "$ac_t""$LD" 1>&6 else echo "$ac_t""no" 1>&6 fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 echo "configure:1549: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then ac_cv_prog_gnu_ld=yes else ac_cv_prog_gnu_ld=no fi fi echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 echo "configure:1565: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$NM" in /*) ac_cv_path_NM="$NM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do test -z "$ac_dir" && dir=. if test -f $ac_dir/nm; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1!d' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -B" elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -p" else ac_cv_path_NM="$ac_dir/nm" fi break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm ;; esac fi NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 echo "configure:1602: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata if ln -s X conftestdata 2>/dev/null then rm -f conftestdata ac_cv_prog_LN_S="ln -s" else ac_cv_prog_LN_S=ln fi fi LN_S="$ac_cv_prog_LN_S" if test "$ac_cv_prog_LN_S" = "ln -s"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi ac_save_cc=$CC ac_save_cflags=$CFLAGS CC=$CXX CFLAGS=$CXXFLAGS # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" if test "$enableval" = no; then enable_shared=no else enable_shared=yes fi else enable_shared=yes fi # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" if test "$enableval" = no; then enable_static=no else enable_static=yes fi else enable_static=no fi # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent' # Check for any special flags to pass to ltconfig. libtool_flags= test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$silent" = yes && libtool_flags="$libtool_flags --silent" test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Some flags need to be propagated to the compiler or linker for good # libtool support. case "$host" in *-*-irix*) # Find out which ABI we are using. echo '#line 1667 "configure"' > conftest.$ac_ext if { (eval echo configure:1668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. CFLAGS="$CFLAGS -belf" ;; esac # Actually configure libtool. ac_aux_dir is where install-sh is found. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } CC=$ac_save_cc CFLAGS=$ac_save_cflags # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1703: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_doxygen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$doxygen"; then ac_cv_prog_doxygen="$doxygen" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_doxygen="yes" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_doxygen" && ac_cv_prog_doxygen="no" fi fi doxygen="$ac_cv_prog_doxygen" if test -n "$doxygen"; then echo "$ac_t""$doxygen" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$doxygen" = "yes"; then XSUBDIRS="$XSUBDIRS docs" fi echo $ac_n "checking for AIX""... $ac_c" 1>&6 echo "configure:1735: checking for AIX" >&5 cat > conftest.$ac_ext <&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define _ALL_SOURCE 1 EOF else rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 echo "configure:1760: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1770: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 MINIX=yes else echo "$ac_t""no" 1>&6 MINIX= fi if test "$MINIX" = yes; then cat >> confdefs.h <<\EOF #define _POSIX_SOURCE 1 EOF cat >> confdefs.h <<\EOF #define _POSIX_1_SOURCE 2 EOF cat >> confdefs.h <<\EOF #define _MINIX 1 EOF fi ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 echo "configure:1826: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> int main() { DIR *dirp = 0; ; return 0; } EOF if { (eval echo configure:1839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 echo "configure:1864: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBS="$LIBS -ldir" else echo "$ac_t""no" 1>&6 fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 echo "configure:1908: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBS="$LIBS -lx" else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 echo "configure:1952: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CXXCPP=/lib/cpp fi rm -f conftest* ac_cv_prog_CXXCPP="$CXXCPP" ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi fi CXXCPP="$ac_cv_prog_CXXCPP" echo "$ac_t""$CXXCPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:1995: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:2078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi for ac_hdr in string.h strings.h io.h exception g++/exception.h sys/types.h sys/locking.h fcntl.h stdarg.h ctype.h tvision/tv.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:2105: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo "configure:2143: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include int main() { struct tm *tp; ; return 0; } EOF if { (eval echo configure:2157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_time=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_time" 1>&6 if test $ac_cv_header_time = yes; then cat >> confdefs.h <<\EOF #define TIME_WITH_SYS_TIME 1 EOF fi echo $ac_n "checking for bool""... $ac_c" 1>&6 echo "configure:2180: checking for bool" >&5 if eval "test \"`echo '$''{'ac_cv_have_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_bool="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_have_bool="no" fi rm -f conftest* fi echo "$ac_t""$ac_cv_have_bool" 1>&6 if test "$ac_cv_have_bool" = "yes"; then cat >> confdefs.h <<\EOF #define HAVE_BOOL 1 EOF fi echo $ac_n "checking if you need GNU extensions""... $ac_c" 1>&6 echo "configure:2222: checking if you need GNU extensions" >&5 if eval "test \"`echo '$''{'ac_cv_gnu_extensions'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c << EOF #include #ifdef __GNU_LIBRARY__ yes #endif EOF if (eval "$ac_cpp conftest.c") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* ac_cv_gnu_extensions=yes else ac_cv_gnu_extensions=no fi fi echo "$ac_t""$ac_cv_gnu_extensions" 1>&6 if test "$ac_cv_gnu_extensions" = "yes"; then cat >> confdefs.h <&6 echo "configure:2258: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in fcntl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2315: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in snprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2373: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in socket vsnprintf vsprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2430: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for setenv""... $ac_c" 1>&6 echo "configure:2486: checking for setenv" >&5 if eval "test \"`echo '$''{'ac_cv_func_setenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext < /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #include int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_) || defined (__stub___) choke me #else setenv("TEST", "alle", 1); #endif ; return 0; } EOF if { (eval echo configure:2518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_setenv=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_setenv=no" fi rm -f conftest* fi if test "$ac_cv_func_setenv" = "yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <&6 fi ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross for ac_func in getdomainname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2551: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in strcasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2609: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 echo "configure:2666: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBSOCKET="-lsocket" else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 echo "configure:2708: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBNSL="-lnsl" else echo "$ac_t""no" 1>&6 fi if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," # Check whether --with-index-ndx or --without-index-ndx was given. if test "${with_index_ndx+set}" = set; then withval="$with_index_ndx" enable_index_ndx="$withval" else enable_index_ndx="yes" fi if test "$enable_index_ndx" = "yes"; then cat >> confdefs.h <<\EOF #define XB_INDEX_NDX 1 EOF fi # Check whether --with-index-ntx or --without-index-ntx was given. if test "${with_index_ntx+set}" = set; then withval="$with_index_ntx" enable_index_ntx="$withval" else enable_index_ntx="yes" fi if test "$enable_index_ntx" = "yes"; then cat >> confdefs.h <<\EOF #define XB_INDEX_NTX 1 EOF ~ fi # Check whether --with-memo-fields or --without-memo-fields was given. if test "${with_memo_fields+set}" = set; then withval="$with_memo_fields" enable_memo_fields="$withval" else enable_memo_fields="yes" fi if test "$enable_memo_fields" = "yes"; then cat >> confdefs.h <<\EOF #define XB_MEMO_FIELDS 1 EOF fi # Check whether --with-expressions or --without-expressions was given. if test "${with_expressions+set}" = set; then withval="$with_expressions" enable_expressions="$withval" else enable_expressions="yes" fi if test "$enable_expressions" = "yes"; then cat >> confdefs.h <<\EOF #define XB_EXPRESSIONS 1 EOF fi # Check whether --with-ui-html or --without-ui-html was given. if test "${with_ui_html+set}" = set; then withval="$with_ui_html" enable_ui_html="$withval" else enable_ui_html="yes" fi if test "$enable_ui_html" = "yes"; then cat >> confdefs.h <<\EOF #define XB_HTML 1 EOF fi # Check whether --with-xbase-locking or --without-xbase-locking was given. if test "${with_xbase_locking+set}" = set; then withval="$with_xbase_locking" enable_xbase_locking="$withval" else enable_xbase_locking="yes" fi if test "$enable_xbase_locking" = "yes"; then cat >> confdefs.h <<\EOF #define XB_LOCKING_ON 1 EOF fi # Check whether --with-realdelete or --without-realdelete was given. if test "${with_realdelete+set}" = set; then withval="$with_realdelete" enable_realdelete="$withval" else enable_realdelete="yes" fi if test "$enable_realdelete" = "yes"; then cat >> confdefs.h <<\EOF #define XB_REAL_DELETE 1 EOF fi # Check whether --with-xbase-filters or --without-xbase-filters was given. if test "${with_xbase_filters+set}" = set; then withval="$with_xbase_filters" enable_xbase_filters="$withval" else enable_xbase_filters="yes" fi if test "$enable_xbase_filters" = "yes"; then cat >> confdefs.h <<\EOF #define XB_FILTERS 1 EOF fi # Check whether --with-xbase-debug or --without-xbase-debug was given. if test "${with_xbase_debug+set}" = set; then withval="$with_xbase_debug" enable_xbase_debug="$withval" else enable_xbase_debug="yes" fi if test "$enable_xbase_debug" = "yes"; then cat >> confdefs.h <<\EOF #define XBASE_DEBUG 1 EOF fi # Check whether --with-exceptions or --without-exceptions was given. if test "${with_exceptions+set}" = set; then withval="$with_exceptions" enable_exceptions="$withval" else enable_exceptions="no" fi if test "$enable_exceptions" = "yes"; then cat >> confdefs.h <<\EOF #define HAVE_EXCEPTIONS 1 EOF fi # Check whether --with-castellano or --without-castellano was given. if test "${with_castellano+set}" = set; then withval="$with_castellano" enable_castellano="$withval" else enable_castellano="no" fi if test "$enable_castellano" = "yes"; then cat >> confdefs.h <<\EOF #define XB_CASTELLANO 1 EOF fi topdir=`pwd` if test "$ac_cv_header_tvision_tv_h" = "yes"; then TVPROGS="tvxbase" else TVPROGS= fi trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo " Makefile xbase/Makefile xbase/xbase.h examples/Makefile bin/Makefile html/Makefile tv/Makefile libtest/Makefile xbase-config xbase.spec docs/doxygen.cfg docs/Makefile xbase/xbconfig.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g s%@target@%$target%g s%@target_alias@%$target_alias%g s%@target_cpu@%$target_cpu%g s%@target_vendor@%$target_vendor%g s%@target_os@%$target_os%g s%@build@%$build%g s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@XSUBDIRS@%$XSUBDIRS%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@CXX@%$CXX%g s%@RANLIB@%$RANLIB%g s%@LD@%$LD%g s%@NM@%$NM%g s%@LN_S@%$LN_S%g s%@LIBTOOL@%$LIBTOOL%g s%@doxygen@%$doxygen%g s%@CXXCPP@%$CXXCPP%g s%@LIBSOCKET@%$LIBSOCKET%g s%@LIBNSL@%$LIBNSL%g s%@topdir@%$topdir%g s%@TVPROGS@%$TVPROGS%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > xbase/stamp-h chmod +x xbase-config exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 xbase-2.0.0/configure.in0000644000000000000000000001126707316216463010572 # Created by Denis Pershin dnl Process this file with autoconf to produce a configure script. AC_INIT(acinclude.m4) dnl a source file from your sub dir, but acinclude.m4 does the job AC_CANONICAL_SYSTEM AC_ARG_PROGRAM XSUBDIRS="xbase examples bin html libtest tv" AC_SUBST(XSUBDIRS) dnl You have to change this AM_INIT_AUTOMAKE(xbase, 2.0.0, nodefine) dnl searches for some needed programs dnl generate the config header AM_CONFIG_HEADER(xbase/xbconfig.h) dnl at the distribution this done dnl Checks for programs. AC_CHECK_COMPILERS KDE_PROG_LIBTOOL AC_CHECK_PROG(doxygen, doxygen, yes, no) if test "$doxygen" = "yes"; then XSUBDIRS="$XSUBDIRS docs" fi dnl find out some variables AC_AIX AC_MINIX dnl for NLS support. Call them in this order! AC_LANG_CPLUSPLUS dnl switch to C++ dnl Checks for header files. AC_LANG_CPLUSPLUS dnl switch to C++ AC_HEADER_DIRENT dnl check for dirent.h AC_HEADER_STDC dnl check for other stdc headers. More traditional ;) dnl check for some more header files. You can remove some of dnl them, if you want to. But it doesn't hurt AC_CHECK_HEADERS(string.h strings.h io.h exception g++/exception.h sys/types.h sys/locking.h fcntl.h stdarg.h ctype.h tvision/tv.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_HEADER_TIME dnl check if the compiler has bool AC_CHECK_BOOL dnl check if the system needs some #defines AC_CHECK_GNU_EXTENSIONS dnl Checks for library functions. AC_CHECK_FUNCS(flock) dnl AC_CHECK_FUNCS(fcntl) AC_CHECK_FUNCS(snprintf) dnl AC_CHECK_FUNCS(socket vsnprintf vsprintf) AC_CHECK_SETENV AC_LANG_CPLUSPLUS AC_CHECK_FUNCS(getdomainname) AC_CHECK_FUNCS(strcasecmp) AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lsocket"]) dnl for Solaris AC_CHECK_LIB(nsl, gethostbyname, [LIBNSL="-lnsl"]) dnl for Solaris AC_SUBST(LIBSOCKET) AC_SUBST(LIBNSL) dnl Perform program name transformation AC_ARG_PROGRAM AC_ARG_WITH(index-ndx, [ --without-index-ndx do not compile .ndx index support ], enable_index_ndx="$withval", enable_index_ndx="yes") if test "$enable_index_ndx" = "yes"; then AC_DEFINE(XB_INDEX_NDX,1) fi AC_ARG_WITH(index-ntx, [ --without-index-ntx do not compile .ntx index support ], enable_index_ntx="$withval", enable_index_ntx="yes") if test "$enable_index_ntx" = "yes"; then AC_DEFINE(XB_INDEX_NTX,1)~ fi AC_ARG_WITH(memo-fields, [ --without-memo-fields do not compile memo fields support ], enable_memo_fields="$withval", enable_memo_fields="yes") if test "$enable_memo_fields" = "yes"; then AC_DEFINE(XB_MEMO_FIELDS,1) fi AC_ARG_WITH(expressions, [ --without-expressions do not compile expressions support ], enable_expressions="$withval", enable_expressions="yes") if test "$enable_expressions" = "yes"; then AC_DEFINE(XB_EXPRESSIONS,1) fi AC_ARG_WITH(ui-html, [ --without-ui-html do not compile HTML support ], enable_ui_html="$withval", enable_ui_html="yes") if test "$enable_ui_html" = "yes"; then AC_DEFINE(XB_HTML,1) fi AC_ARG_WITH(xbase-locking, [ --without-xbase-locking turn off XBase file locking ], enable_xbase_locking="$withval", enable_xbase_locking="yes") if test "$enable_xbase_locking" = "yes"; then AC_DEFINE(XB_LOCKING_ON,1) fi AC_ARG_WITH(realdelete, [ --without-realdelete turn off XBase record deletion ], enable_realdelete="$withval", enable_realdelete="yes") if test "$enable_realdelete" = "yes"; then AC_DEFINE(XB_REAL_DELETE,1) fi AC_ARG_WITH(xbase-filters, [ --without-xbase-filters turn off XBase filter logic ], enable_xbase_filters="$withval", enable_xbase_filters="yes") if test "$enable_xbase_filters" = "yes"; then AC_DEFINE(XB_FILTERS,1) fi AC_ARG_WITH(xbase-debug, [ --without-xbase-debug turn off XBase specific debug ], enable_xbase_debug="$withval", enable_xbase_debug="yes") if test "$enable_xbase_debug" = "yes"; then AC_DEFINE(XBASE_DEBUG,1) fi AC_ARG_WITH(exceptions, [ --with-exceptions turn on exceptions ], enable_exceptions="$withval", enable_exceptions="no") if test "$enable_exceptions" = "yes"; then AC_DEFINE(HAVE_EXCEPTIONS,1) fi AC_ARG_WITH(castellano, [ --with-castellano turn on spanish date logic ], enable_castellano="$withval", enable_castellano="no") if test "$enable_castellano" = "yes"; then AC_DEFINE(XB_CASTELLANO,1) fi dnl output files topdir=`pwd` AC_SUBST(topdir) if test "$ac_cv_header_tvision_tv_h" = "yes"; then TVPROGS="tvxbase" else TVPROGS= fi AC_SUBST(TVPROGS) dnl add here all your Makefiles AC_OUTPUT([ Makefile xbase/Makefile xbase/xbase.h examples/Makefile bin/Makefile html/Makefile tv/Makefile libtest/Makefile dnl ybase/Makefile xbase-config xbase.spec docs/doxygen.cfg docs/Makefile ], [ chmod +x xbase-config ] ) xbase-2.0.0/install-sh0000755000000000000000000001272007115376160010256 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 xbase-2.0.0/ltconfig0000755000000000000000000020043007115376206010003 #! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1998 Free Software Foundation, Inc. # Gordon Matzigkeit , 1996 # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A lot of this script is taken from autoconf-2.10. # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} echo=echo if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi if test "X${echo_test_string+set}" != "Xset"; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then break fi done fi if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH /usr/ucb; do if test -f $dir/echo && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # Cool, printf works : elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # The name of this program. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool VERSION=1.2c ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." # Global variables: default_ofile=libtool can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking. enable_static=yes ltmain= silent= srcdir= ac_config_guess= ac_config_sub= host= nonopt= ofile="$default_ofile" verify_host=yes with_gcc=no with_gnu_ld=no need_locks=yes objext=o libext=a old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LD="$LD" old_LN_S="$LN_S" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" old_AS="$AS" # Parse the command line options. args= prev= for option do case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi case "$option" in --help) cat <&2 echo "$help" 1>&2 exit 1 ;; *) if test -z "$ltmain"; then ltmain="$option" elif test -z "$host"; then # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then # echo "$progname: warning \`$option' is not a valid host type" 1>&2 # fi host="$option" else echo "$progname: too many arguments" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac done if test -z "$ltmain"; then echo "$progname: you must specify a LTMAIN file" 1>&2 echo "$help" 1>&2 exit 1 fi if test ! -f "$ltmain"; then echo "$progname: \`$ltmain' does not exist" 1>&2 echo "$help" 1>&2 exit 1 fi # Quote any args containing shell metacharacters. ltconfig_args= for arg do case "$arg" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; esac done # A relevant subset of AC_INIT. # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 compiler messages saved in config.log # 6 checking for... messages and results if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>>./config.log # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi trap "$rm conftest*; exit 1" 1 2 15 if test "$verify_host" = yes; then # Check for config.guess and config.sub. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/config.guess; then ac_aux_dir=$ac_dir break fi done if test -z "$ac_aux_dir"; then echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 echo "$help" 1>&2 exit 1 fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub # Make sure we can run config.sub. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : else echo "$progname: cannot run $ac_config_sub" 1>&2 echo "$help" 1>&2 exit 1 fi echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host case "$host_alias" in "") if host_alias=`$SHELL $ac_config_guess`; then : else echo "$progname: cannot guess host type; you must specify one" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac host=`$SHELL $ac_config_sub $host_alias` echo "$ac_t$host" 1>&6 # Make sure the host verified. test -z "$host" && exit 1 elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "${COLLECT_NAMES+set}" != set; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no echo $ac_n "checking for ranlib... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib; then RANLIB="ranlib" result="ranlib" break fi done IFS="$save_ifs" echo "$ac_t$result" 1>&6 fi if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Set sane defaults for `DLLTOOL' and `AS', used on cygwin32. test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$AS" && AS=as # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. if test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do IFS="$save_ifs" test -z "$dir" && dir=. if test -f $dir/gcc; then CC="gcc" break fi done IFS="$save_ifs" if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi fi # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". if test -z "$CC"; then echo $ac_n "checking for cc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue fi CC="cc" break fi done IFS="$save_ifs" if test $cc_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same name, so the bogon will be chosen # first if we set CC to just the name; use the full file name. shift set dummy "$dir/cc" "$@" shift CC="$@" fi fi if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$CC"; then echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 exit 1 fi fi # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 echo "$progname:530: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c echo "$ac_t$with_gcc" 1>&6 fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c echo "$progname:552: checking for object suffix" >& 5 if { (eval echo $progname:553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c) ;; *) objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* echo "$ac_t$objext" 1>&6 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= wl= link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then wl='-Wl,' link_static_flag='-static' case "$host_os" in aix3* | aix4* | irix5* | irix6* | osf3* | osf4*) # PIC is the default for these OSes. ;; cygwin32* | mingw32* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; *) pic_flag='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. link_static_flag='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' link_static_flag="${wl}-a ${wl}archive" pic_flag='+Z' ;; irix5* | irix6*) wl='-Wl,' link_static_flag='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin32* | mingw32* | os2*) # We can build DLLs from non-PIC. ;; osf3* | osf4*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' ;; sco3.2v5*) pic_flag='-Kpic' link_static_flag='-dn' special_shlib_compile_flags='-belf' ;; solaris*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; sunos4*) pic_flag='-PIC' link_static_flag='-Bstatic' wl='-Qoption ld ' ;; sysv4.2uw2*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; uts4*) pic_flag='-pic' link_static_flag='-Bstatic' ;; *) can_build_shared=no ;; esac fi if test -n "$pic_flag"; then echo "$ac_t$pic_flag" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" echo "$progname:674: checking if $compiler PIC flag $pic_flag works" >&5 if { (eval echo $progname:675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 # On HP-UX, both CC and GCC only warn that PIC is supported... then they # create non-PIC objects. So, if there were any warnings, we assume that # PIC is not supported. if test -s conftest.err; then echo "$ac_t"no 1>&6 can_build_shared=no pic_flag= else echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" fi else # Append any errors to the config.log. cat conftest.err 1>&5 can_build_shared=no pic_flag= echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else echo "$ac_t"none 1>&6 fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest2.o" echo "$progname:709: checking if $compiler supports -c -o file.o" >&5 if { (eval echo $progname:710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else echo "$ac_t"yes 1>&6 compiler_c_o=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" echo "$progname:737: checking if $compiler supports -c -o file.lo" >&5 if { (eval echo $progname:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_o_lo=no else echo "$ac_t"yes 1>&6 compiler_o_lo=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_o_lo=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t$hard_links" 1>&6 $rm conftest* if test "$hard_links" = no; then echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 need_locks=warn fi else need_locks=no fi if test "$with_gcc" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" echo "$progname:789: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if { (eval echo $progname:790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_rtti_exceptions=no else echo "$ac_t"yes 1>&6 compiler_rtti_exceptions=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_rtti_exceptions=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # Check for any special shared library compilation flags. if test -n "$special_shlib_compile_flags"; then echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : else echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" echo "$progname:833: checking if $compiler static flag $link_static_flag works" >&5 if { (eval echo $progname:834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 link_static_flag= fi LDFLAGS="$save_LDFLAGS" $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 $rm conftestdata if ln -s X conftestdata 2>/dev/null; then $rm conftestdata LN_S="ln -s" else LN_S=ln fi if test "$LN_S" = "ln -s"; then echo "$ac_t"yes 1>&6 else echo "$ac_t"no 1>&6 fi fi # Make sure LD is an absolute path. if test -z "$LD"; then ac_prog=ld if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 echo "$progname:866: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. /* | [A-Za-z]:/*) re_direlt='/[^/][^/]*/\.\./' sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%' # Canonicalize the path of ld while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done case "$host_os" in cygwin*) # Convert to a UNC path for cygwin test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"` ;; *) test -z "$LD" && LD="$ac_prog" ;; esac ;; ## ## FIXME: The code fails later on if we try to use an $LD with ## '\\' path separators. ## [A-Za-z]:[\\]*) re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)' sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%' sub_uncdir='s%\\%/%g' # Canonicalize the path of ld while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"` done case "$host_os" in cygwin*) # Convert to a UNC path for cygwin test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive" -e "$sub_uncdir"` ;; *) test -z "$LD" && LD="$ac_prog" ;; esac ;; "") # If it fails, then pretend we are not using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 echo "$progname:920: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "$progname:923: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" fi if test -n "$LD"; then echo "$ac_t$LD" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$LD"; then echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 exit 1 fi fi # Check to see if it really is or is not GNU ld. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then with_gnu_ld=yes else with_gnu_ld=no fi echo "$ac_t$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 allow_undefined_flag= no_undefined_flag= archive_cmds= archive_sym_cmds= old_archive_from_new_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker works like the native linker. with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # See if GNU ld supports shared libraries. case "$host_os" in amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib$libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; sunos4*) archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; cygwin32* | mingw32*) if test "$with_gcc" = yes; then # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported # Very, very bogus. echo ' #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN #include BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); #include DECLARE_CYGWIN_DLL( DllMain ); HINSTANCE __hDllInstance_base; BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) { __hDllInstance_base = hInst; return TRUE; } ' > ltdll.c archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib.exp~ $DLLTOOL --export-all --output-def $lib.exp~ $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobs ltdll.$objext~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ $rm ltdll.$objext $soname-base $soname-exp' archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib.exp~ cat "$export_symbols" > $lib.exp~ $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobs ltdll.$objext~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ $rm ltdll.$objext $soname-base $soname-exp' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib.exp --output-lib $objdir/$libname.a~$rm $lib.exp' else # When not using gcc, we currently assume that we are using # Microsoft Visual C++. with_gnu_ld=no # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' fi ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs' archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib$libobjs$deplibs' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes && test "$with_gnu_ld" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~ $LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' archive_sym_cmds='cat $export_symbols > $lib.exp~ $LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname~$rm $lib.exp' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$with_gcc" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) allow_undefined_flag=unsupported archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp else cat $export_symbols > $lib.exp~ $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname' archive_sym_cmds='cat $export_symbols > $lib.exp~ $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname~$rm $lib.exp' hardcode_direct=yes hardcode_minus_L=yes ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib$libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; cygwin32* | mingw32*) if test "$with_gcc" = yes; then # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported # Very, very bogus. echo ' #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN #include BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); #include DECLARE_CYGWIN_DLL( DllMain ); HINSTANCE __hDllInstance_base; BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) { __hDllInstance_base = hInst; return TRUE; } ' > ltdll.c archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib.exp~ $DLLTOOL --export-all --output-def $lib.exp~ $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobs ltdll.$objext~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ $rm ltdll.$objext $soname-base $soname-exp' archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib.exp~ cat "$export_symbols" > $lib.exp~ $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobs ltdll.$objext~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ $rm ltdll.$objext $soname-base $soname-exp' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib.exp --output-lib $objdir/$libname.a~$rm $lib.exp' else # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' fi ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3, at last, uses gcc -shared to do shared libraries. freebsd3*) archive_cmds='$CC -shared -o $lib$libobjs$deplibs' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no ;; hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs~test $objdir/$soname = $lib || mv $objdir/$soname $lib' hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_direct=yes hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs' hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_direct=yes hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes && test "$with_gnu_ld" = yes; then archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs' else archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs$deplibs' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' ;; netbsd*) # Tested with NetBSD 1.2 ld archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp$libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib$libobjs$deplibs $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; osf3* | osf4*) if test "$with_gcc" = yes && test "$with_gnu_ld" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -o $lib$libobjs$deplibs' hardcode_direct=yes ;; solaris*) no_undefined_flag=' -z text' if test "$with_gcc" = yes && test "$with_gnu_ld" = yes; then archive_cmds='$CC -shared ${wl}-h $wl$soname -o $lib$libobjs$deplibs' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs$deplibs' archive_sym_cmds='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" > $lib.exp~ $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib$libobjs$deplibs~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no # Solaris 2 before 2.5 hardcodes -L paths. case "$host_os" in solaris2.[0-4]*) hardcode_minus_L=yes ;; esac ;; sunos4*) # Why do we need -Bstatic? To avoid inter-library dependencies, maybe... if test "$with_gcc" = yes && test "$with_gnu_ld" = yes; then archive_cmds='$CC -shared ${wl}-Bstatic -o $lib$libobjs$deplibs' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=no ;; *) ld_shlibs=no can_build_shared=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -B" elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -p" else NM="$ac_dir/nm" fi break fi done IFS="$ac_save_ifs" test -z "$NM" && NM=nm ;; esac echo "$ac_t$NM" 1>&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRSTU]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \1' # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDTU]' ;; sunos* | cygwin32* | mingw32*) sympat='_\([_A-Za-z][_A-Za-z0-9]*\)' symxfrm='_\1 \1' ;; irix*) # Cannot use undefined symbols on IRIX because inlined functions mess us up. symcode='[BCDEGRST]' ;; solaris*) symcode='[BDTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTUW]' fi case "$host_os" in cygwin32* | mingw32*) # We do not want undefined symbols on cygwin32. The user must # arrange to define them via -l arguments. symcode='[ABCDGISTW]' ;; esac # Write the raw and C identifiers. global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no $rm conftest* cat > conftest.c <&5 if { (eval echo $progname:1430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm if { echo "$progname:1433: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" wcout=`wc "$nlist" 2>/dev/null` count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'` (test "$count" -ge 0) 2>/dev/null || count=-1 else rm -f "$nlist"T count=-1 fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.c #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c cat <> conftest.c #if defined (__STDC__) && __STDC__ # define __ptr_t void * #else # define __ptr_t char * #endif /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */ int dld_preloaded_symbol_count = $count; /* The mapping between symbol names and symbols. */ struct { char *name; __ptr_t address; } dld_preloaded_symbols[] = { EOF sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (__ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$objext conftestm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftestm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo $progname:1491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi LIBS="$save_LIBS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* # Do not use the global_symbol_pipe unless it works. echo "$ac_t$pipe_works" 1>&6 test "$pipe_works" = yes || global_symbol_pipe= # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && \ test "$hardcode_minus_L" != no && \ test "$hardcode_shlibpath_var" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t$hardcode_action" 1>&6 reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 # PORTME Some linkers may need a different reload flag. reload_flag='-r' echo "$ac_t$reload_flag" 1>&6 test -n "$reload_flag" && reload_flag=" $reload_flag" # PORTME Fill in your ld.so characteristics library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= version_type=none dynamic_linker="$host_os ld.so" sys_lib_search_path="/lib /usr/lib /usr/local/lib" check_shared_deplibs_method='none' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_regex' -- check by looking for filenames that look like the shared # library in the library path. # 'file_magic [regex]' -- check by looking for files in library path which # responds to the "file" command with a given regex. This is actually a # superset of the file_regex command. If you have file on your system, you'll # want to use this instead. # Notes: regexes are run through expr. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 case "$host_os" in aix3* | aix4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; bsdi4*) version_type=linux library_names_spec='${libname}.so.$major ${libname}.so' soname_spec='${libname}.so' finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH ;; cygwin32* | mingw32*) version_type=windows if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' libname_spec='$name' shlibpath_var=PATH ;; freebsd2* | freebsd3*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat library_names_spec='${libname}${release}.so$versuffix $libname.so' finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="$objformat" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; gnu*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}.so' shlibpath_var=LD_LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos shlibpath_var=SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5*) version_type=osf soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; irix6*) version_type=osf soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARYN32_PATH ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH check_shared_deplibs_method='file_magic ELF 32-bit LSB shared object' sys_lib_search_path="/lib /usr/lib /usr/local/lib `echo $LD_LIBRARY_PATH | sed -e 's/:/ /g'`" if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' else # Only the GNU ld.so supports shared libraries on MkLinux. case "$host_cpu" in powerpc*) dynamic_linker=no ;; *) dynamic_linker='Linux ld.so' ;; esac fi ;; netbsd* | openbsd*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4*) version_type=osf soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH check_shared_deplibs_method='pass_all' ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH ;; sysv4.2uw2*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so' soname_spec='${libname}${release}.so.$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$ac_t$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; esac echo "$ac_t$enable_shared" 1>&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 # Copy echo and quote the copy, instead of the original, because it is # used later. ltecho="$echo" if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then ltecho="$CONFIG_SHELL \$0 --fallback-echo" fi LTSHELL="$SHELL" # Only quote variables if we're using ltmain.sh. case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ whole_archive_flag_spec libname_spec library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \ check_shared_deplibs_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe \ hardcode_libdir_flag_spec hardcode_libdir_separator sys_lib_search_path \ compiler_c_o compiler_o_lo need_locks; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ archive_cmds | archive_sym_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\"" ;; *) eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case "$ltecho" in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac trap "$rm \"$ofile\"; exit 1" 1 2 15 echo "creating $ofile" $rm "$ofile" cat < "$ofile" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION) # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1998 Free Software Foundation, Inc. # Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF cfgfile="$ofile" ;; *) # Double-quote the variables that need it (for aesthetics). for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ old_LN_S old_DLLTOOL old_AS; do eval "$var=\\\"\$var\\\"" done # Just create a config file. cfgfile="$ofile.cfg" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 echo "creating $cfgfile" $rm "$cfgfile" cat < "$cfgfile" # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION) EOF ;; esac cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ # LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ # DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for # debugging $progname, is in ./config.log if it exists. # The version of $progname that generated this script. LTCONFIG_VERSION=$VERSION # Shell to use when invoking shell scripts. SHELL=$LTSHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$ltecho # The archiver. AR=$AR # The default C compiler. CC=$CC # The linker used to build libraries. LD=$LD # Whether we need hard or soft links. LN_S=$LN_S # A BSD-compatible nm program. NM=$NM # Used on cygwin32: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin32: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$reload_flag reload_cmds=$reload_cmds # How to pass a linker flag through the compiler. wl=$wl # Object file suffix (normally "o"). objext="$objext" # Old archive suffix (normally "a"). libext="$libext" # Additional compiler flags for building library objects. pic_flag=$pic_flag # Does compiler simultaneously support -c and -o options compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$compiler_o_lo # Must we lock files when doing compilation ? need_locks=$need_locks # Compiler flag to prevent dynamic linking. link_static_flag=$link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$whole_archive_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$library_names_spec # The coded name of the library, if different from the real name. soname_spec=$soname_spec # Commands used to build and install an old-style archive. RANLIB=$RANLIB old_archive_cmds=$old_archive_cmds old_postinstall_cmds=$old_postinstall_cmds old_postuninstall_cmds=$old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$old_archive_from_new_cmds # Commands used to build and install a shared archive. archive_cmds=$archive_cmds archive_sym_cmds=$archive_sym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. check_shared_deplibs_method=$check_shared_deplibs_method # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$global_symbol_pipe # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # System search path for libraries sys_lib_search_path=$sys_lib_search_path # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" EOF case "$ltmain" in *.sh) echo '### END LIBTOOL CONFIG' >> "$ofile" echo >> "$ofile" case "$host_os" in aix3*) cat <<\EOF >> "$ofile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "${COLLECT_NAMES+set}" != set; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # Append the ltmain.sh script. cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) chmod +x "$ofile" ;; *) # Compile the libtool program. echo "FIXME: would compile $ltmain" ;; esac exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: xbase-2.0.0/ltmain.sh0000644000000000000000000026032107115376246010101 # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun ltconfig. # # Copyright (C) 1996-1998 Free Software Foundation, Inc. # Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi # The name of this program. progname=`$echo "$0" | sed 's%^.*/%%'` modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.2c default_mode= help="Try \`$progname --help' for more information." magic="%%%MAGIC variable%%%" mkdir="mkdir" mv="mv -f" rm="rm -f" # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. if test "${LC_ALL+set}" = set; then save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL fi if test "${LANG+set}" = set; then save_LANG="$LANG"; LANG=C; export LANG fi if test "$LTCONFIG_VERSION" != "$VERSION"; then echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then echo "$modename: not configured to build any kind of library" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" los2o="s/\\.lo /.${objext} /g" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case "$arg" in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case "$prev" in execute_dlfiles) eval "$prev=\"\$$prev \$arg\"" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case "$arg" in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION" exit 0 ;; --config) sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case "$nonopt" in *cc | *++ | gcc* | *-gcc*) mode=link for arg do case "$arg" in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case "$mode" in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= lastarg= srcfile="$nonopt" suppress_output= force_static=no user_target=no for arg do # Accept any command-line options. case "$arg" in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -force-static) force_static=yes continue ;; -static) build_old_libs=yes continue ;; esac case "$user_target" in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly in scan # sets, so we specify it separately. case "$lastarg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case "$user_target" in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case "$libobj" in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case "$libobj" in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj $lockfile" else removelist="$libobj $lockfile" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile$pic_flag -DPIC $srcfile" if test "$compiler_o_lo" = yes; then command="$command -o $libobj" output_obj="$libobj" elif test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test "$compiler_o_lo" = no && test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag and do not have -force-static, # then copy the object into place and finish. if test -z "$pic_flag" && test "$force_static" = no; then $show "$LN_S $libobj $obj" if $run $LN_S $libobj $obj; then exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then command="$base_compile -DSTATIC $srcfile" if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test "$compiler_c_o" = no && test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $rm "$lockfile" fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? fi exit 0 ;; # libtool link mode link) modename="$modename: link" C_compiler="$CC" # save it, to compile generated C sources CC="$nonopt" allow_undefined=yes compile_command="$CC" finalize_command="$CC" compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= eval lib_search_path=\"$sys_lib_search_path\" dlfiles= dlprefiles= export_dynamic=no export_symbols= generated= hardcode_libdirs= libobjs= link_against_libtool_libs= ltlibs= module=no objs= prev= prevarg= release= rpath= perm_rpath= temp_rpath= vinfo= # We need to know -static, to get the right output filenames. for arg do case "$arg" in -all-static | -static) if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift # If the previous option needs an argument, assign it. if test -n "$prev"; then case "$prev" in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case "$prev" in dlfiles|dlprefiles) case "$arg" in *.la | *.lo) ;; # We handle these cases below. *) dlprefiles="$dlprefiles $arg" test "$prev" = dlfiles && dlfiles="$dlfiles $arg" prev= ;; esac ;; exportsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= ;; release) release="-$arg" prev= continue ;; rpath) rpath="$rpath $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi prevarg="$arg" case "$arg" in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) if test "$export_dynamic" != yes; then export_dynamic=yes if test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" else arg= fi # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" fi ;; -export-symbols) if test -n "$export_symbols"; then $echo "$modename: cannot have more than one -exported-symbols" exit 1 fi prev=exportsyms continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'` case "$dir" in /* | [A-Za-z]:[/\\]*) # Add the corresponding hardcode_libdir_flag, if it is not identical. ;; *) $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2 exit 1 ;; esac deplibs="$deplibs $arg" lib_search_path="$lib_search_path `expr $arg : '-L\(.*\)'`" ;; -l*) deplibs="$deplibs $arg" ;; -module) module=yes continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -static) # If we have no pic_flag, then this is the same as -all-static. if test -z "$pic_flag" && test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -version-info) prev=vinfo continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac ;; *.o | *.obj | *.a | *.lib) # A standard object. objs="$objs $arg" ;; *.lo) # A library object. if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" if test "$build_libtool_libs" = yes; then prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= fi libobjs="$libobjs $arg" ;; *.la) # A libtool-controlled library. dlname= libdir= library_names= old_library= # Check to see that this really is a libtool archive. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 exit 1 fi # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # If there is no directory component, then add one. case "$arg" in */* | *\\*) . $arg ;; *) . ./$arg ;; esac # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 exit 1 fi # Find the relevant object directory and library name. name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` if test "X$installed" = Xyes; then dir="$libdir" else dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$arg"; then dir="$objdir" else dir="$dir/$objdir" fi fi if test -z "$libdir"; then # It is a libtool convenience library, so add in its objects. convenience="$convenience $dir/$old_library"l old_convenience="$old_convenience $dir/$old_library" compile_command="$compile_command $dir/$old_library" finalize_command="$finalize_command $dir/$old_library" continue fi # This library was specified with -dlopen. if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" if test -z "$dlname"; then # If there is no dlname, we need to preload. prev=dlprefiles else # We should not create a dependency on this library, but we # may need any libraries it requires. compile_command="$compile_command$dependency_libs" finalize_command="$finalize_command$dependency_libs" prev= continue fi fi # The library was specified with -dlpreopen. if test "$prev" = dlprefiles; then # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then dlprefiles="$dlprefiles $dir/$old_library" else dlprefiles="$dlprefiles $dir/$linklib" fi prev= fi if test "$build_libtool_libs" = yes && test -n "$library_names"; then link_against_libtool_libs="$link_against_libtool_libs $arg" if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # This is the magic to use -rpath. if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then # Put the magic libdir with the hardcode flag. hardcode_libdirs="$libdir" libdir="@HARDCODE_LIBDIRS@" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac libdir= fi fi if test -n "$libdir"; then eval flag=\"$hardcode_libdir_flag_spec\" compile_command="$compile_command $flag" finalize_command="$finalize_command $flag" fi elif test -n "$runpath_var"; then # Do the same for the permanent run path. case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi lib_linked=yes case "$hardcode_action" in immediate | unsupported) if test "$hardcode_direct" = no; then compile_command="$compile_command $dir/$linklib" elif test "$hardcode_minus_L" = no; then case "$host" in *-*-sunos*) compile_shlibpath="$compile_shlibpath$dir:" ;; esac compile_command="$compile_command -L$dir -l$name" elif test "$hardcode_shlibpath_var" = no; then compile_shlibpath="$compile_shlibpath$dir:" compile_command="$compile_command -l$name" else lib_linked=no fi ;; relink) # We need an absolute path. case "$dir" in /* | [A-Za-z]:[/\\]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac if test "$hardcode_direct" = yes; then compile_command="$compile_command $dir/$linklib" elif test "$hardcode_minus_L" = yes; then compile_command="$compile_command -L$dir -l$name" elif test "$hardcode_shlibpath_var" = yes; then compile_shlibpath="$compile_shlibpath$dir:" compile_command="$compile_command -l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then finalize_command="$finalize_command $libdir/$linklib" elif test "$hardcode_minus_L" = yes; then finalize_command="$finalize_command -L$libdir -l$name" elif test "$hardcode_shlibpath_var" = yes; then finalize_shlibpath="$finalize_shlibpath$libdir:" finalize_command="$finalize_command -l$name" else # We cannot seem to hardcode it, guess we'll fake it. finalize_command="$finalize_command -L$libdir -l$name" fi else # Transform directly to old archives if we don't build new libraries. if test -n "$pic_flag" && test -z "$old_library"; then $echo "$modename: cannot find static library for \`$arg'" 1>&2 exit 1 fi # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_command="$compile_command $dir/$linklib" finalize_command="$finalize_command $dir/$linklib" else compile_command="$compile_command -L$dir -l$name" finalize_command="$finalize_command -L$dir -l$name" fi fi # Add in any libraries that this one depends upon. compile_command="$compile_command$dependency_libs" finalize_command="$finalize_command$dependency_libs" continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac ;; esac # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$export_symbols" && test "$module" = yes; then $echo "$modename: \`-export-symbols' is not supported for modules" exit 1 fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` case "$output" in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.a | *.lib) if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 exit 1 fi if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles"; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" ;; *.la) # Make sure we only generate libraries of the form `libNAME.la'. case "$outputname" in lib*) ;; *) $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= if test -n "$objs"; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 exit 1 fi # How the heck are we supposed to write a wrapper for a shared library? if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 exit 1 fi if test -n "$dlfiles$dlprefiles"; then $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then # Building a libtool convenience library. oldlibs="$output_objdir/$libname.al $oldlibs" build_libtool_libs=convenience if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case "$current" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case "$revision" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case "$age" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case "$version_type" in none) ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; freebsd-aout) major=".$current" versuffix="$current.$revision"; ;; freebsd-elf) major=".$current" versuffix="$current"; ;; windows) # Like Linux, but with '-' rather than '.', since we only # want one extension on Windows 95. major=`expr $current - $age` versuffix="-$major-$age-$revision" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= versuffix= verstring="0.0" case "$host" in *-*-sunos*) versuffix=".0.0" ;; esac fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi # Add libc to deplibs on all systems. dependency_libs="$deplibs" deplibs="$deplibs -lc" fi # Create the output directory, or remove our outputs if we need to. if test -d $output_objdir; then $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* else $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e "$los2o" -e 's/ $//g'` fi if test "$build_libtool_libs" = yes; then # Transform deplibs into only deplibs that can be linked in shared. ## Gordon: Do you check for the existence of the libraries in deplibs ## on the system? That should maybe be merged in here someplace.... ## Actually: I think test_compile and file_magic do this... file_regex ## sorta does this. Only pas_all needs to be changed. -Toshio name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= case "$check_shared_deplibs_method" in pass_all) newdeplibs=$deplibs ;; # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do file_output=`file $potent_lib` if test `expr "$file_output" : ".*$file_magic_regex"` -ne 0 ; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done ;; file_regex) deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches deplib_match=$2 for i in $lib_search_path; do potential_libs=`ls $i/$deplib_match* 2>/dev/null` if test "$potential_libs" != "" ; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break fi done ;; esac if test "$a_deplib" != "" ; then echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | *) deplibs="" ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save deplibs=$newdeplibs # Done checking deplibs! # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are PIC. test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e "$los2o" -e 's/ $//g'` if test -n "$whole_archive_flag_spec"; then if test -n "$convenience"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi else for xlib in $convenience; do # Extract the objects. xdir="$xlib"x generated="$generated $xdir" xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'` $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x ../$xlib)" $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $? libobjs="$libobjs `echo $xdir/*`" done fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then eval cmds=\"$archive_sym_cmds\" else eval cmds=\"$archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $LN_S $realname $linkname)' || exit $? fi done # If -export-dynamic was specified, set the dlname. if test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; *.lo | *.o | *.obj) if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 exit 1 fi if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles"; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case "$output" in *.lo) if test -n "$objs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Create the old-style object. reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e 's/[^ ]*\.lib //g' -e "$los2o" -e 's/ $//g'` output="$obj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. test -z "$libobj" && exit 0 if test "$build_libtool_libs" != yes; then # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs" output="$libobj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show "$LN_S $obj $libobj" $run $LN_S $obj $libobj || exit $? fi exit 0 ;; # Anything else should be a program. *) if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test -n "$rpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then # Put the magic libdir with the hardcode flag. hardcode_libdirs="$libdir" libdir="@HARDCODE_LIBDIRS@" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac libdir= fi fi if test -n "$libdir"; then eval flag=\"$hardcode_libdir_flag_spec\" compile_command="$compile_command $flag" finalize_command="$finalize_command $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done fi # Substitute the hardcoded libdirs into the compile commands. if test -n "$hardcode_libdir_separator"; then compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` fi output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command " | $Xsed -e "$los2o" -e 's/ $//'` finalize_command=`$echo "X$finalize_command " | $Xsed -e "$los2o" -e 's/ $//'` fi if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else dlsyms= fi if test -n "$dlsyms"; then case "$dlsyms" in "") ;; *.c) if test -z "$export_symbols"; then # Add our own program objects to the preloaded list. dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e "$los2o" -e 's/ $//'` fi # Discover the nlist of each of the dlfiles. nlist="$objdir/${output}.nm" if test -d $objdir; then $show "$rm $nlist ${nlist}T" $run $rm "$nlist" "${nlist}T" else $show "$mkdir $objdir" $run $mkdir $objdir status=$? if test $status -ne 0 && test ! -d $objdir; then exit $status fi fi # Parse the name list into a source file. $show "creating $objdir/$dlsyms" $echo > "$objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define dld_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test -n "$export_symbols"; then sed -e 's/^\(.*\)/\1 \1/' < "$export_symbols" > "$nlist" fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we at least have an empty file. test -f "$nlist" || : > "$nlist" # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else $rm "$nlist"T fi if test -f "$nlist"; then sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms" else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef dld_preloaded_symbols #if defined (__STDC__) && __STDC__ # define __ptr_t void * #else # define __ptr_t char * #endif /* The mapping between symbol names and symbols. */ struct { char *name; __ptr_t address; } dld_preloaded_symbols[] = {\ " if test -n "$export_symbols"; then echo >> "$objdir/$dlsyms" "\ {\"${output}\", (__ptr_t) 0}," sed 's/^\(.*\)/ {"\1", (__ptr_t) \&\1},/' < "$export_symbols" >> "$objdir/$dlsyms" fi for arg in $dlprefiles; do name=`basename $arg` echo >> "$objdir/$dlsyms" "\ {\"$name\", (__ptr_t) 0}," eval "$NM $arg | $global_symbol_pipe > '$nlist'" if test -f "$nlist"; then sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms" else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi done if test -f "$nlist"; then sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ {0, (__ptr_t) 0} }; #ifdef __cplusplus } #endif\ " fi # Now compile the dynamic symbol file. $show "(cd $objdir && $C_compiler -c$no_builtin_flag \"$dlsyms\")" $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag "$dlsyms")' || exit $? # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac elif test "$export_dynamic" != yes; then test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2 else # We keep going just in case the user didn't refer to # dld_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # We have no uninstalled library dependencies, so finalize right now. $show "$compile_command" $run eval "$compile_command" exit $? fi # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'T%g'` # Create the binary in the object directory, then wrap it. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $objdir; then exit $status fi fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case "$dir" in /* | [A-Za-z]:[/\\]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi # Delete the old output file. $run $rm $output if test -n "$compile_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command" finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command" fi if test "$hardcode_action" = relink; then # AGH! Flame the AIX and HP-UX people for me, will ya? $echo "$modename: warning: this platform doesn\'t like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 fi $show "$compile_command" $run eval "$compile_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the finalize command for shipping. finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"` # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case "$0" in /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: link_against_libtool_libs='$link_against_libtool_libs' finalize_command=\"cd `pwd | sed -e $sed_quote_subst`; $finalize_command\" else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" progdir=\"\$thisdir/$objdir\" program='$outputname' if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\` export $shlibpath_var " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs" addlibs="$convenience" build_libtool_libs=no else oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e 's/[^ ]*\.lib //g' -e "$los2o" -e 's/ $//g'` addlibs="$old_convenience" fi # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. xdir="$xlib"x generated="$generated $xdir" xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'` $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x ../$xlib)" $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $? oldobjs="$oldobjs `echo $xdir/*`" done # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case "$output" in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Only create the output if not a dry run. if test -z "$run"; then $echo > $output "\ # $output - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION # The name that we can dlopen(3). dlname='$dlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=no # Directory that this library needs to be installed in: libdir='$install_libdir'\ " fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $LN_S ../$outputname $outputname)" $run eval "(cd $output_objdir && $LN_S ../$outputname $outputname)" || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case "$arg" in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case "$destdir" in /* | [A-Za-z]:[/\\]*) ;; *) for file in $files; do case "$file" in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case "$file" in *.a | *.lib) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" test "X$dir" = "X$file/" && dir= dir="$dir$objdir" # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift # Install the shared library and build the symlinks. $show "$install_prog $dir/$realname $destdir/$realname" $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? test "X$dlname" = "X$realname" && dlname= if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do test "X$dlname" = "X$linkname" && dlname= if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi if test -n "$dlname"; then # Install the dynamically-loadable library. $show "$install_prog $dir/$dlname $destdir/$dlname" $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $? fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "Creating $instname" $rm "$instname" sed 's/^installed=no$/installed=yes/' "$file" > "$instname" $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? $show "$rm $instname" $rm "$instname" # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case "$destfile" in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.o | *.obj) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then link_against_libtool_libs= finalize_command= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $link_against_libtool_libs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case "$lib" in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done if test "$hardcode_action" = relink; then if test "$finalize" = yes; then $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2 $show "$finalize_command" if $run eval "$finalize_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 continue fi file="$objdir/$file"T else $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec $SHELL $0 --finish$current_libdirs exit 1 fi exit 0 ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "To link against installed libraries in a given directory, LIBDIR," echo "you must use the \`-LLIBDIR' flag during linking." echo echo " You will also need to do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case "$file" in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case "$file" in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then # Export the shlibpath_var. eval "export $shlibpath_var" # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now actually exec the command. eval "exec \$cmd$args" $echo "$modename: cannot exec \$cmd$args" exit 1 else # Display what would be done. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" $echo "$cmd$args" exit 0 fi ;; # libtool uninstall mode uninstall) modename="$modename: uninstall" rm="$nonopt" files= for arg do case "$arg" in -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` rmfiles="$file" case "$name" in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $dir/$n" test "X$n" = "X$dlname" && dlname= done test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname" test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" $show "$rm $rmfiles" $run $rm $rmfiles if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi $show "$rm $rmfiles" $run $rm $rmfiles ;; *) $show "$rm $rmfiles" $run $rm $rmfiles ;; esac done exit 0 ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi # test -z "$show_help" # We need to display help for each of the modes. case "$mode" in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: xbase-2.0.0/missing0000755000000000000000000001160207115376247007655 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison touch file \`y.tab.c' makeinfo touch the output file yacc touch file \`y.tab.c'" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in` if test -z "$files"; then files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` test -z "$files" || files="$files.in" else files=`echo "$files" | sed -e 's/:/ /g'` fi test -z "$files" && files="config.h.in" touch $files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print \ | sed 's/^\(.*\).am$/touch \1.in/' \ | sh ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." touch y.tab.c ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 xbase-2.0.0/mkinstalldirs0000755000000000000000000000133607115376247011067 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1.1.1 2000/06/01 06:03:19 dbryson Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here xbase-2.0.0/xbase-config.in0000755000000000000000000000241507173660612011154 #!/bin/sh prefix=@prefix@ exec_prefix=@exec_prefix@ exec_prefix_set=no CC="@CC@" CXX="@CXX@" LD="@SHARED_LD@" usage="\ Usage: xbase-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] [--cc] [--cxx] [--ld]" if test $# -eq 0; then echo "${usage}" 1>&2 exit 1 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then exec_prefix=$optarg fi ;; --prefix) echo $prefix ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; --exec-prefix) echo $exec_prefix ;; --version) echo @VERSION@ ;; --cflags) if test @includedir@ != /usr/include ; then if test @includedir@ != /usr/include/c++ ; then includes=-I@includedir@ fi fi echo $includes ;; --libs) if test @libdir@ != /usr/lib ; then libs="-L@libdir@" fi echo $libs -lxbase ;; --cc) echo $CC ;; --cxx) echo $CXX ;; --ld) echo $LD ;; *) echo "${usage}" 1>&2 exit 1 ;; esac shift done xbase-2.0.0/xbase.spec.in0000644000000000000000000000240407316215645010636 %define xbase_ver @VERSION@ Summary: Xbase dBase database file library Name: xbase Provides: xbase-2.0 Version: %{xbase_ver} Release: 1 Source: xbase-@VERSION@.tar.gz Copyright: LGPL Group: Development/Libraries Packager: Derry Bryson Vendor: Xbase Development Team (linux.techass.com/projects/xdb) %description Library for accessing dBase .dbf, .ndx, .dbt, and Clipper .ntx files. %package -n xbase-devel Version: %{xbase_ver} Summary: Xbase development package Group: Development/Libraries Provides: xbase-devel-2.0 Requires: xbase-2.0 %description -n xbase-devel Headers and such for compiling programs that use the Xbase library. %prep %setup CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --enable-static %build make %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install %post /sbin/ldconfig %postun /sbin/ldconfig %files -n xbase /usr/bin/checkndx /usr/bin/copydbf /usr/bin/deletall /usr/bin/dumphdr /usr/bin/dumprecs /usr/bin/packdbf /usr/bin/reindex /usr/bin/undelall /usr/bin/zap /usr/bin/dbfutil1 /usr/lib/libxbase.so /usr/lib/libxbase-2.0.so.* %doc NEWS README TODO AUTHORS COPYING ChangeLog %files -n xbase-devel /usr/include/xbase /usr/bin/xbase-config /usr/lib/libxbase.la /usr/lib/libxbase.a %doc docs/html docs/latex xbase-2.0.0/makefile.g950000644000000000000000000000322407203043260010342 # This file is part of the XBase libraries # Copyright (C) 2000 Derry Bryson # # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # xdb.sourceforge.net # all : xbase_all examples_all libtest_all bin_all xbase_all : cd xbase && $(MAKE) -f makefile.g95 all examples_all : cd examples && $(MAKE) -f makefile.g95 all libtest_all : cd libtest && $(MAKE) -f makefile.g95 all bin_all : cd bin && $(MAKE) -f makefile.g95 all clean : xbase_clean examples_clean libtest_clean bin_clean xbase_clean : cd xbase && $(MAKE) -f makefile.g95 clean examples_clean : cd examples && $(MAKE) -f makefile.g95 clean libtest_clean : cd libtest && $(MAKE) -f makefile.g95 clean bin_clean : cd bin && $(MAKE) -f makefile.g95 clean xbase-2.0.0/xbase/0000777000000000000000000000000007316217171007435 5xbase-2.0.0/xbase/Makefile.in0000644000000000000000000003103507316217170011417 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # This file is part of the XBase libraries # Copyright (C) 1998 Denis Pershin (dyp@inetlab.com) # # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # xdb.sourceforge.net # SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ GLINC = @GLINC@ GLLIB = @GLLIB@ LD = @LD@ LIBDL = @LIBDL@ LIBJPEG = @LIBJPEG@ LIBNSL = @LIBNSL@ LIBOBJS = @LIBOBJS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ NM = @NM@ PACKAGE = @PACKAGE@ PAMINC = @PAMINC@ PAMLIBPATHS = @PAMLIBPATHS@ PAMLIBS = @PAMLIBS@ RANLIB = @RANLIB@ TVPROGS = @TVPROGS@ VERSION = @VERSION@ XPMINC = @XPMINC@ XPMLIB = @XPMLIB@ XSUBDIRS = @XSUBDIRS@ X_INCLUDES = @X_INCLUDES@ X_LDFLAGS = @X_LDFLAGS@ doxygen = @doxygen@ topdir = @topdir@ x_includes = @x_includes@ x_libraries = @x_libraries@ INCLUDES = -I$(topdir) lib_LTLIBRARIES = libxbase.la pkginclude_HEADERS = dbf.h exp.h html.h ndx.h retcodes.h xbase.h xdate.h xstack.h xtypes.h xbexcept.h xbstring.h index.h ntx.h xbconfig.h xbfilter.h #install-data-hook: # (cd $(includedir); rm -f xbase.h; ln -s xbase/xbase.h xbase.h) libxbase_la_SOURCES = dbf.cpp exp.cpp expfunc.cpp expproc.cpp fields.cpp html.cpp lock.cpp memo.cpp ndx.cpp stack.cpp xbase.cpp xdate.cpp xbexcept.cpp xbstring.cpp index.cpp ntx.cpp xbfilter.cpp EXTRA_DIST = xbase.h xbconfigw32.h makefile.g95 xbase.ide libxbase_la_LDFLAGS = -version-info 0:0:0 -release 2.0 libxbase_la_LIBADD = MAINTAINERCLEANFILES = Makefile.in stamp-h.in xbconfig.h.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = xbconfig.h CONFIG_CLEAN_FILES = xbase.h LTLIBRARIES = $(lib_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libxbase_la_DEPENDENCIES = libxbase_la_OBJECTS = dbf.lo exp.lo expfunc.lo expproc.lo fields.lo \ html.lo lock.lo memo.lo ndx.lo stack.lo xbase.lo xdate.lo xbexcept.lo \ xbstring.lo index.lo ntx.lo xbfilter.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ HEADERS = $(pkginclude_HEADERS) DIST_COMMON = ./stamp-h.in Makefile.am Makefile.in xbase.h.in \ xbconfig.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(libxbase_la_SOURCES) OBJECTS = $(libxbase_la_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cpp .lo .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps xbase/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status xbconfig.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/xbconfig.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=xbase/xbconfig.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/xbconfig.h.in: $(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f xbconfig.h maintainer-clean-hdr: xbase.h: $(top_builddir)/config.status xbase.h.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-libLTLIBRARIES: clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) distclean-libLTLIBRARIES: maintainer-clean-libLTLIBRARIES: install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) list='$(lib_LTLIBRARIES)'; for p in $$list; do \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: libxbase.la: $(libxbase_la_OBJECTS) $(libxbase_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libxbase_la_LDFLAGS) $(libxbase_la_OBJECTS) $(libxbase_la_LIBADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< .cpp.lo: $(LTCXXCOMPILE) -c $< install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) list='$(pkginclude_HEADERS)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgincludedir)/$$p; \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) xbconfig.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)xbconfig.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags xbconfig.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = xbase distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done dbf.lo dbf.o : dbf.cpp expfunc.lo expfunc.o : expfunc.cpp exp.lo exp.o : exp.cpp expproc.lo expproc.o : expproc.cpp fields.lo fields.o : fields.cpp html.lo html.o : html.cpp index.lo index.o : index.cpp lock.lo lock.o : lock.cpp memo.lo memo.o : memo.cpp ndx.lo ndx.o : ndx.cpp ntx.lo ntx.o : ntx.cpp stack.lo stack.o : stack.cpp xbase.lo xbase.o : xbase.cpp xbexcept.lo xbexcept.o : xbexcept.cpp xbfilter.lo xbfilter.o : xbfilter.cpp xbstring.lo xbstring.o : xbstring.cpp xdate.lo xdate.o : xdate.cpp info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am all-recursive-am: xbconfig.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-libLTLIBRARIES install-exec: install-exec-am install-data-am: install-pkgincludeHEADERS install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) xbconfig.h all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-hdr mostlyclean-libLTLIBRARIES \ mostlyclean-compile mostlyclean-libtool \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-hdr clean-libLTLIBRARIES clean-compile clean-libtool \ clean-tags clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-hdr distclean-libLTLIBRARIES distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-hdr \ maintainer-clean-libLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ distclean-compile clean-compile maintainer-clean-compile \ mostlyclean-libtool distclean-libtool clean-libtool \ maintainer-clean-libtool uninstall-pkgincludeHEADERS \ install-pkgincludeHEADERS tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck all-recursive-am install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xbase-2.0.0/xbase/stamp-h.in0000644000000000000000000000001207316217054011243 timestamp xbase-2.0.0/xbase/Makefile.am0000644000000000000000000000346607316207173011417 # This file is part of the XBase libraries # Copyright (C) 1998 Denis Pershin (dyp@inetlab.com) # # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # xdb.sourceforge.net # INCLUDES = -I$(topdir) lib_LTLIBRARIES = libxbase.la pkginclude_HEADERS = dbf.h exp.h html.h ndx.h retcodes.h xbase.h \ xdate.h xstack.h xtypes.h xbexcept.h xbstring.h index.h ntx.h \ xbconfig.h xbfilter.h #install-data-hook: # (cd $(includedir); rm -f xbase.h; ln -s xbase/xbase.h xbase.h) libxbase_la_SOURCES = dbf.cpp exp.cpp expfunc.cpp expproc.cpp fields.cpp \ html.cpp lock.cpp memo.cpp ndx.cpp stack.cpp xbase.cpp xdate.cpp \ xbexcept.cpp xbstring.cpp index.cpp ntx.cpp xbfilter.cpp EXTRA_DIST = \ xbase.h \ xbconfigw32.h \ makefile.g95 \ xbase.ide libxbase_la_LDFLAGS = -version-info 0:0:0 -release 2.0 libxbase_la_LIBADD = MAINTAINERCLEANFILES = Makefile.in stamp-h.in xbconfig.h.in xbase-2.0.0/xbase/xbase.h.in0000644000000000000000000001153307203046325011230 /* $Id: xbase.h.in,v 1.5 2000/11/10 19:30:29 dbryson Exp $ Xbase project source code This file contains a header file for the xbXBase class, which is the base class for using the Xbase DBMS library. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.8.0a 1/27/99 - Added DisplayError method */ #ifndef __XB_XBASE_H__ #define __XB_XBASE_H__ #ifdef __GNUG__ #pragma interface #endif #ifdef __WIN32__ #include "xbase/xbconfigw32.h" #else #include "xbase/xbconfig.h" #endif // // Identify ourselves // #define XDB_VERSION "@VERSION@" #define XBASE_VERSION "@VERSION@" #include #if defined(__WIN32__) #include "windows.h" // ripped from wxWindows // _declspec works in BC++ 5 and later, as well as VC++ #if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) # ifdef XBMAKINGDLL # define XBDLLEXPORT __declspec( dllexport ) # define XBDLLEXPORT_DATA(type) __declspec( dllexport ) type # define XBDLLEXPORT_CTORFN # elif defined(XBUSINGDLL) # define XBDLLEXPORT __declspec( dllimport ) # define XBDLLEXPORT_DATA(type) __declspec( dllimport ) type # define XBDLLEXPORT_CTORFN # else # define XBDLLEXPORT # define XBDLLEXPORT_DATA(type) type # define XBDLLEXPORT_CTORFN # endif #else # define XBDLLEXPORT # define XBDLLEXPORT_DATA(type) type # define XBDLLEXPORT_CTORFN #endif #else // !Windows # define XBDLLEXPORT # define XBDLLEXPORT_DATA(type) type # define XBDLLEXPORT_CTORFN #endif // Win/!Win #include #include #include #include #if defined(XB_EXPRESSIONS) #include #endif /*! \file xbase.h */ class XBDLLEXPORT xbDbf; //! xbDbList struct /*! */ struct XBDLLEXPORT xbDbList{ xbDbList * NextDbf; char * DbfName; xbDbf * dbf; }; //! xbXBase class /*! */ #if defined(XB_EXPRESSIONS) class XBDLLEXPORT xbXBase : public xbExpn { #else class XBDLLEXPORT xbXBase : public xbDate { #endif protected: xbDbList * DbfList; xbDbList * FreeDbfList; xbShort EndianType; /* B = Big Endian, L = Little Endian */ public: ~xbXBase(); xbXBase(); xbShort AddDbfToDbfList(xbDbf *d, const char *DatabaseName); xbDbf * GetDbfPtr( const char *Name ); xbShort DirectoryExistsInName( const char *Name ); xbShort GetEndianType( void ) { return EndianType; } void DisplayError( const xbShort ErrorCode ) const; static const char* GetErrorMessage( const xbShort ErrorNo ); /* next 6 routines handle both big endian and little endian machines */ xbDouble GetDouble( const char *p ); xbLong GetLong ( const char *p ); xbULong GetULong ( const char *p ); xbShort GetShort ( const char *p ); void PutLong ( char *p, const xbLong l ); void PutShort ( char *p, const xbShort s ); void PutULong ( char *p, const xbULong l ); void PutUShort( char *p, const xbUShort s ); void PutDouble( char *p, const xbDouble d ); xbShort RemoveDbfFromDbfList( xbDbf * ); }; #include #if defined(XB_INDEX_ANY) #include #endif #ifdef XB_INDEX_NDX #include #endif #ifdef XB_INDEX_NTX #include #endif #if defined(XB_FILTERS) && !defined(XB_INDEX_ANY) #error XB_FILTERS cant be used without index support #elif defined(XB_FILTERS) #include #endif #ifdef XB_LOCKING_ON #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_SYS_LOCKING_H #include #define F_SETLKW 0 #define F_SETLK 1 #define F_RDLCK 2 #define F_WRLCK 3 #define F_UNLCK 4 #endif #else enum { F_SETLKW = 0, F_WRLCK = 0 }; #endif #ifdef XB_HTML #include #endif #endif // __XB_XBASE_H__ xbase-2.0.0/xbase/xbconfig.h.in0000644000000000000000000000734307316216473011741 /* xbase/xbconfig.h.in. Generated automatically from configure.in by autoheader. */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE #undef _ALL_SOURCE #endif /* Define if on MINIX. */ #undef _MINIX /* Define if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define if you need to in order for stat and other things to work. */ #undef _POSIX_SOURCE /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if the C++ compiler supports BOOL */ #undef HAVE_BOOL /* define if you have setenv */ #undef HAVE_FUNC_SETENV /* Define if you need the GNU extensions to compile */ #undef _GNU_SOURCE /* Define if you need to have .ndx indexes */ #undef XB_INDEX_NDX /* Define if you need to have .ntx indexes */ #undef XB_INDEX_NTX /* Define if you need to support memo fields */ #undef XB_MEMO_FIELDS /* Define if you need expressions */ #undef XB_EXPRESSIONS /* Define if you need html support */ #undef XB_HTML /* Define if you need locking support */ #undef XB_LOCKING_ON /* Define if you need to turn on XBase specific debug */ #undef XBASE_DEBUG /* Define if your compiler support exceptions */ #undef HAVE_EXCEPTIONS /* Define if you want Castellano (Spanish) Dates */ #undef XB_CASTELLANO /* Define if using real deletes */ #undef XB_REAL_DELETE /* Define if need filters */ #undef XB_FILTERS /* Define if you have the fcntl function. */ #undef HAVE_FCNTL /* Define if you have the flock function. */ #undef HAVE_FLOCK /* Define if you have the getdomainname function. */ #undef HAVE_GETDOMAINNAME /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF /* Define if you have the socket function. */ #undef HAVE_SOCKET /* Define if you have the strcasecmp function. */ #undef HAVE_STRCASECMP /* Define if you have the vsnprintf function. */ #undef HAVE_VSNPRINTF /* Define if you have the vsprintf function. */ #undef HAVE_VSPRINTF /* Define if you have the header file. */ #undef HAVE_CTYPE_H /* Define if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the header file. */ #undef HAVE_EXCEPTION /* Define if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have the header file. */ #undef HAVE_G___EXCEPTION_H /* Define if you have the header file. */ #undef HAVE_IO_H /* Define if you have the header file. */ #undef HAVE_NDIR_H /* Define if you have the header file. */ #undef HAVE_STDARG_H /* Define if you have the header file. */ #undef HAVE_STRING_H /* Define if you have the header file. */ #undef HAVE_STRINGS_H /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H /* Define if you have the header file. */ #undef HAVE_SYS_LOCKING_H /* Define if you have the header file. */ #undef HAVE_SYS_NDIR_H /* Define if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define if you have the header file. */ #undef HAVE_TVISION_TV_H /* Should we include generic index support? */ #if defined(XB_INDEX_NDX) || defined(XB_INDEX_NTX) #define XB_INDEX_ANY 1 #endif /* expressions required for indexes */ #if defined(XB_INDEX_ANY) && !defined(XB_EXPRESSIONS) #define XB_EXPRESSIONS 1 #endif /* default memo block size */ #define XB_DBT_BLOCK_SIZE 512 /* filename path separator */ #define PATH_SEPARATOR '/' #ifndef HAVE_BOOL #define HAVE_BOOL 1 typedef int bool; const bool false = 0; const bool true = 1; #endif xbase-2.0.0/xbase/dbf.cpp0000644000000000000000000022305007244527507010621 /* $Id: dbf.cpp,v 1.8 2001/02/20 17:54:15 dbryson Exp $ Xbase project source code This file contains the basic Xbase routines for reading and writing Xbase .DBF files. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.6c 4/16/98 - Big Endian support, dBASE III + memo field support V 1.8 11/30/98 - Version 1.8 Upgrade V 1.9.2 9/14/99 - Fix to CreateDatabase - if field name too long Updated EOR and EOF processing V 1.9.2 4/16/2000 - fixed record locking logic in GetRecord reoutines - turned off buffering when locking is on V 1.9.2 6/14/2000 - Fixed Version header field to match empirical values for dBASE III+ and dBASE IV. V 1.9.2 6/15/2000 - Added call to InitVars() to cleanup error handling in CreateDatabase() and OpenDatabase(). */ #ifdef __GNUG__ #pragma implementation "dbf.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #ifdef HAVE_IO_H #include #endif #include #include #include #include #include /*! \file dbf.cpp */ /************************************************************************/ //! Constructor /*! \param x pointer to the global xbXbase class */ xbDbf::xbDbf( xbXBase * x ) { xbase = x; InitVars(); } /************************************************************************/ //! Initialize private data members. /*! Internal use only. */ void xbDbf::InitVars( void ) { DatabaseName = (char)0x00; NoOfFields = 0; DbfStatus = XB_CLOSED; fp = NULL; CurRec = 0L; SchemaPtr = NULL; RecBuf = NULL; RecBuf2 = NULL; Version = 0x00; UpdateYY = 0x00; UpdateMM = 0x00; UpdateDD = 0x00; NoOfRecs = 0L; HeaderLen = 0x00; RecordLen = 0x00; MdxList = NULL; NdxList = NULL; // NtxList = NULL; FreeIxList = NULL; XFV = 3; /* Xbase file version */ // strncpy(EofChar, "\x0D\x1A", 10); #ifdef XB_LOCKING_ON AutoLock = 1; CurLockType = -1; CurLockCount = 0; CurLockedRecNo = 0L; CurRecLockType = -1; CurRecLockCount = 0; CurMemoLockType = -1; CurMemoLockCount = 0; #else AutoLock = 0; #endif #ifdef XB_MEMO_FIELDS MemoHeader.BlockSize = XB_DBT_BLOCK_SIZE; MemoHeader.Version = 0x03; mfp = NULL; mbb = NULL; CurMemoBlockNo = -1; mfield1 = 0; MStartPos = 0; MFieldLen = 0; NextFreeBlock = 0L; FreeBlockCnt = 0L; MNextBlockNo = 0L; MNoOfFreeBlocks = 0L; #endif //#ifdef XB_REAL_DELETE RealDelete = 0; FirstFreeRec = 0L; RealNumRecs = 0L; //#endif } /************************************************************************/ //! Calculate checksum for the current record. /*! Internal use only. */ xbLong xbDbf::CalcCheckSum() { xbShort i; char *p; p = RecBuf; xbLong l = 0L; for( i = 0; i < RecordLen; i++ ) l+= *p++; return l; } /************************************************************************/ //! Set dbase version for the dbf file. /*! Set dbase version. Should only be used before creating a database with xbDbf::CreateDatabase(). \param v version, either 3 or 4. */ xbShort xbDbf::SetVersion(xbShort v) { if (v == 0) return XFV; else if (v == 3) { XFV = 3; #ifdef XB_MEMO_FIELDS MemoHeader.Version = 0x03; #endif return XFV; } else if (v == 4) { XFV = 4; #ifdef XB_MEMO_FIELDS MemoHeader.Version = 0x00; #endif return XFV; } xb_error(XB_INVALID_OPTION); } /************************************************************************/ //! Write the dbf header /*! Internal use only. \param PositionOption flag that indicates whether file postition should be moved. non-zero if so, zero if not. */ xbShort xbDbf::WriteHeader( const xbShort PositionOption ) { #if 0 char buf[4]; if (PositionOption) rewind( fp ); if(fwrite(&Version, 4, 1, fp) != 1) xb_error(XB_WRITE_ERROR); memset( buf, 0x00, 4 ); xbase->PutLong( buf, NoOfRecs ); if (fwrite(buf, 4, 1, fp) != 1) xb_error(XB_WRITE_ERROR); if (PositionOption == 2) return XB_NO_ERROR; memset( buf, 0x00, 4 ); xbase->PutShort( buf, HeaderLen ); if (fwrite(buf, 2, 1, fp) != 1) xb_error(XB_WRITE_ERROR); memset( buf, 0x00, 4 ); xbase->PutShort( buf, RecordLen ); if (fwrite(buf, 2, 1, fp) != 1) xb_error(XB_WRITE_ERROR); #ifdef XB_REAL_DELETE if(RealDelete) { memset(buf, 0x00, 4); xbase->PutULong(buf, FirstFreeRec); if (fwrite(buf, 4, 1, fp) != 1) xb_error(XB_WRITE_ERROR); memset(buf, 0x00, 4); xbase->PutULong(buf, RealNumRecs); if (fwrite(buf, 4, 1, fp) != 1) xb_error(XB_WRITE_ERROR); } #endif #else char buf[32]; memset(buf, 0, 32); if(PositionOption) rewind(fp); memcpy(&buf[0], &Version, 4); xbase->PutLong(&buf[4], NoOfRecs); xbase->PutShort(&buf[8], HeaderLen ); xbase->PutShort(&buf[10], RecordLen ); #ifdef XB_REAL_DELETE if(RealDelete) { xbase->PutULong(&buf[12], FirstFreeRec); xbase->PutULong(&buf[16], RealNumRecs); } #endif #endif if(fwrite(buf, 32, 1, fp) != 1) xb_error(XB_WRITE_ERROR); return XB_NO_ERROR; } /************************************************************************/ //! Read the dbf header. /*! Internal use only. \param PositionOption */ xbShort xbDbf::ReadHeader( xbShort PositionOption ) { #if 0 char buf[4]; if (PositionOption) rewind(fp); if (fread(&Version, 4, 1, fp) != 1) xb_error(XB_READ_ERROR); if (fread(buf, 4, 1, fp ) != 1) xb_error(XB_READ_ERROR); NoOfRecs = xbase->GetLong( buf ); if(fread(buf, 2, 1, fp) != 1) xb_error(XB_READ_ERROR); HeaderLen = xbase->GetShort( buf ); if(fread(buf, 2, 1, fp) != 1) xb_error(XB_READ_ERROR); RecordLen = xbase->GetShort(buf); #ifdef XB_REAL_DELETE if(RealDelete) { if (fread(buf, 4, 1, fp ) != 1) xb_error(XB_READ_ERROR); FirstFreeRec = xbase->GetULong( buf ); if (fread(buf, 4, 1, fp ) != 1) xb_error(XB_READ_ERROR); RealNumRecs = xbase->GetULong( buf ); } #endif #else char buf[32]; if(PositionOption) rewind(fp); if(fread(buf, 32, 1, fp) != 1) xb_error(XB_READ_ERROR); memcpy(&Version, buf, 4); NoOfRecs = xbase->GetLong(&buf[4]); HeaderLen = xbase->GetShort(&buf[8]); RecordLen = xbase->GetShort(&buf[10]); #ifdef XB_REAL_DELETE if(RealDelete) { FirstFreeRec = xbase->GetULong(&buf[12]); RealNumRecs = xbase->GetULong(&buf[16]); } #endif #endif return XB_NO_ERROR; } /************************************************************************/ //! Determine if file name suffix is missing /*! Internal use only. */ xbShort xbDbf::NameSuffixMissing( xbShort type, const char * name ) { /* type 1 is DBF check type 2 is NDX check type 3 is MDX check type 4 is NTX check Returns 0 if suffix found 1 if suffix not found, lower case 2 is suffix not found, upper, case */ xbShort len; len = strlen( name ); if( len <= 4 ) if( name[len-1] >= 'A' && name[len-1] <= 'Z' ) return 2; else return 1; if( type == 1 && name[len-4] == '.' && ( name[len-3] == 'd' || name[len-3] == 'D' ) && ( name[len-2] == 'b' || name[len-2] == 'B' ) && ( name[len-1] == 'f' || name[len-1] == 'F' ) ) return 0; if( type == 2 && name[len-4] == '.' && ( name[len-3] == 'n' || name[len-3] == 'N' ) && ( name[len-2] == 'd' || name[len-2] == 'D' ) && ( name[len-1] == 'x' || name[len-1] == 'X' ) ) return 0; if( type == 4 && name[len-4] == '.' && ( name[len-3] == 'n' || name[len-3] == 'N' ) && ( name[len-2] == 't' || name[len-2] == 'T' ) && ( name[len-1] == 'x' || name[len-1] == 'X' ) ) return 0; if( name[len-5] >= 'A' && name[len-5] <= 'Z' ) return 2; else return 1; } /************************************************************************/ //! Create the dbf file. /*! This method attempts to create the XDB DBF file with the specified name (TableName) and schema (xbSchema s). The OverLay switch is used to determine if an existing file should be overwritten or an error flagged if the file already exists. The record buffer is blanked (set to spaces). \param TableName name of the table \param s xbSchema \param Overlay One of the following: \htmlonly

OverLayDescription
XB_OVERLAYOverwrite existing file if it exists
XB_DONTOVERLAYReport an error if file exists
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{OverLay} & \textbf{Description} \\ \hline \hline XB\_OVERLAY & Overwrite existing file if it exists \\ \hline XB\_DONTOVERLAY & Report an error if file exists \\ \hline \end{tabular} \endlatexonly \returns One of the following return codes: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_FILE_EXISTSIf the file exists and OverLay is XB_DONTOVERLAY
XB_OPEN_ERRORCouldn't open the file
XB_NO_MEMORYMemory allocation error
XB_WRITE_ERRORCouldn't write to disk
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No Error \\ \hline XB\_FILE\_EXISTS & If the file exists and OverLay is XB\_DONTOVERAY \\ \hline XB\_OPEN\_ERROR & Couldn't open the file \\ \hline XB\_WRITE\_ERROR & Couldn't write to disk \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::CreateDatabase( const char * TableName, xbSchema * s, const xbShort Overlay ) { /* future release - add logic to check number of fields and record length */ xbShort i, j, k, k2, NameLen, rc, count; #ifdef XB_MEMO_FIELDS xbShort MemoSw = 0; #endif i = j = 0; DbfStatus = XB_CLOSED; /* Get the datafile name and store it in the class */ NameLen = strlen(TableName) + 1; if(( rc = NameSuffixMissing( 1, TableName )) > 0 ) NameLen += 4; DatabaseName = TableName; if( rc == 1) DatabaseName +=".dbf"; else if( rc == 2 ) DatabaseName += ".DBF"; /* check if the file already exists */ if((( fp = fopen( DatabaseName, "r" )) != NULL ) && !Overlay ){ fclose( fp ); xb_error(XB_FILE_EXISTS); } else if( fp ) fclose( fp ); if(( fp = fopen( DatabaseName, "w+b" )) == NULL ) xb_open_error(DatabaseName); #ifdef XB_LOCKING_ON /* no buffering in multi user mode */ setbuf( fp, NULL ); #endif /* count the number of fields and check paramaters */ i = 0; while( s[i].Type != 0 ){ NoOfFields++; RecordLen += s[i].FieldLen; if( s[i].Type != 'C' && s[i].Type != 'N' && s[i].Type != 'F' && s[i].Type != 'D' && #ifdef XB_MEMO_FIELDS s[i].Type != 'M' && #endif /* XB_MEMO_FIELDS */ s[i].Type != 'L' ) xb_error(XB_UNKNOWN_FIELD_TYPE); #ifdef XB_MEMO_FIELDS if( !MemoSw && ( s[i].Type=='M' || s[i].Type=='B' || s[i].Type=='O')) MemoSw++; #endif // check for numeric fields which are too long if((s[i].Type == 'N' || s[i].Type == 'F') && s[i].FieldLen > 19 ) xb_error(XB_INVALID_FIELD_LEN); i++; } RecordLen++; /* add one byte for 0x0D */ if(( RecBuf = (char *) malloc( RecordLen )) == NULL ) { InitVars(); xb_memory_error; } if(( RecBuf2 = (char *) malloc( RecordLen )) == NULL ){ free( RecBuf ); InitVars(); xb_memory_error; } /* BlankRecord(); */ memset( RecBuf, 0x20, RecordLen ); memset( RecBuf2, 0x20, RecordLen ); /* set class variables */ Version = XFV & 0x7; // file version - bit 0-2 #ifdef XB_MEMO_FIELDS if (MemoSw) { if(XFV & 0x7 == 3) Version |= 0x80; // memo presence - bit 7 else Version = 0x8b; } #endif CurRec = 0L; HeaderLen = 33 + NoOfFields * 32; xbDate d; UpdateYY = (d.YearOf() - 1900); if(XFV & 0x7 == 3) UpdateYY %= 100; // dBASE III seems to do this, but IV does not. DTB UpdateMM = d.MonthOf(); UpdateDD = d.DayOf( XB_FMT_MONTH ); /* write the header prolog */ if(( rc = WriteHeader( 0 )) != XB_NO_ERROR ){ free( RecBuf ); free( RecBuf2 ); fclose( fp ); InitVars(); xb_error(XB_WRITE_ERROR); } count = 20; #ifdef XB_REAL_DELETE if(RealDelete) count = 12; #endif #if 0 for( i = 0; i < count; i++ ) { if(( fwrite( "\x00", 1, 1, fp )) != 1 ) { free( RecBuf ); free( RecBuf2 ); fclose( fp ); InitVars(); xb_error(XB_WRITE_ERROR); } } #endif if((SchemaPtr=(xbSchemaRec *)malloc(NoOfFields*sizeof(xbSchemaRec)))==NULL){ free( RecBuf ); free( RecBuf2 ); fclose( fp ); InitVars(); xb_memory_error; } memset( SchemaPtr, 0x00, ( NoOfFields * sizeof(xbSchemaRec))); /* write the field information into the header */ for( i = 0, k = 1; i < NoOfFields; i++ ){ // next two lines updated 9/14/99 - reported by Piotr Klaban // if field name too long ( > 10 bytes ) then SIGSEGV errors memset( SchemaPtr[i].FieldName, 0x00, 11 ); strncpy( SchemaPtr[i].FieldName, s[i].FieldName, 10 ); SchemaPtr[i].Type = s[i].Type; if( s[i].Type == 'M' || s[i].Type == 'B' || s[i].Type == 'O' ) { /* memo fields are always 10 bytes */ SchemaPtr[i].FieldLen = 10; SchemaPtr[i].NoOfDecs = 0; } else { SchemaPtr[i].FieldLen = s[i].FieldLen; SchemaPtr[i].NoOfDecs = s[i].NoOfDecs; } if( SchemaPtr[i].NoOfDecs > SchemaPtr[i].FieldLen ) { fclose( fp ); free( SchemaPtr ); free( RecBuf ); free( RecBuf2 ); InitVars(); xb_error(XB_INVALID_SCHEMA); } k2 = k; k += SchemaPtr[i].FieldLen; if(( fwrite( &SchemaPtr[i], 1, 18, fp )) != 18 ) { fclose( fp ); free( SchemaPtr ); free( RecBuf ); free( RecBuf2 ); InitVars(); xb_error(XB_WRITE_ERROR); } for( j = 0; j < 14; j++ ) { if(( fwrite( "\x00", 1, 1, fp )) != 1 ) { free( SchemaPtr ); free( RecBuf ); free( RecBuf2 ); fclose( fp ); InitVars(); xb_error(XB_WRITE_ERROR); } } SchemaPtr[i].Address = RecBuf + k2; SchemaPtr[i].Address2 = RecBuf2 + k2; } /* write the header terminator */ // if(( fwrite( EofChar, 2, 1, fp )) != 1 ) { if(( fputc( XB_CHARHDR, fp )) != XB_CHARHDR ){ fclose( fp ); free( SchemaPtr ); free( RecBuf ); free( RecBuf2 ); InitVars(); xb_error(XB_WRITE_ERROR); } #ifdef XB_MEMO_FIELDS if( MemoSw ) if((rc = CreateMemoFile()) != XB_NO_ERROR) { fclose(fp); free(RecBuf); free(RecBuf2); InitVars(); xb_error(rc); } #endif DbfStatus = XB_OPEN; return xbase->AddDbfToDbfList(this, DatabaseName); } /************************************************************************/ //! Close the dbf file. /*! This method attempts to close the XDB DBF file which was previously opened with either CreateDatabase() or OpenDatabase(). Deletes any memory allocated. Automatically closes any open indexes associated with this data file. \param deleteIndexes if TRUE, the indexes (xbIndex instances) will also be deleted (index files will not be deleted) \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_NOT_OPENFile was not open
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No Error \\ \hline XB\_NOT\_OPEN\_ERROR & File was not open \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::CloseDatabase(bool deleteIndexes) { #if defined(XB_INDEX_ANY) xbIxList *i, *ti; #endif if (DbfStatus == XB_CLOSED) xb_error(XB_NOT_OPEN); if (DbfStatus == XB_UPDATED /*&& AutoUpdate*/ ) { xbDate d; UpdateYY = d.YearOf() - 1900; if(XFV == 3) UpdateYY %= 100; // dBASE III seems to do this, IV does not. DTB UpdateMM = d.MonthOf(); UpdateDD = d.DayOf( XB_FMT_MONTH ); /* update the header */ WriteHeader( 1 ); /* write eof marker */ fseek( fp, 0L, 2 ); // fwrite( EofChar, 1, 1, fp ); fputc( XB_CHAREOF, fp ); PutRecord( CurRec ); } #if defined(XB_INDEX_ANY) i = NdxList; while (i) { i->index->CloseIndex(); if(deleteIndexes) delete i->index; i = NdxList; } /* free up unused nodes */ i = FreeIxList; while( i ) { ti = i; i = i->NextIx; free(ti); } #endif if (SchemaPtr){ for( int j = 0; j < NoOfFields; j++ ) if( SchemaPtr[j].fp ) delete SchemaPtr[j].fp; free( SchemaPtr ); } if (RecBuf) free( RecBuf ); if (RecBuf2) free( RecBuf2 ); #ifdef XB_MEMO_FIELDS if (mbb) free( mbb ); /* memo block buffer */ if (mfp) fclose( mfp ); /* memo file pointer */ #endif xbase->RemoveDbfFromDbfList( this ); fclose( fp ); InitVars(); return XB_NO_ERROR; } /************************************************************************/ /* options 1 = Print header only 2 = Field data only 3 = Header and Field data */ //! Dump header information. /*! \param Option One of the following: \htmlonly

OptionDescription
1Print header only
2Field data only
3Header and field data
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Option} & \textbf{Description} \\ \hline \hline 1 & Header only \\ \hline 2 & Field data only \\ \hline 3 & Header and field data \\ \hline \end{tabular} \endlatexonly */ #ifdef XBASE_DEBUG xbShort xbDbf::DumpHeader( xbShort Option ) { int i; if( Option < 1 || Option > 3 ) xb_error(XB_INVALID_OPTION); if( DbfStatus == XB_CLOSED ) xb_error(XB_NOT_OPEN); cout << "\nDatabase file " << DatabaseName << endl << endl; if( Option != 2 ) { cout << "File header data:" << endl; if( Version == 3 ) cout << "Dbase III file" << endl; else if ( Version == 83 ) cout << "Dbase III file with memo fields" << endl << endl; cout << "Last update date = " << (int) UpdateMM << "/" << (int) UpdateDD << "/" << (int) UpdateYY % 100 << endl; cout << "Header length = " << HeaderLen << endl; cout << "Record length = " << RecordLen << endl; cout << "Records in file = " << NoOfRecs << endl << endl; #ifdef XB_REAL_DELETE cout << "First Free Rec = " << FirstFreeRec << endl << endl; #endif } if( Option != 1 ) { cout << "Field Name Type Length Decimals" << endl; cout << "---------- ---- ------ --------" << endl; for( i = 0; i 0 ) printf( "%10s %1c %4d %4d\n", SchemaPtr[i].FieldName, SchemaPtr[i].Type, SchemaPtr[i].FieldLen, 0 ); else printf( "%10s %1c %4d %4d\n", SchemaPtr[i].FieldName, SchemaPtr[i].Type, SchemaPtr[i].FieldLen, SchemaPtr[i].NoOfDecs ); } } cout << endl; return XB_NO_ERROR; } #endif /************************************************************************/ //! Open the DBF file. /*! This method attempts to open the XDB DBF file with the specified name (TableName). This method does not position to any particular record in the file. The record buffer is blanked (set to spaces). \param TableName Name of table to open \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_OPEN_ERRORCouldn't open file
XB_NO_MEMORYMemory allocation error
XB_NOT_XBASENot an XDB DBF file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_OPEN\_ERROR & Couldn't open file \\ \hline XB\_NO\_MEMORY & Memory allocation error \\ \hline XB\_NOT\_XBASE & Not an XDB DBF file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::OpenDatabase( const char * TableName ) { xbShort i, j, NameLen, rc; char buf[33]; char *p; #ifdef XB_MEMO_FIELDS xbShort MemoSw = 0; #endif /* verify the file is not already open */ if ( DbfStatus != XB_CLOSED ) xb_error(XB_ALREADY_OPEN); /* Get the datafile name and store it in the class */ NameLen = strlen( TableName ) + 1; if(( rc = NameSuffixMissing( 1, TableName )) > 0 ) NameLen += 4; /* copy the file name to the class variable */ DatabaseName = TableName; if( rc == 1) DatabaseName += ".dbf"; else if( rc == 2 ) DatabaseName += ".DBF"; /* open the file */ if(( fp = fopen(DatabaseName, "r+b")) == NULL ) xb_open_error(DatabaseName); #ifdef XB_LOCKING_ON /* no buffering in multi user mode - may not see what others have updated */ setbuf( fp, NULL ); #endif #ifdef XB_LOCKING_ON if( AutoLock ) if(( rc = LockDatabase( F_SETLKW, F_RDLCK, 0L )) != XB_NO_ERROR) return rc; #endif /* copy the header into memory */ if(( rc = ReadHeader( 1 )) != XB_NO_ERROR ) { InitVars(); return rc; } /* check the version */ if( Version == 3 || Version == (char)0x83 ) /* dBASE III+ */ { XFV = 3; #ifdef XB_MEMO_FIELDS MemoHeader.Version = 0x03; #endif } else if( Version == 4 || Version == (char)0x8B ) /* dBASE IV */ { XFV = 4; #ifdef XB_MEMO_FIELDS MemoHeader.Version = 0x00; #endif } else { InitVars(); xb_error(XB_NOT_XBASE); } // it would seem that dBASE III+ generates an UpdateYY value // of 0 for 2000 and dBASE IV uses 100, so I have removed the // check for UpdateYY being 0 (which might be valid). DTB if (/*UpdateYY == 0 ||*/ UpdateMM == 0 || UpdateDD == 0 ) { InitVars(); xb_error(XB_NOT_XBASE); } /* calculate the number of fields */ NoOfFields = ( HeaderLen - 33 ) / 32; if(( RecBuf = (char *) malloc( RecordLen )) == NULL ) { fclose( fp ); InitVars(); xb_memory_error; } if(( RecBuf2 = (char *) malloc( RecordLen )) == NULL ) { fclose( fp ); free( RecBuf ); InitVars(); xb_memory_error; } if((SchemaPtr=(xbSchemaRec *)malloc(NoOfFields*sizeof(xbSchemaRec)))==NULL){ free( RecBuf ); free( RecBuf2 ); fclose( fp ); InitVars(); xb_memory_error; } memset( SchemaPtr, 0x00, ( NoOfFields * sizeof(xbSchemaRec))); /* copy field info into memory */ for( i = 0, j = 1; i < NoOfFields; i++ ){ fseek( fp, i*32+32, 0 ); // fread( &SchemaPtr[i].FieldName, 1, 18, fp ); fread( &buf, 1, 32, fp ); p = buf; strncpy( SchemaPtr[i].FieldName, p, 10 ); p += 11; SchemaPtr[i].Type = *p++; SchemaPtr[i].Address = RecBuf + j; SchemaPtr[i].Address2 = RecBuf2 + j; SchemaPtr[i].FieldLen = *( p + 4 ); SchemaPtr[i].NoOfDecs = *( p + 5 ); if( SchemaPtr[i].Type == 'C' && SchemaPtr[i].NoOfDecs > 0 ) { SchemaPtr[i].LongFieldLen = xbase->GetShort( p + 4 ); j += SchemaPtr[i].LongFieldLen; } else j += SchemaPtr[i].FieldLen; #ifdef XB_MEMO_FIELDS if( !MemoSw && (SchemaPtr[i].Type == 'M' || SchemaPtr[i].Type == 'B' || SchemaPtr[i].Type == 'O' )) MemoSw++; #endif } CurRec = 0L; DbfStatus = XB_OPEN; BlankRecord(); #ifdef XB_MEMO_FIELDS if( MemoSw ) /* does this table have memo fields ? */ if(( rc = OpenMemoFile()) != XB_NO_ERROR ) { free( RecBuf ); free( RecBuf2 ); free( SchemaPtr ); fclose( fp ); InitVars(); return rc; } #endif #ifdef XB_LOCKING_ON if( AutoLock ) LockDatabase( F_SETLK, F_UNLCK, 0L ); #endif /* XB_LOCKING_ON */ return xbase->AddDbfToDbfList( this, DatabaseName ); } /************************************************************************/ //! Blank the record buffer. /*! Sets the record to spaces. */ xbShort xbDbf::BlankRecord( void ) { if( DbfStatus == XB_CLOSED ) xb_error(XB_NOT_OPEN); memset( RecBuf, 0x20, RecordLen ); return XB_NO_ERROR; } /************************************************************************/ //! Append the current record to the data file /*! This method attempts to append the contents of the current record buffer to the end of the XDB DBF file and updates the file date and number of records in the file. Also updates any open indexes associated with this data file. \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_LOCK_FAILEDCouldn't lock file
XB_WRITE_ERRORError writing to file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_LOCK\_FAILED & Couldn't lock file \\ \hline XB\_WRITE\_ERROR & Error writing to file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::AppendRecord( void ) { xbShort rc = 0; xbULong nextRecNo; #if defined(XB_INDEX_ANY) xbIxList *i; #endif /* lock the database */ #ifdef XB_LOCKING_ON if( AutoLock ) if(( rc = LockDatabase( F_SETLKW, F_WRLCK, 0L )) != XB_NO_ERROR) return rc; if((rc = ReadHeader(1)) != XB_NO_ERROR) { if(AutoLock) LockDatabase( F_SETLK, F_UNLCK, 0L ); return rc; } #endif /* lock any indexes */ #if defined(XB_INDEX_ANY) #ifdef XB_LOCKING_ON i = NdxList; while( i && AutoLock ) { if(( rc = i->index->LockIndex( F_SETLKW, F_WRLCK )) != XB_NO_ERROR ) return rc; i = i->NextIx; } #endif /* XB_LOCKING_ON */ #endif // if there are no duplicates, and no records set the CurRec to the // last record + 1. This is for EXP::RECNO() /* check for any duplicate keys */ #if defined(XB_INDEX_ANY) i = NdxList; while( i ) { if( i->index->UniqueIndex() ) { i->index->CreateKey( 0, 0 ); if( i->index->FindKey() == XB_FOUND ) xb_error(XB_KEY_NOT_UNIQUE); } i = i->NextIx; } #endif #ifdef XB_REAL_DELETE if(RealDelete && FirstFreeRec) nextRecNo = FirstFreeRec; else nextRecNo = NoOfRecs + 1; #else nextRecNo = NoOfRecs + 1; #endif CurRec = NoOfRecs + 1; #if defined(XB_INDEX_ANY) /* update the indexes */ i = NdxList; while( i ) { if( !i->index->UniqueIndex() ) /* if we didn't prepare the key */ if(( rc = i->index->CreateKey( 0, 0 )) != XB_NO_ERROR ) /* then do it before the add */ return rc; if(( rc = i->index->AddKey(nextRecNo)) != XB_NO_ERROR ) return rc; i->index->TouchIndex(); i = i->NextIx; } #endif /* XB_INDEX_ANY */ #ifdef XB_REAL_DELETE char buf[4]; if(RealDelete && FirstFreeRec) { /* ** Grab the next free rec no and put it in FirstFreeRec */ if(fseek(fp, ((long) HeaderLen + ((FirstFreeRec - 1) * RecordLen) + 1), 0) != 0) xb_error(XB_SEEK_ERROR); if(fread(buf, 4, 1, fp) != 1) xb_error(XB_READ_ERROR); FirstFreeRec = xbase->GetULong(buf); } /* ** Okay, seek and write the record out */ if(fseek(fp, ((long) HeaderLen + ((nextRecNo - 1) * RecordLen)), 0) != 0) xb_error(XB_SEEK_ERROR); if(fwrite( RecBuf, RecordLen, 1, fp) != 1) xb_error(XB_WRITE_ERROR); /* ** If we just appended the record to the file, then write the EOF char */ if(nextRecNo == NoOfRecs + 1) { // if(fwrite( EofChar, 1, 1, fp ) != 1 ) if( fputc( XB_CHAREOF, fp ) != XB_CHAREOF ) xb_error(XB_WRITE_ERROR); } #else /* write the last record */ if( fseek( fp, ((long) HeaderLen + ( NoOfRecs * RecordLen )), 0 ) != 0 ) xb_error(XB_SEEK_ERROR); if( fwrite( RecBuf, RecordLen, 1, fp ) != 1 ) xb_error(XB_WRITE_ERROR); /* write the end of file marker */ // if( fwrite( "\x0d", 1, 1, fp ) != 1 ) // if( fwrite( EofChar, 1, 1, fp ) != 1 ) if( fputc( XB_CHAREOF, fp ) != XB_CHAREOF ) xb_error(XB_WRITE_ERROR); #endif /* calculate the latest header information */ xbDate d; UpdateYY = d.YearOf() - 1900; if(XFV == 3) UpdateYY %= 100; // dBASE III seems to do this, IV does not. DTB UpdateMM = d.MonthOf(); UpdateDD = d.DayOf( XB_FMT_MONTH ); #ifndef XB_REAL_DELETE NoOfRecs++; #else if(RealDelete) { if(nextRecNo == NoOfRecs + 1) NoOfRecs++; RealNumRecs++; } else NoOfRecs++; #endif CurRec = nextRecNo; // CurRec = NoOfRecs; /* rewrite the header record */ if(( rc = WriteHeader( 1 )) != XB_NO_ERROR ) return rc; #ifdef XB_LOCKING_ON if( AutoLock ) LockDatabase( F_SETLK, F_UNLCK, 0L ); #if defined(XB_INDEX_ANY) i = NdxList; while( i && AutoLock ){ i->index->LockIndex( F_SETLK, F_UNLCK ); i = i->NextIx; } #endif /* XB_INDEX_ANY */ #endif /* XB_LOCKING_ON */ DbfStatus = XB_OPEN; return XB_NO_ERROR; } /************************************************************************/ //! Get a record from the data file /*! This method attempts to retrieve the record specified by RecNo from the data file into the record buffer. \param RecNo Record number to retrieve \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_LOCK_FAILEDCouldn't lock file
XB_NOT_OPENFile is not open
XB_INVALID_RECORDInvalid record number
XB_WRITE_ERRORError writing to file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_LOCK\_FAILED & Couldn't lock file \\ \hline XB\_NOT\_OPEN & File is not open \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline XB\_WRITE\_ERROR & Error writing to file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::GetRecord( xbULong RecNo ) { /* 4/16/2000 - gk - made mods to record locking logic */ int rc; if( DbfStatus == XB_CLOSED ) xb_error(XB_NOT_OPEN); #ifndef XB_LOCKING_ON if( DbfStatus == XB_UPDATED /*&& AutoUpdate*/ ) /* update previous rec if necessary */ if(( rc = PutRecord( CurRec )) != 0 ) return rc; #endif #ifdef XB_LOCKING_ON if( AutoLock ) if(( rc = LockDatabase( F_SETLKW, F_RDLCK, RecNo )) != 0 ) return rc; if((rc = ReadHeader(1)) != XB_NO_ERROR) { if(AutoLock) LockDatabase( F_SETLK, F_UNLCK, RecNo ); return rc; } #endif if( RecNo > NoOfRecs || RecNo == 0L ) xb_error(XB_INVALID_RECORD); /* michael - modified code to avoid unecessary fseek work */ /* commented out this code because it doesn't work in DOS/Win environments */ // if( !CurRec || RecNo != CurRec+1 ) // { if( fseek( fp, (long) HeaderLen+((RecNo-1L)*RecordLen), SEEK_SET )) { #ifdef XB_LOCKING_ON LockDatabase( F_SETLK, F_UNLCK, RecNo ); #endif xb_error(XB_SEEK_ERROR); } // } if( fread( RecBuf, RecordLen, 1, fp ) != 1 ) { #ifdef XB_LOCKING_ON LockDatabase( F_SETLK, F_UNLCK, RecNo ); #endif xb_error(XB_READ_ERROR); } #ifdef XB_LOCKING_ON if( AutoLock ) LockDatabase( F_SETLKW, F_UNLCK, RecNo ); #endif DbfStatus = XB_OPEN; CurRec = RecNo; return XB_NO_ERROR; } /************************************************************************/ //! Get the first physical record in the data file /*! Attempts to retrieve the first physical record from the data file into the record buffer. \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_LOCK_FAILEDCouldn't lock file
XB_NOT_OPENFile is not open
XB_INVALID_RECORDInvalid record number
XB_SEEK_ERRORError seeking file
XB_WRITE_ERRORError writing to file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_LOCK\_FAILED & Couldn't lock file \\ \hline XB\_NOT\_OPEN & File is not open \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline XB\_SEEK\_ERROR & Error seeking file \\ \hline XB\_WRITE\_ERROR & Error writing to file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::GetFirstRecord( void ) { xbShort rc = 0; if( NoOfRecs == 0 ) xb_error(XB_INVALID_RECORD); #ifndef XB_LOCKING_ON if( DbfStatus == XB_UPDATED /*&& AutoUpdate*/ ) /* updatfe previous rec if necessary */ if(( rc = PutRecord( CurRec )) != 0 ) return rc; #endif rc = GetRecord( 1L ); #ifdef XB_REAL_DELETE if(!rc && RealDelete && RecordDeleted()) rc = GetNextRecord(); #endif return rc; } /************************************************************************/ //! Get the last phyiscal record in the data file /*! Attempts to retrieve the last physical record from the data file into the record buffer. \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_LOCK_FAILEDCouldn't lock file
XB_EOFAt end of file
XB_NOT_OPENFile is not open
XB_INVALID_RECORDInvalid record number
XB_SEEK_ERRORError seeking file
XB_WRITE_ERRORError writing to file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_LOCK\_FAILED & Couldn't lock file \\ \hline XB\_EOF & At end of file \\ \hline XB\_NOT\_OPEN & File is not open \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline XB\_SEEK\_ERROR & Error seeking file \\ \hline XB\_WRITE\_ERROR & Error writing to file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::GetLastRecord( void ) { xbShort rc = 0; if( NoOfRecs == 0 ) xb_error(XB_INVALID_RECORD); #ifndef XB_LOCKING_ON if( DbfStatus == XB_UPDATED /*&& AutoUpdate*/ ) /* update previous rec if necessary */ if(( rc = PutRecord( CurRec )) != 0 ) return rc; #endif rc = GetRecord( NoOfRecs ); #ifdef XB_REAL_DELETE if(!rc && RealDelete && RecordDeleted()) rc = GetPrevRecord(); #endif return rc; } /************************************************************************/ //! Get the next physical record in the data file /*! Attempts to retrieve the next physical record from the data file into the record buffer. \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_LOCK_FAILEDCouldn't lock file
XB_EOFAt end of file
XB_NOT_OPENFile is not open
XB_INVALID_RECORDInvalid record number
XB_SEEK_ERRORError seeking file
XB_WRITE_ERRORError writing to file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_LOCK\_FAILED & Couldn't lock file \\ \hline XB\_EOF & At end of file \\ \hline XB\_NOT\_OPEN & File is not open \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline XB\_SEEK\_ERROR & Error seeking file \\ \hline XB\_WRITE\_ERROR & Error writing to file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::GetNextRecord( void ) { xbShort rc = 0; if( NoOfRecs == 0 ) { xb_error(XB_INVALID_RECORD); } else if( CurRec >= NoOfRecs ) { xb_eof_error; } #ifndef XB_LOCKING_ON if( DbfStatus == XB_UPDATED /*&& AutoUpdate*/ ) /* update previous rec if necessary */ if(( rc = PutRecord( CurRec )) != 0 ) return rc; #endif rc = GetRecord( ++CurRec ); #ifdef XB_REAL_DELETE while(!rc && RealDelete && RecordDeleted()) rc = GetRecord(++CurRec); #endif return rc; } /************************************************************************/ //! Get the previous physical record in the data file /*! Attempts to retrieve the previous physical record from the data file into the record buffer. \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_LOCK_FAILEDCouldn't lock file
XB_BOFAt beginning of file
XB_NOT_OPENFile is not open
XB_INVALID_RECORDInvalid record number
XB_SEEK_ERRORError seeking file
XB_WRITE_ERRORError writing to file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_LOCK\_FAILED & Couldn't lock file \\ \hline XB\_BOF & At beginning of file \\ \hline XB\_NOT\_OPEN & File is not open \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline XB\_SEEK\_ERROR & Error seeking file \\ \hline XB\_WRITE\_ERROR & Error writing to file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::GetPrevRecord( void ) { xbShort rc = 0; if( NoOfRecs == 0 ) { xb_error(XB_INVALID_RECORD); } else if( CurRec <= 1L ) { xb_eof_error; } #if XB_LOCKING_ON if( DbfStatus == XB_UPDATED /*&& AutoUpdate*/ ) /* update previous rec if necessary */ if(( rc = PutRecord( CurRec )) != 0 ) return rc; #endif rc = GetRecord( --CurRec ); #ifdef XB_REAL_DELETE while(!rc && RealDelete && RecordDeleted()) rc = GetRecord(--CurRec); #endif return rc; } /************************************************************************/ //! Dump record /*! Dump the contents of the specified record to stdout. \param RecNo Record number of record to be dumped. \returns An error code (same as GetRecord()). */ xbShort xbDbf::DumpRecord( xbULong RecNo ) { int i; char buf[1024]; if( RecNo == 0 || RecNo > NoOfRecs ) xb_error(XB_INVALID_RECORD); i = GetRecord( RecNo ); if( i != XB_NO_ERROR ) return i; cout << "\nREC NUMBER " << RecNo << "\n"; if( RecordDeleted() ) cout << "\nRecord deleted...\n"; for( i = 0; i < NoOfFields; i++ ) { GetField( i, buf ); cout << SchemaPtr[i].FieldName << " = '" << buf << "'\n"; } cout << "\n"; return XB_NO_ERROR; } /************************************************************************/ //! Write the current record buffer to the current record in the data file. /*! Attempts to write the contents of the record buffer to the current record in the data file. Updates any open indexes. \sa PutRecord(xbULong RecNo) \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_LOCK_FAILEDCouldn't lock file
XB_NOT_OPENFile is not open
XB_INVALID_RECORDInvalid record number
XB_SEEK_ERRORError seeking file
XB_WRITE_ERRORError writing to file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_LOCK\_FAILED & Couldn't lock file \\ \hline XB\_NOT\_OPEN & File is not open \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline XB\_SEEK\_ERROR & Error seeking file \\ \hline XB\_WRITE\_ERROR & Error writing to file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::PutRecord(void) { return PutRecord(CurRec); } //! Write the current record buffer to the specified record in the data file. /*! Attempts to write the contents of the record buffer to the record specified by RecNo. Updates any open indexes. \param RecNo Record number to which data should be written \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_LOCK_FAILEDCouldn't lock file
XB_NOT_OPENFile is not open
XB_INVALID_RECORDInvalid record number
XB_SEEK_ERRORError seeking file
XB_WRITE_ERRORError writing to file
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_LOCK\_FAILED & Couldn't lock file \\ \hline XB\_NOT\_OPEN & File is not open \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline XB\_SEEK\_ERROR & Error seeking file \\ \hline XB\_WRITE\_ERROR & Error writing to file \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::PutRecord(xbULong RecNo) { xbShort rc; //fprintf(stderr, "PutRecord Start\n"); #if defined(XB_INDEX_ANY) xbIxList *i; #endif if( DbfStatus == XB_CLOSED ) xb_error(XB_NOT_OPEN); /* lock the database */ #ifdef XB_LOCKING_ON if( AutoLock ) { if(( rc = LockDatabase( F_SETLKW, F_WRLCK, RecNo )) != XB_NO_ERROR ) { fprintf(stderr, "%s", DatabaseName.getData()); perror("failed record lock"); return rc; } if(( rc = LockDatabase( F_SETLKW, F_WRLCK, 0L )) != XB_NO_ERROR ) { fprintf(stderr, "%s", DatabaseName.getData()); perror("failed file lock"); LockDatabase( F_SETLK, F_UNLCK, RecNo ); return rc; } if((rc = ReadHeader(1)) != XB_NO_ERROR) { if(AutoLock) { LockDatabase( F_SETLK, F_UNLCK, RecNo ); LockDatabase( F_SETLK, F_UNLCK, 0L ); } return rc; } } #endif if( RecNo > NoOfRecs || RecNo == 0L ) xb_error(XB_INVALID_RECORD); /* lock the indexes */ #if defined(XB_INDEX_ANY) #ifdef XB_LOCKING_ON i = NdxList; while( i && AutoLock ) { if(( rc = i->index->LockIndex( F_SETLKW, F_WRLCK )) != XB_NO_ERROR ) { fprintf(stderr, "%s", DatabaseName.getData()); perror("failed index lock"); return rc; } i = i->NextIx; } #endif /* XB_LOCKING_ON */ #endif #if defined(XB_INDEX_ANY) /* for any unique indexes that were updated, verify no unique keys exist */ i = NdxList; while( i ) { if( i->index->UniqueIndex() ) { if(( i->KeyUpdated = i->index->KeyWasChanged()) == 1 ) if( i->index->FindKey() == XB_FOUND ) xb_error(XB_KEY_NOT_UNIQUE); } i = i->NextIx; } #endif #if defined(XB_INDEX_ANY) /* loop through deleting old index keys and adding new index keys */ i = NdxList; while( i ) { if( !i->index->UniqueIndex() ) i->KeyUpdated = i->index->KeyWasChanged(); if( i->KeyUpdated ) { i->index->CreateKey( 1, 0 ); /* load key buf w/ old values */ if((rc = i->index->DeleteKey( CurRec )) != XB_NO_ERROR) { #ifdef XB_LOCKING_ON if( AutoLock ) { LockDatabase( F_SETLK, F_UNLCK, RecNo ); LockDatabase( F_SETLK, F_UNLCK, 0L ); } #if defined(XB_INDEX_ANY) i = NdxList; while( i && AutoLock ) { i->index->LockIndex( F_SETLK, F_UNLCK ); i = i->NextIx; } #endif /* XB_INDEX_ANY */ #endif /* XB_LOCKING_ON */ return rc; } i->index->CreateKey( 0, 0 ); if(( rc = i->index->AddKey(CurRec)) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON if( AutoLock ) { LockDatabase( F_SETLK, F_UNLCK, RecNo ); LockDatabase( F_SETLK, F_UNLCK, 0L ); } #if defined(XB_INDEX_ANY) i = NdxList; while( i && AutoLock ) { i->index->LockIndex( F_SETLK, F_UNLCK ); i = i->NextIx; } #endif /* XB_INDEX_ANY */ #endif /* XB_LOCKING_ON */ return rc; } i->index->TouchIndex(); } i = i->NextIx; } #endif /* XB_INDEX_ANY */ if( fseek( fp, (long) HeaderLen+((RecNo-1L)*RecordLen),0 )) xb_error(XB_SEEK_ERROR); if( fwrite( RecBuf, RecordLen, 1, fp ) != 1 ) xb_error(XB_WRITE_ERROR); #ifdef XB_LOCKING_ON if( AutoLock ) { rc = LockDatabase( F_SETLK, F_UNLCK, RecNo ); if(rc) { fprintf(stderr, "%s", DatabaseName.getData()); perror("failed record unlock"); } rc = LockDatabase( F_SETLK, F_UNLCK, 0L ); if(rc) { fprintf(stderr, "%s", DatabaseName.getData()); perror("failed file unlock"); } } #if defined(XB_INDEX_ANY) i = NdxList; while( i && AutoLock ) { i->index->LockIndex( F_SETLK, F_UNLCK ); i = i->NextIx; } #endif /* XB_INDEX_ANY */ #endif /* XB_LOCKING_ON */ //fprintf(stderr, "PutRecord End\n"); CurRec = RecNo; DbfStatus = XB_OPEN; return XB_NO_ERROR; } /************************************************************************/ //! Delete the current record /*! Marks the current record as deleted or if "real" deletes are turned on (xbDbf::RealDeleteOn()) will delete the record and add it to the free record list. Normal dBase behavior is to simply mark the record as deleted; the record will actually be deleted when the the DBF file "packed" (xbDbf::PackDatabase()). If "real" deletes are not on, a record may be undeleted using xbDbf::UndeleteRecord(). \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_INVALID_RECORDInvalid record number
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::DeleteRecord( void ) { xbULong newCurRec = 0; xbShort rc = XB_NO_ERROR; #if defined(XB_INDEX_ANY) xbIxList *i; #endif if(!RecBuf) xb_error(XB_INVALID_RECORD); if(CurRec < 1 || CurRec > NoOfRecs) xb_error(XB_INVALID_RECORD); /* lock the database */ #ifdef XB_LOCKING_ON if( AutoLock ) { if(( rc = LockDatabase( F_SETLKW, F_WRLCK, CurRec )) != XB_NO_ERROR ) { return rc; } if(( rc = LockDatabase( F_SETLKW, F_WRLCK, 0L )) != XB_NO_ERROR ) { LockDatabase( F_SETLK, F_UNLCK, CurRec ); return rc; } if((rc = ReadHeader(1)) != XB_NO_ERROR) { if(AutoLock) { LockDatabase( F_SETLK, F_UNLCK, CurRec ); LockDatabase( F_SETLK, F_UNLCK, 0L ); } return rc; } } #endif /* lock the indexes */ #if defined(XB_INDEX_ANY) && defined(XB_LOCKING_ON) && defined(XB_REAL_DELETE) i = NdxList; while( i && AutoLock ) { if(( rc = i->index->LockIndex( F_SETLKW, F_WRLCK )) != XB_NO_ERROR ) return rc; i = i->NextIx; } #endif /* remove keys from indexes */ #if defined(XB_REAL_DELETE) && defined(XB_INDEX_ANY) if(RealDelete) { i = NdxList; while(i) { i->index->CreateKey(0, 0); /* load key buf */ if(i->index->GetCurDbfRec() == (xbLong)CurRec) { i->index->DeleteKey(CurRec); newCurRec = i->index->GetCurDbfRec(); } else i->index->DeleteKey(CurRec); i->index->TouchIndex(); i = i->NextIx; } } #endif RecBuf[0] = 0x2a; #ifdef XB_REAL_DELETE //fprintf(stderr, "DeleteRecord() -> RealDelete = %d\n", RealDelete); if(RealDelete) { xbase->PutULong(&RecBuf[1], FirstFreeRec); FirstFreeRec = CurRec; RealNumRecs--; WriteHeader(1); } #endif if(!RealDelete) { if( DbfStatus != XB_UPDATED ) { DbfStatus = XB_UPDATED; memcpy( RecBuf2, RecBuf, RecordLen ); } rc = PutRecord( CurRec ); } else { if(fseek( fp, (long) HeaderLen + ((CurRec - 1L) * RecordLen), 0)) xb_error(XB_SEEK_ERROR); if(fwrite( RecBuf, RecordLen, 1, fp ) != 1 ) xb_error(XB_WRITE_ERROR); // // Attempt to read in the record for the current location // in the active index. // CurRec = newCurRec; if(CurRec) rc = GetRecord(CurRec); else BlankRecord(); } #ifdef XB_LOCKING_ON if(AutoLock) { LockDatabase( F_SETLK, F_UNLCK, CurRec ); LockDatabase( F_SETLK, F_UNLCK, 0L ); } #if defined(XB_INDEX_ANY) && defined(XB_REAL_DELETE) i = NdxList; while( i && AutoLock ) { i->index->LockIndex( F_SETLK, F_UNLCK ); i = i->NextIx; } #endif /* XB_INDEX_ANY */ #endif /* XB_LOCKING_ON */ return rc; } /************************************************************************/ //! Undelete the current record /*! Marks the currect record as not deleted (i.e. removes the flag indicating the record is deleted). This method may not be used (and will return an error code) if "real" deletes are on. \returns One of the following: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_INVALID_RECORDInvalid record number
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No error \\ \hline XB\_INVALID\_RECORD & Invalid record number \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::UndeleteRecord( void ) { xbShort rc; #ifdef XB_REAL_DELETE if(RealDelete) xb_error(XB_INVALID_RECORD); #endif if( RecBuf ) { if( DbfStatus != XB_UPDATED ) { DbfStatus = XB_UPDATED; memcpy( RecBuf2, RecBuf, RecordLen ); } RecBuf[0] = 0x20; if(( rc = PutRecord( CurRec )) != 0 ) return rc; } else xb_error(XB_INVALID_RECORD); return 0; } /************************************************************************/ //! Determine if current record is deleted /*! \returns TRUE (1) if the current record is marked as deleted or FALSE (0) if not. */ xbShort xbDbf::RecordDeleted( void ) { if( RecBuf && RecBuf[0] == 0x2a ) return 1; else return 0; } /************************************************************************/ //! Pack data file /*! */ xbShort xbDbf::PackDatafiles(void (*statusFunc)(xbLong itemNum, xbLong numItems)) { xbShort rc = 0, i, NameLen; FILE *t; xbLong l; char *target, *source; xbString TempDbfName; char * Buf = 0; #ifdef XB_MEMO_FIELDS char tbuf[4]; #endif #ifdef XB_MEMO_FIELDS xbLong len, BufSize; xbString TempDbtName; xbShort MemoFields; #endif /* XB_MEMO_FIELDS */ xbDbf Temp( xbase ); if(( rc = xbase->DirectoryExistsInName( DatabaseName )) > 0 ) NameLen = rc + 13; else NameLen = 13; if (rc) { TempDbfName.assign(DatabaseName, 0, rc); TempDbfName += "TMPXBASE.DBF"; } else TempDbfName = "TMPXBASE.DBF"; if (( t = fopen( TempDbfName, "w+b" )) == NULL ) xb_open_error(TempDbfName); /* copy file header */ if(( rc = fseek( fp, 0, SEEK_SET )) != 0 ) xb_io_error(XB_SEEK_ERROR, TempDbfName); for( i = 0; i < HeaderLen; i++ ) fputc( fgetc( fp ), t ); fputc( 0x1a, t ); if( fclose( t ) != 0 ) xb_io_error(XB_CLOSE_ERROR, TempDbfName); #ifdef XB_MEMO_FIELDS if(( MemoFields = MemoFieldsPresent()) > 0 ) { TempDbtName = TempDbfName; TempDbtName.putAt(TempDbtName.len()-1, 'T'); if ((t = fopen( TempDbtName, "w+b" )) == NULL) xb_open_error(TempDbtName); l = 1L; memset( tbuf, 0x00, 4 ); xbase->PutLong( tbuf, l ); if ((fwrite(&tbuf, 4, 1, t)) != 1) xb_io_error(XB_WRITE_ERROR, TempDbfName); if( MemoHeader.Version == 0x03 ) { for( i = 0; i < 12; i++ ) fputc( 0x00, t ); fputc( 0x03, t ); for( i = 0; i < 495; i++ ) fputc( 0x00, t ); } else { for( i = 0; i < 4; i++ ) fputc( 0x00, t ); if ((fwrite(&MemoHeader.FileName, 8, 1, t)) != 1) xb_io_error(XB_WRITE_ERROR, TempDbfName); for( i = 0; i < 4; i++ ) fputc( 0x00, t ); memset( tbuf, 0x00, 2 ); xbase->PutShort( tbuf, MemoHeader.BlockSize ); if ((fwrite(&tbuf, 2, 1, t)) != 1) xb_io_error(XB_WRITE_ERROR, TempDbfName); for( i = 22; i < MemoHeader.BlockSize; i++ ) fputc( 0x00, t ); } if( fclose( t ) != 0 ) xb_io_error(XB_CLOSE_ERROR, TempDbfName); } #endif /* XB_MEMO_FIELDS */ /* reopen as database */ if(( rc = Temp.OpenDatabase( TempDbfName )) != XB_NO_ERROR ) return rc; Temp.ResetNoOfRecs(); Temp.WriteHeader(2); // flush NoOfRecs=0 to disk target = Temp.GetRecordBuf(); source = GetRecordBuf(); for( l = 1; l <= NoOfRecords(); l++ ) { if(statusFunc && (l == 1 || !(l % 100) || l == PhysicalNoOfRecords())) statusFunc(l, PhysicalNoOfRecords()); if(( rc = GetRecord( l )) != XB_NO_ERROR ) return rc; if( !RecordDeleted()) { strncpy( target, source, GetRecordLen()); #ifdef XB_MEMO_FIELDS len = BufSize = 0L; Buf = NULL; for( i = 0; i < NoOfFields; i++ ) { if( GetFieldType( i ) == 'M' && MemoFieldExists( i )) { len = GetMemoFieldLen( i ); if( len > BufSize ) { if( BufSize ) free( Buf ); if ((Buf = (char *)malloc(len)) == NULL) xb_memory_error; BufSize = len; } GetMemoField( i, len, Buf, -1 ); Temp.UpdateMemoData( i, len, Buf, -1 ); } } #endif if(( rc = Temp.AppendRecord()) != XB_NO_ERROR ) { if(Buf) free(Buf); return rc; } } } if( Buf ) free( Buf ); Temp.CloseDatabase(); if (fclose(fp) != 0) xb_io_error(XB_CLOSE_ERROR, DatabaseName); if(remove(DatabaseName) != 0) xb_io_error(XB_WRITE_ERROR, DatabaseName); if(rename(TempDbfName, DatabaseName) != 0) xb_io_error(XB_WRITE_ERROR, TempDbfName); #ifdef XB_MEMO_FIELDS if( MemoFields ) { // len = DatabaseName.len(); // len--; // lb = DatabaseName[len]; int len = DatabaseName.len() - 1; char lb = DatabaseName[len]; if( lb == 'F' ) DatabaseName.putAt(len, 'T'); else DatabaseName.putAt(len, 't'); if(fclose(mfp) != 0) /* thanks Jourquin */ xb_io_error(XB_CLOSE_ERROR, TempDbtName); if (remove(DatabaseName) != 0) { DatabaseName.putAt(len, lb); xb_io_error(XB_WRITE_ERROR, DatabaseName); } if( rename( TempDbtName, DatabaseName ) != 0 ) { DatabaseName.putAt(len, lb); xb_io_error(XB_WRITE_ERROR, DatabaseName); } if(( mfp = fopen( DatabaseName, "r+b" )) == NULL ) xb_open_error(DatabaseName); #ifdef XB_LOCKING_ON /* no buffering in multi user mode */ setbuf( mfp, NULL ); #endif DatabaseName.putAt(len, lb); } #endif /* XB_MEMO_FIELDS */ if(( fp = fopen( DatabaseName, "r+b" )) == NULL ) xb_open_error(DatabaseName); #ifdef XB_LOCKING_ON /* no buffering in multi user mode */ setbuf( fp, NULL ); #endif return XB_NO_ERROR; } /************************************************************************/ //! Pack the database /*! This method removes all records marked for deletion from an Xbase (.DBF) file, reindexes any open index files, and also reorganizes any memo fields stored in a .DBT memo file. \param LockWaitOption One of the following: \htmlonly

LockWaitOptionDescription
F_SETLKReturn immediately if the DBF file cannot be locked
F_SETLKWWait for lock on DBF file to succeed
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{LockWaitOption} & \textbf{Description} \\ \hline \hline F\_SETLK & Return immediately if DBF file cannot be locked \\ \hline F\_SETLKW & Wait for lock on DBF file to succeed \\ \hline \end{tabular} \endlatexonly \returns One of the following return codes: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_CLOSE_ERRORUnable to close intermediate work file
XB_OPEN_ERRORCould not open file
XB_NO_MEMORYMemory allocation error
XB_WRITE_ERRORCouldn't write to disk
XB_SEEK_ERRORError seeking file
XB_LOCK_FAILEDUnable to lock file or index
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No Error \\ \hline XB\_CLOSE\_ERROR & Unable to close intermediate work file \\ \hline XB\_OPEN\_ERROR & Couldn't open the file \\ \hline XB\_NO\_MEMORY & Memory allocation error \\ \hline XB\_WRITE\_ERROR & Couldn't write to disk \\ \hline XB\_SEEK\_ERROR & Error seeking file \\ \hline XB\_LOCK\_FAILED & Unable to lock file or index \\ \hline \end{tabular} \endlatexonly */ xbShort xbDbf::PackDatabase(xbShort LockWaitOption, void (*packStatusFunc)(xbLong itemNum, xbLong numItems), void (*indexStatusFunc)(xbLong itemNum, xbLong numItems)) { xbShort rc = 0; /* lock all open files and indexes */ if(( rc = ExclusiveLock( LockWaitOption )) != XB_NO_ERROR ) return rc; if(( rc = PackDatafiles(packStatusFunc)) != XB_NO_ERROR ) { ExclusiveUnlock(); return rc; } /* refresh file header */ if(( rc = ReadHeader(1)) != XB_NO_ERROR ) return rc; if(( rc = RebuildAllIndices(indexStatusFunc)) != XB_NO_ERROR ) return rc; ExclusiveUnlock(); return XB_NO_ERROR; } /************************************************************************/ //! Copy DBF structure /*! */ xbShort xbDbf::CopyDbfStructure(const char *NewFileName, xbShort Overlay) { xbShort rc, i; xbString ndfn; /* new dbf file name */ char ch; #ifdef XB_MEMO_FIELDS char buf[9]; xbShort ct, NameLen; xbString MemoName; #endif FILE *t; /* build the new file name */ rc = NameSuffixMissing( 1, NewFileName ); ndfn = NewFileName; if( rc == 1 ) ndfn += ".dbf"; else if( rc == 2 ) ndfn += ".DBF"; /* check if the file exists and Overlay is on */ if (((t = fopen( ndfn, "r" )) != NULL ) && !Overlay) { fclose(t); xb_io_error(XB_FILE_EXISTS, ndfn); } /* open new file */ if ((t = fopen(ndfn, "w+b")) == NULL) xb_open_error(ndfn); /* copy the file header */ if (( rc = fseek( fp, 0, SEEK_SET )) != 0 ) xb_io_error(XB_SEEK_ERROR, ndfn); fputc( fgetc( fp ), t ); /* do the date */ xbDate d; ch = d.YearOf() - 1900; if(XFV == 3) ch %= 100; // dBASE III+ does this, dBASE IV does not. fputc( ch, t ); ch = d.MonthOf(); fputc( ch, t ); ch = d.DayOf( XB_FMT_MONTH ); fputc( ch, t ); /* record count */ for( i = 0; i < 4; i++ ) fputc( 0x00, t ); if((rc = fseek(fp, 7L, SEEK_CUR)) != 0) { fclose( t ); xb_io_error(XB_SEEK_ERROR, DatabaseName); } for( i = 0; i < 4; i++ ) fputc( fgetc( fp ), t ); for( i = 0; i < 17; i++ ) fputc( 0x00, t ); if ((rc = fseek( fp, 17L, SEEK_CUR )) != 0) { fclose( t ); xb_io_error(XB_SEEK_ERROR, DatabaseName); } for ( i = 29; i < HeaderLen; i++ ) fputc( fgetc( fp ), t ); fputc( 0x1a, t ); fclose( t ); #ifdef XB_MEMO_FIELDS if( MemoFieldsPresent()) { MemoName = ndfn; NameLen = MemoName.len(); NameLen--; if( MemoName.getCharacter( NameLen ) == 'F' ) MemoName.putAt(NameLen, 'T'); else MemoName.putAt(NameLen, 't'); if(( t = fopen( MemoName, "w+b" )) == NULL ) xb_open_error(MemoName); memset( buf, 0x00, 4 ); xbase->PutLong( buf, 1L ); if(( fwrite( &buf, 4, 1, t )) != 1 ) { fclose( t ); xb_io_error(XB_WRITE_ERROR, ndfn); } if( MemoHeader.Version == 0x03 ) { for( i = 0; i < 12; i++ ) fputc( 0x00, t ); fputc( 0x03, t ); for( i = 0; i < 495; i++ ) fputc( 0x00, t ); } else { for( i = 0; i < 4; i++ ) fputc( 0x00, t ); // put 4 bytes 0x00 memset( buf, 0x00, 9 ); NameLen = ndfn.len(); for( i = 0, ct = 0; i < NameLen; i++ ) if( ndfn.getCharacter( i ) == PATH_SEPARATOR ) { ct = i; ct++; } for( i = 0; i < 8 && ndfn[i+ct] != '.'; i++ ) buf[i] = ndfn[i+ct]; fwrite( &buf, 8, 1, t ); for( i = 0; i < 4; i++ ) fputc( 0x00, t ); memset( buf, 0x00, 2 ); xbase->PutShort( buf, MemoHeader.BlockSize ); if(( fwrite( &buf, 2, 1, t )) != 1 ) { fclose(t); xb_io_error(XB_WRITE_ERROR, ndfn); } for( i = 22; i < MemoHeader.BlockSize; i++ ) fputc( 0x00, t ); } } fclose( t ); #endif // XB_MEMO_FIELDS return XB_NO_ERROR; } /************************************************************************/ //! Add index to list /*! Adds the specified index to the list of indexes maintained by the dbf. \param n index to add \param IndexName name of index */ #if defined(XB_INDEX_ANY) xbShort xbDbf::AddIndexToIxList(xbIndex * n, const char *IndexName) { xbIxList *i, *s, *t; if( !FreeIxList ){ if((i = (xbIxList *) malloc(sizeof(xbIxList))) == NULL) { xb_memory_error; } } else { i = FreeIxList; FreeIxList = i->NextIx; } memset(i, 0x00, sizeof(xbIxList)); i->IxName = IndexName; i->index = n; s = NULL; t = NdxList; while( t && strcmp( t->IxName, IndexName ) < 0 ) { s = t; t = t->NextIx; } i->NextIx = t; if( s == NULL ) NdxList = i; else s->NextIx = i; return 0; } #endif /************************************************************************/ //! Rebuild all index files /*! */ xbShort xbDbf::RebuildAllIndices(void (*statusFunc)(xbLong itemNum, xbLong numItems)) { #if defined(XB_INDEX_ANY) xbShort rc = 0; xbIxList *n; n = NdxList; while( n ) { if(( rc = n->index->ReIndex(statusFunc)) != XB_NO_ERROR ) { ExclusiveUnlock(); return rc; } n = n->NextIx; } #endif return XB_NO_ERROR; } /************************************************************************/ //! Delete all records /*! */ xbShort xbDbf::DeleteAll( xbShort Option ) { xbShort rc = 0; if(( NoOfRecords()) == 0 ) return XB_NO_ERROR; if(( rc = GetFirstRecord()) != XB_NO_ERROR ) return rc; if( Option == 0 ) /* delete all option */ { while( 1 ){ if( !RecordDeleted()) if(( rc = DeleteRecord()) != XB_NO_ERROR ) return rc; if(( rc = GetNextRecord()) != XB_NO_ERROR ) break; } } else /* undelete all option */ { while( 1 ) { if( RecordDeleted()) if(( rc = UndeleteRecord()) != XB_NO_ERROR ) return rc; #ifdef HAVE_EXCEPTIONS try { #endif if(( rc = GetNextRecord()) != XB_NO_ERROR ) break; #ifdef HAVE_EXCEPTIONS } catch (xbEoFException &) { return XB_NO_ERROR; } #endif } } if( rc == XB_EOF ) return XB_NO_ERROR; else return rc; } /************************************************************************/ //! Delete all records and pack data file /*! */ xbShort xbDbf::Zap( xbShort WaitOption ) { #ifdef XB_MEMO_FIELDS xbShort MemosExist; #endif xbShort NameLen, rc; xbString TempDbfName; if(( rc = xbase->DirectoryExistsInName( DatabaseName )) > 0 ) NameLen = rc + 13; else NameLen = 13; if (rc) { TempDbfName.assign(DatabaseName, 0, rc); TempDbfName += "TMPXBASE.DBF"; } else TempDbfName = "TMPXBASE.DBF"; if(( rc = CopyDbfStructure( TempDbfName, 1 )) != XB_NO_ERROR) { return rc; } #ifdef XB_MEMO_FIELDS MemosExist = MemoFieldsPresent(); #endif if (( rc = ExclusiveLock( WaitOption )) != XB_NO_ERROR ) return rc; if (( rc = remove( DatabaseName )) != 0 ) { ExclusiveUnlock(); xb_io_error(XB_WRITE_ERROR, DatabaseName); } if (( rc = rename( TempDbfName, DatabaseName )) != 0 ) { ExclusiveUnlock(); xb_io_error(XB_WRITE_ERROR, DatabaseName); } if((fp = fopen( DatabaseName, "r+b" )) == NULL) { ExclusiveUnlock(); xb_open_error(DatabaseName); } #ifdef XB_LOCKING_ON setbuf( fp, NULL ); #endif ReadHeader( 1 ); #ifdef XB_MEMO_FIELDS if( MemosExist ) { fclose( mfp ); int dbnlen = DatabaseName.len() - 1; char lb = DatabaseName[dbnlen]; if( lb == 'F' ) { DatabaseName.putAt(dbnlen, 'T'); TempDbfName.putAt(dbnlen, 'T'); } else { DatabaseName.putAt(dbnlen, 't'); TempDbfName.putAt(dbnlen, 't'); } if(( rc = remove( DatabaseName )) != 0 ) { ExclusiveUnlock(); xb_open_error(DatabaseName); } if(( rc = rename( TempDbfName, DatabaseName )) != 0 ) { ExclusiveUnlock(); xb_open_error(DatabaseName); } if(( mfp = fopen( DatabaseName, "r+b" )) == NULL ){ ExclusiveUnlock(); xb_open_error(DatabaseName); } #ifdef XB_LOCKING_ON setbuf( mfp, NULL ); #endif GetDbtHeader(1); DatabaseName.putAt(dbnlen, lb); } #endif // XB_MEMO_FIELDS if(( rc = RebuildAllIndices()) != XB_NO_ERROR ) { ExclusiveUnlock(); return rc; } ExclusiveUnlock(); return XB_NO_ERROR; } /************************************************************************/ //! Remove an index from the list /*! */ #if defined(XB_INDEX_ANY) xbShort xbDbf::RemoveIndexFromIxList(xbIndex * n) { xbIxList *i, *s; i = NdxList; s = NULL; while( i ) { if( i->index == n ) { /* remove it from current chain */ if( s ) s->NextIx = i->NextIx; else NdxList = i->NextIx; /* add i to the current free chain */ i->NextIx = FreeIxList; FreeIxList = i; FreeIxList->IxName = (const char *)NULL; FreeIxList->index = NULL; break; } else { s = i; i = i->NextIx; } } return XB_NO_ERROR; } #endif /************************************************************************/ //! Gets the number of records in the data file /*! */ xbLong xbDbf::NoOfRecords(void) { xbLong numRecs = 0; /* lock the database */ #ifdef XB_LOCKING_ON xbShort rc; if( AutoLock ) { if(( rc = LockDatabase( F_SETLKW, F_RDLCK, 0L )) != XB_NO_ERROR ) { return 0; } if((rc = ReadHeader(1)) != XB_NO_ERROR) { if(AutoLock) { LockDatabase( F_SETLK, F_UNLCK, 0L ); } return 0; } } #endif #ifndef XB_REAL_DELETE numRecs = NoOfRecs; #else numRecs = RealDelete ? RealNumRecs : NoOfRecs; #endif #ifdef XB_LOCKING_ON if(AutoLock) { LockDatabase( F_SETLK, F_UNLCK, 0L ); } #endif return numRecs; } /************************************************************************/ //! Get the physical number of records in the data file /*! */ xbLong xbDbf::PhysicalNoOfRecords(void) { xbLong numRecs = 0; /* lock the database */ #ifdef XB_LOCKING_ON xbShort rc; if( AutoLock ) { if(( rc = LockDatabase( F_SETLKW, F_RDLCK, 0L )) != XB_NO_ERROR ) { return 0; } if((rc = ReadHeader(1)) != XB_NO_ERROR) { if(AutoLock) { LockDatabase( F_SETLK, F_UNLCK, 0L ); } return 0; } } #endif numRecs = NoOfRecs; #ifdef XB_LOCKING_ON if(AutoLock) { LockDatabase( F_SETLK, F_UNLCK, 0L ); } #endif return numRecs; } #if defined(XB_INDEX_ANY) //! Get the number of currently open indexes for data file /*! */ xbShort xbDbf::IndexCount(void) { xbShort count; xbIxList *i; for(count = 0, i = NdxList; i; i = i->NextIx, count++) ; return count; } //! Get a specific index /*! */ xbIndex * xbDbf::GetIndex(xbShort indexNum) { xbIxList *i; i = NdxList; while(indexNum && i) { indexNum--; i = i->NextIx; } if(i) return i->index; return 0; } #endif // XB_INDEX_ANY xbase-2.0.0/xbase/exp.cpp0000644000000000000000000006730407203043261010653 /* $Id: exp.cpp,v 1.9 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains logic for handling Xbase expressions. Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.1 5/25/98 - Enhanced expression support V 1.8.0a 1/27/99 - Release v1.8 upgrade */ #ifdef __GNUG__ #pragma implementation "exp.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #ifdef XB_EXPRESSIONS #include #include #include /*! \file exp.cpp */ // set the default date format xbString xbExpn::DefaultDateFormat = "MM/DD/YY"; /************************************************************************/ /* putting this part in EXP did not work */ static xbFuncDtl FuncList[] = { /* Func # of Return Name parms Type */ { "ABS", 1, 'N' }, { "ASC", 1, 'N' }, { "AT", 2, 'N' }, { "CDOW", 1, 'C' }, { "CHR", 1, 'C' }, { "CMONTH", 1, 'C' }, { "DATE", 0, 'C' }, { "DAY", 1, 'N' }, { "DESCEND", 1, 'C' }, { "DOW", 1, 'N' }, { "DTOC", 1, 'C' }, { "DTOS", 1, 'C' }, { "EXP", 1, 'N' }, { "IIF", 3, 'C' }, { "INT", 1, 'N' }, { "ISALPHA", 1, 'L' }, { "ISLOWER", 1, 'L' }, { "ISUPPER", 1, 'L' }, { "LEFT", 2, 'C' }, { "LEN", 1, 'N' }, { "LOG", 1, 'N' }, { "LOWER", 1, 'C' }, { "LTRIM", 1, 'C' }, { "MAX", 2, 'N' }, { "MIN", 2, 'N' }, { "MONTH", 1, 'N' }, { "RECNO", 0, 'N' }, { "REPLICATE", 2, 'C' }, { "RIGHT", 2, 'C' }, { "RTRIM", 1, 'C' }, { "SPACE", 1, 'C' }, { "SQRT", 1, 'N' }, { "STR", 1, 'C' }, { "STRZERO", 1, 'C' }, { "SUBSTR", 3, 'C' }, { "TRIM", 1, 'C' }, { "UPPER", 1, 'C' }, { "VAL", 1, 'N' }, { "YEAR", 1, 'N' }, { 0, 0, 0 }, }; /*************************************************************************/ //! Constructor /*! */ xbExpn::xbExpn( void ) { TokenType = 0x00; Tree = NULL; TokenLen = 0; OpLen1 = 0; OpLen2 = 0; OpDataLen1 = 0; OpDataLen2 = 0; Op1 = NULL; Op2 = NULL; XbaseFuncList = FuncList; memset( WorkBuf, 0x00, WorkBufMaxLen+1 ); } /*************************************************************************/ //! Get information on a function. /*! Returns the information specifed (Option) for the specified function. \param Function name of function to get information about \param Option One of the following: \htmlonly

OptionDescription
1Return minimum number of parms
2Return function result type
?Return 0 if valid function
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Option} & \textbf{Description} \\ \hline \hline 1 & Return minimum number of parms \\ \hline 2 & Return function result type \\ \hline ? & Return 0 if valid function \\ \hline \end{tabular} \endlatexonly \returns requested information or -1 on failure. */ xbShort xbExpn::GetFuncInfo( const char * Function, xbShort Option ) { /* Option = 1 - return minimum number of needed parms 2 - return function result type ? - return 0 if valid function */ xbFuncDtl * f; xbShort i, len; const char *s; if(( Option<1 )||( Option>2 )) xb_error( XB_INVALID_OPTION ); s = Function; len = 0; while( *s && *s != '(' ) { s++; len++; } f = XbaseFuncList; i = 0; while( f[i].FuncName ){ if( strncmp( f[i].FuncName, Function, len ) == 0 ) return( (Option==1) ? f[i].ParmCnt : f[i].ReturnType ); i++; } return -1; } /*************************************************************************/ //! IsWhiteSpace /*! */ xbShort xbExpn::IsWhiteSpace( char c ) { return(( c == 0x20 )? 1 : 0 ); } /*************************************************************************/ //! GetNextToken /*! */ xbShort xbExpn::GetNextToken( const char * s, xbShort MaxLen ) { /* TreeResultType Settings Token Action/ Was Type Result Unv N N Unv C C Unv Function Table Lookup Unv Field Field Type Not L Any Logical L */ xbShort Wctr, Wtype, Wsw, EmptyCtr, MaxCtr, MaxCtrSave; const char *sp, *np, *pp; /* save, next and previous pointer */ LogicalType = 0; TokenType = 0; TokenLen = 0; EmptyCtr = 0; MaxCtr = 0; if( !s || ! *s ) xb_error(XB_NO_DATA); /* go past any initial white space */ while( s && *s && IsWhiteSpace( *s )){ s++; MaxCtr++; if (MaxCtr >= MaxLen) return XB_NO_ERROR; } /* 1 check for parens */ /* '(', if found go to corresponding ')', if no ')', return -1 */ if( *s == '(' || *s == '{' ) { if( *s == '{' ) Wtype = 0; else Wtype = 1; Wctr = 1; s++; MaxCtr++; if( MaxCtr >= MaxLen ) xb_error(XB_PARSE_ERROR); while( s && *s ) { if(( *s == ')' && Wtype == 1 ) || (*s == '}' && Wtype == 0 )) { Wctr--; if( Wctr == 0 ) { if( EmptyCtr != 0 ) { TokenType = 'E'; PreviousType = 'E'; } else xb_error(XB_PARSE_ERROR); TokenLen += 2; return XB_NO_ERROR; } } else if(( *s == '(' && Wtype == 1 ) || (*s == '{' && Wtype == 0 )){ Wctr++; EmptyCtr++; } else if( *s != ' ' ) EmptyCtr++; s++; TokenLen++; MaxCtr++; if( MaxCtr >= MaxLen ) xb_error(XB_PARSE_ERROR); } xb_error(XB_PARSE_ERROR); } /* 2 - Check for Constants */ /* check for "'" or """, if no corresponding quote return -1 */ if( *s == '"' || *s == '\'' ){ if( *s == '"' ) Wtype = 0; else Wtype = 1; TokenType = 'C'; /* set to constant */ PreviousType = 'C'; s++; MaxCtr++; if (MaxCtr >= MaxLen) return XB_NO_ERROR; while( s && *s ){ if(( *s == '"' && Wtype == 0 ) || (*s == '\'' && Wtype == 1 )) return XB_NO_ERROR; s++; TokenLen++; MaxCtr++; if (MaxCtr >= MaxLen) return XB_NO_ERROR; } xb_error(XB_PARSE_ERROR); } /* check for .T. .F. .TRUE. or .FALSE. */ if( s && *s && *s == '.' ){ if(( strncmp( s, ".T.", 3 ) == 0 ) || ( strncmp( s, ".F.", 3 ) == 0 )){ TokenLen = 3; TokenType = 'C'; /* constant */ PreviousType = 'C'; LogicalType = 1; return XB_NO_ERROR; } else if( strncmp( s, ".TRUE.", 6 ) == 0 ){ TokenLen = 6; TokenType = 'C'; /* constant */ PreviousType = 'C'; LogicalType = 1; return XB_NO_ERROR; } else if( strncmp( s, ".FALSE.", 7 ) == 0 ){ TokenLen = 7; TokenType = 'C'; /* constant */ PreviousType = 'C'; LogicalType = 1; return XB_NO_ERROR; } } /* check for positive, negative or decimal number constants */ if(( *s == '-' && ( PreviousType == 'O' || PreviousType == 0 )) || ( *s == '+' && ( PreviousType == 'O' || PreviousType == 0 )) || *s == '.' || isdigit( *s )){ sp = s; MaxCtrSave = MaxCtr; Wsw = Wctr = 0; if( *s == '.' ){ Wctr++; s++; MaxCtr++; if (MaxCtr >= MaxLen) xb_error(XB_PARSE_ERROR); if( s && *s && isdigit( *s )) TokenLen++; else Wsw++; } else if( *s == '-' ){ s++; TokenLen++; MaxCtr++; if( MaxCtr >= MaxLen ) xb_error(XB_PARSE_ERROR); /* go past any white space between sign and number */ while( s && *s && IsWhiteSpace( *s )){ s++; TokenLen++; MaxCtr++; if( MaxCtr >= MaxLen ) xb_error(XB_PARSE_ERROR); } } if( isdigit( *s ) || (*s == '.' && !Wsw )){ while(s && *s && ((*s == '.' && Wctr < 2 ) || isdigit(*s)) && !Wsw ){ if( *s == '.' ) { Wctr++; if( Wctr > 1 ) break; s++; MaxCtr++; if( MaxCtr >= MaxLen ){ TokenType = 'N'; PreviousType = 'N'; return XB_NO_ERROR; } if( s && *s && isdigit( *s )) TokenLen++; else Wsw++; } else{ s++; TokenLen++; MaxCtr++; if( MaxCtr >= MaxLen ) { TokenType = 'N'; PreviousType = 'N'; return XB_NO_ERROR; } } } TokenType = 'N'; /* constant */ PreviousType = 'N'; return XB_NO_ERROR; } else { s = sp; MaxCtr = MaxCtrSave; } } /* 2) Check for operators */ #if 0 if( *s == '+' || *s == '-' || *s == '/' || *s == '=' || *s == '$' || *s == '^' || *s == '#' ) { TokenLen = 1; TokenType = 'O'; PreviousType = 'O'; return XB_NO_ERROR; } #else // changed 3/25/00 dtb if( *s == '+' || *s == '-' || *s == '/' || *s == '^') { TokenLen = 1; TokenType = 'O'; PreviousType = 'O'; return XB_NO_ERROR; } if(*s == '=' || *s == '$' || *s == '#' ) { LogicalType = 1; TokenLen = 1; TokenType = 'O'; PreviousType = 'O'; return XB_NO_ERROR; } #endif if( *s == '*' ) { s++; MaxCtr++; if( MaxCtr >= MaxLen ) xb_error(XB_PARSE_ERROR); TokenType = 'O'; PreviousType = 'O'; if( *s == '*' ){ TokenLen = 2; return XB_NO_ERROR; } else{ TokenLen = 1; return XB_NO_ERROR; } } if( *s == '<' || *s == '>' ) { s++; MaxCtr++; if( MaxCtr >= MaxLen ) xb_error(XB_PARSE_ERROR); LogicalType = 1; // added 3/25/00 dtb TokenType = 'O'; PreviousType = 'O'; if( *s == '<' || *s == '>' || *s == '=' ){ TokenLen = 2; return XB_NO_ERROR; } else { TokenLen = 1; return XB_NO_ERROR; } } /* check for .NOT. .OR. .AND. */ if( s && *s && *s == '.' ){ if( strncmp( s, ".NOT.", 5 ) == 0 ){ TokenLen = 5; TokenType = 'O'; /* constant */ PreviousType = 'O'; LogicalType = 1; return XB_NO_ERROR; } else if( strncmp( s, ".AND.", 5 ) == 0 ){ TokenLen = 5; TokenType = 'O'; /* constant */ PreviousType = 'O'; LogicalType = 1; return XB_NO_ERROR; } else if( strncmp( s, ".OR.", 4 ) == 0 ){ TokenLen = 4; TokenType = 'O'; /* constant */ PreviousType = 'O'; LogicalType = 1; return XB_NO_ERROR; } } /* If get this far, must be function or database field */ while( s && *s ){ s++; TokenLen++; MaxCtr++; if( MaxCtr >= MaxLen ) { TokenType = 'D'; PreviousType = 'D'; return XB_NO_ERROR; } if( s && *s && *s == '(' ) { /* look for corresponding ) */ Wctr = 1; s++; TokenLen++; MaxCtr++; if( MaxCtr >= MaxLen ) xb_error(XB_PARSE_ERROR); while( s && *s ) { if( *s == ')' ) { Wctr--; if( !Wctr ) { TokenType = 'F'; /* function */ PreviousType = 'F'; TokenLen++; return XB_NO_ERROR; } } if( *s == '(' ) Wctr++; s++; TokenLen++; MaxCtr++; if( MaxCtr >= MaxLen ) xb_error(XB_PARSE_ERROR); } xb_error(XB_PARSE_ERROR); } else { np = s + 1; pp = s - 1; if( !s || !*s || (IsSeparator( *s ) && !(*s == '-' && *np == '>' ) && !(*s == '>' && *pp == '-' ))) { if(TokenLen > 0) { TokenType = 'D'; /* database field */ PreviousType = 'D'; return XB_NO_ERROR; } } } } return XB_NO_ERROR; } /*************************************************************************/ //! IsSeparator /*! */ char xbExpn::IsSeparator( char c ) { if( c == '-' || c == '+' || c == '*' || c == '/' || c == '$' || c == ' ' || c == '#' || c == '<' || c == '>' || c == '^' || c == '=' || c == '.' /* || c == ')' */ ) return c; else return 0; } /*************************************************************************/ //! GetExpNode /*! */ xbExpNode * xbExpn::GetExpNode(xbShort Len) { xbExpNode * Temp; Temp = new xbExpNode; if( Temp && Len > 0 ) Temp->ResultLen = Len; return Temp; } /*************************************************************************/ //! LoadExpNode /*! */ xbExpNode * xbExpn::LoadExpNode( const char *ENodeText, /* pointer to text data */ const char EType, /* Operand type */ const xbShort ELen, /* length of node text data */ const xbShort BufLen ) /* length needed in the buffer*/ { xbExpNode * CurNode; if(( CurNode = GetExpNode(BufLen)) == NULL ) return NULL; CurNode->NodeText = strdup( ENodeText ); CurNode->Type = EType; CurNode->Len = ELen; CurNode->InTree = 1; CurNode->ResultLen = BufLen; return CurNode; } /*************************************************************************/ //! BuildExpressionTree /*! */ xbShort xbExpn::BuildExpressionTree( const char * Expression, xbShort MaxTokenLen, xbDbf * d ) { /* previous node is the node to insert under */ xbExpNode * CurNode = 0; xbExpNode * PreviousNode; xbShort rc, FieldNo=0, BufLen; xbShort TokenLenCtr; char c; const char *p; char TempField[11]; char TableName[31]; xbDbf * TempDbf=0; int LocTokenLen; if( Tree ) { delete Tree; Tree = NULL; } p = Expression; PreviousNode = NULL; PreviousType = TokenLenCtr = 0; while( IsWhiteSpace( *p )) { p++; TokenLenCtr++; if(TokenLenCtr >= MaxTokenLen) return XB_NO_ERROR; } rc = GetNextToken( p, MaxTokenLen-TokenLenCtr ); LocTokenLen = TokenLen; if( rc != XB_NO_DATA && rc != XB_NO_ERROR ) return rc; while( rc == 0 ){ if( TokenType == 'D' && d ){ if( TokenLen > 30 ) strncpy( TableName, p, 30 ); else strncpy( TableName, p, TokenLen ); memset( TempField, 0x00, 11 ); if( strstr( p, "->" ) != NULL ) { if(( TempDbf = d->xbase->GetDbfPtr( TableName )) == NULL ) xb_error(XB_INVALID_FIELD); xbShort tlen = 0; while( TableName[tlen] != '-' && TableName[tlen+1] != '>' ) tlen++; tlen = TokenLen - tlen - 2; // length of field name const char * fp = strstr( p, "->" ); fp += 2; // ptr to beginning of field name strncpy( TempField, fp, tlen ); } else { TempDbf = d; if( TokenLen > 10 ) xb_error(XB_INVALID_FIELD); strncpy( TempField, p, TokenLen ); } if(( FieldNo = TempDbf->GetFieldNo( TempField )) == -1 ) xb_error(XB_INVALID_FIELD); BufLen = TempDbf->GetFieldLen( FieldNo ) + 1; } else if( TokenType == 'C' || TokenType == 'N' ) BufLen = TokenLen + 1; else BufLen = 0; if( TokenType == 'C' ) p++; /* go past first ' */ if( TokenType != 'O' ) { if( !Tree ) { /* create root node with this token */ CurNode = LoadExpNode( p, TokenType, TokenLen, BufLen ); Tree = CurNode; } else { /* put as child 2 of previous node */ CurNode = LoadExpNode( p, TokenType, TokenLen, BufLen ); PreviousNode->Sibling2 = CurNode; CurNode->Node = PreviousNode; } if( TokenType == 'E' ) { if((rc=ReduceComplexExpression(p,TokenLen,CurNode,d))!=0) return rc; if(PreviousNode) CurNode = PreviousNode->Sibling2; else CurNode = Tree; } else if( TokenType == 'F' ) { if(( rc = ReduceFunction( p, CurNode, d)) != 0 ) return rc; CurNode->ExpressionType = GetFuncInfo( p, 2 ); CurNode->dbf = d; } else if( TokenType == 'D' && d ) { CurNode->DataLen = BufLen - 1; CurNode->FieldNo = FieldNo; CurNode->dbf = TempDbf; c = TempDbf->GetFieldType( FieldNo ); if( c == 'C' || c == 'M' ) CurNode->ExpressionType = 'C'; else if( c == 'L' ) CurNode->ExpressionType = 'L'; else if( c == 'N' || c == 'F' ) CurNode->ExpressionType = 'N'; else if( c == 'D' ) CurNode->ExpressionType = 'D'; } else if( TokenType == 'C' || TokenType == 'N' ) { CurNode->DataLen = CurNode->Len; CurNode->StringResult = CurNode->NodeText; CurNode->StringResult.resize( CurNode->DataLen+1 ); if( TokenType == 'N' ) { CurNode->DoubResult = strtod( CurNode->StringResult, 0 ); CurNode->ExpressionType = 'N'; } else CurNode->ExpressionType = 'C'; } } else /* it is an operator */ { if(!Tree) { if(*p == '-') { CurNode = LoadExpNode( p, TokenType, TokenLen, 0 ); CurNode->ExpressionType = 'C'; } else xb_error(XB_EXP_SYNTAX_ERROR); } else { if( Tree->Type != 'O' ) { CurNode = LoadExpNode( p, TokenType, TokenLen, 0 ); Tree->Node = CurNode; /* link the new parent to old tree */ CurNode->Sibling1 = Tree; /* connect the sibling */ Tree = CurNode; /* root in tree */ } else { PreviousNode = CurNode->Node; CurNode = LoadExpNode( p, TokenType, TokenLen, 0 ); while( PreviousNode && (( OperatorWeight( PreviousNode->NodeText, TokenLen ) == 0 ) || ( OperatorWeight( CurNode->NodeText, TokenLen ) >= /*<=*/ OperatorWeight( PreviousNode->NodeText, TokenLen )))) PreviousNode = PreviousNode->Node; if( PreviousNode ) { CurNode->Node = PreviousNode; CurNode->Sibling1 = PreviousNode->Sibling2; PreviousNode->Sibling2 = CurNode; CurNode->Sibling1->Node = CurNode; } else { /* insert at root */ CurNode->Sibling1 = Tree; Tree = CurNode; CurNode->Sibling1->Node = CurNode; } } if( LogicalType ) CurNode->ExpressionType = 'L'; } } PreviousNode = CurNode; // p += CurNode->Len; p += LocTokenLen; if( TokenType == 'C' ) { p++; /* go past last ' */ TokenLenCtr+=2; /* add the quotes */ } // TokenLenCtr += CurNode->Len; TokenLenCtr += LocTokenLen; if( TokenLenCtr >= MaxTokenLen ) return XB_NO_ERROR; if( p && *p && TokenType == 'E' ) { p++; TokenLenCtr++; } while( IsWhiteSpace( *p )) { p++; TokenLenCtr++; if( TokenLenCtr >= MaxTokenLen ) return XB_NO_ERROR; } rc = GetNextToken( p, MaxTokenLen-TokenLenCtr ); LocTokenLen = TokenLen; if( rc != XB_NO_DATA && rc != XB_NO_ERROR ) return rc; } return XB_NO_ERROR; } /*************************************************************************/ //! GetExpressionResultType /*! */ char xbExpn::GetExpressionResultType( XB_EXPRESSION * e ) { xbExpNode * Temp = 0; if( e ) Temp = e; else if( !Temp ) Temp = Tree; else return 0; if( e->Type == 'O' && ( *e->NodeText == '<' || *e->NodeText == '>' || *e->NodeText == '=' || *e->NodeText == '#' || *e->NodeText == '$' )) return 'L'; while( Temp && !Temp->ExpressionType && Temp->Sibling1 ) Temp = Temp->Sibling1; return Temp->ExpressionType; } /*************************************************************************/ //! GetExpressionHandle /*! */ XB_EXPRESSION * xbExpn::GetExpressionHandle( void ) { XB_EXPRESSION * e; e = Tree; Tree = NULL; return e; } /*************************************************************************/ //! OperatorWeight /*! */ xbShort xbExpn::OperatorWeight( const char * Oper, xbShort len ) { if( len < 1 || len > 5 ) return 0; if( len == 1 && ( Oper[0] == '*' && Oper[1] == '*' )) return 3; if( Oper[0] == '+' || Oper[0] == '-' ) return 1; if( Oper[0] == '*' || Oper[0] == '/' ) return 2; if(Oper[0] == '.') return 1; return 0; } /*************************************************************************/ //! ReduceComplexExpression /*! */ xbShort xbExpn::ReduceComplexExpression(const char *NextToken, xbShort Len, xbExpNode *cn, xbDbf *d) { const char *p; xbShort rc; xbExpNode * SaveTree; SaveTree = Tree; Tree = NULL; p = NextToken; p++; if(( rc = BuildExpressionTree( p, Len-2, d )) != XB_NO_ERROR ) return rc; if(cn->Node) { /* then this is the base tree */ cn->Node->Sibling2 = Tree; Tree->Node = cn->Node; delete cn; Tree = SaveTree; } else delete cn; return XB_NO_ERROR; } /*************************************************************************/ //! GetFunctionTokenLen /*! */ xbShort xbExpn::GetFunctionTokenLen( const char * s ) { xbShort cnt, LeftParenCtr; const char *p; cnt = LeftParenCtr = 0; p = s; while( p && ( *p != ',' || ( *p == ',' && LeftParenCtr > 0 )) && !( LeftParenCtr == 0 && *p == ')')) { if( *p == '(' ) LeftParenCtr++; else if( *p == ')' ) LeftParenCtr--; p++; cnt++; } return cnt; } /*************************************************************************/ //! ReduceFunction /*! */ xbShort xbExpn::ReduceFunction(const char *NextToken, xbExpNode *cn, xbDbf *d) { const char *p; xbShort rc; xbShort FuncTokenLen; xbExpNode * SaveTree; p = strchr( NextToken, '(' ); if (!p) xb_error(XB_PARSE_ERROR); p++; while( IsWhiteSpace( *p )) p++; if (*p == ')') return XB_NO_ERROR; /* do function paramater 1 */ FuncTokenLen = GetFunctionTokenLen( p ); SaveTree = Tree; Tree = NULL; if(( rc = BuildExpressionTree( p, FuncTokenLen, d )) != XB_NO_ERROR ) return rc; cn->Sibling1 = Tree; Tree->Node = cn; Tree = SaveTree; /* do function paramater 2 */ p += FuncTokenLen; while( IsWhiteSpace( *p )) p++; if(*p == ')') return XB_NO_ERROR; if( *p != ',' ) xb_error(XB_PARSE_ERROR); p++; while( IsWhiteSpace( *p )) p++; FuncTokenLen = GetFunctionTokenLen( p ); SaveTree = Tree; Tree = NULL; if(( rc = BuildExpressionTree( p, FuncTokenLen, d )) != XB_NO_ERROR ) return rc; cn->Sibling2 = Tree; Tree->Node = cn; Tree = SaveTree; /* do function paramater 3 */ p += FuncTokenLen; while( IsWhiteSpace( *p )) p++; if (*p == ')') return XB_NO_ERROR; if( *p != ',' ) xb_error(XB_PARSE_ERROR); p++; while( IsWhiteSpace( *p )) p++; FuncTokenLen = GetFunctionTokenLen( p ); SaveTree = Tree; Tree = NULL; if(( rc = BuildExpressionTree( p, FuncTokenLen, d )) != XB_NO_ERROR ) xb_error(rc); cn->Sibling3 = Tree; Tree->Node = cn; Tree = SaveTree; return XB_NO_ERROR; } /*************************************************************************/ //! ParseExpression /*! */ xbShort xbExpn::ParseExpression(const char *exp, xbDbf *d) { return BuildExpressionTree(exp, strlen(exp), d); } /*************************************************************************/ //! ProcessExpression /*! */ xbShort xbExpn::ProcessExpression(const char *e, xbDbf *d) { xbShort rc; if(( rc = BuildExpressionTree( e, strlen( e ), d )) != XB_NO_ERROR ) return rc; if(( rc = ProcessExpression( Tree )) != XB_NO_ERROR ) return rc; return XB_NO_ERROR; } /*************************************************************************/ #ifdef XBASE_DEBUG //! DumpExpressionTree /*! */ void xbExpn::DumpExpressionTree( xbExpNode * E ) { if( !E ) E = Tree; if( !E ) return; DumpExpNode( E ); if( E->Sibling1 ) DumpExpressionTree( E->Sibling1 ); if( E->Sibling2 ) DumpExpressionTree( E->Sibling2 ); if( E->Sibling3 ) DumpExpressionTree( E->Sibling3 ); return; } /*************************************************************************/ //! DumpExpNode /*! */ void xbExpn::DumpExpNode(xbExpNode *e) { cout << "\n\n****** Exp Node ******"; cout << "\nExp Node Address " << e; cout << " Node Text = " << e->NodeText; cout << "\nType = " << e->Type; cout << " Len = " << e->Len; cout << " InTree = " << e->InTree; cout << "\nParent = " << e->Node; cout << "\nField No = " << e->FieldNo; cout << "\nExpressionType = " << e->ExpressionType; cout << "\nStringResult = " << e->StringResult; cout << " DoubResult = " << e->DoubResult; cout << " IntResult = " << e->IntResult; cout << " ResultLen = " << e->ResultLen; cout << " DataLen = " << e->DataLen; cout << " Sibling 1 = " << e->Sibling1; cout << " Sibling 2 = " << e->Sibling2; if( e->Sibling3 ) cout << " Sibling3 = " << e->Sibling3; return; } #endif #endif // XB_EXPRESSIONS /*************************************************************************/ xbase-2.0.0/xbase/expfunc.cpp0000644000000000000000000006176307202063230011527 /* $Id: expfunc.cpp,v 1.5 2000/11/07 20:31:20 dbryson Exp $ Xbase project source code This file contains logic for handling Xbase expressions. Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.1 5/25/98 - Enhanced expression logic V 1.7.4b 7/2/98 - changed gcvt to sprintf for portability reasons */ #ifdef __WIN32__ #include #else #include #endif #include #ifdef XB_EXPRESSIONS #include #include #include #include #include #include /*! \file expfunc.cpp */ /*************************************************************************/ //! Short description. /*! \param Func */ xbShort xbExpn::ProcessFunction( char * Func ) { /* 1 - pop function from stack 2 - verify function name and get no of parms needed 3 - verify no of parms >= remainder of stack 4 - pop parms off stack 5 - execute function 6 - push result back on stack */ char *buf = 0; xbExpNode *p1, *p2, *p3, *WorkNode, *FuncNode; xbShort ParmsNeeded,len; char ptype = 0; /* process type s=string, l=logical, d=double */ xbDouble DoubResult = 0; xbLong IntResult = 0; FuncNode = (xbExpNode *) Pop(); ParmsNeeded = GetFuncInfo( Func, 1 ); if( ParmsNeeded == -1 ) { xb_error(XB_INVALID_FUNCTION); } else { ParmsNeeded = 0; if( FuncNode->Sibling1 ) ParmsNeeded++; if( FuncNode->Sibling2 ) ParmsNeeded++; if( FuncNode->Sibling3 ) ParmsNeeded++; } if (ParmsNeeded > GetStackDepth()) xb_error(XB_INSUFFICIENT_PARMS); p1 = p2 = p3 = NULL; if( ParmsNeeded > 2 ) p3 = (xbExpNode *) Pop(); if( ParmsNeeded > 1 ) p2 = (xbExpNode *) Pop(); if( ParmsNeeded > 0 ) p1 = (xbExpNode *) Pop(); memset( WorkBuf, 0x00, WorkBufMaxLen+1); if( strncmp( Func, "ABS", 3 ) == 0 ) { ptype = 'd'; DoubResult = ABS( GetDoub( p1 )); } else if( strncmp( Func, "ASC", 3 ) == 0 ) { ptype = 'd'; DoubResult = ASC( p1->StringResult ); } else if( strncmp( Func, "AT", 2 ) == 0 ) { ptype = 'd'; DoubResult = AT( p1->StringResult, p2->StringResult ); } else if( strncmp( Func, "CDOW", 4 ) == 0 ) { ptype = 's'; buf = CDOW( p1->StringResult ); } else if( strncmp( Func, "CHR", 3 ) == 0 ) { ptype = 's'; buf = CHR( GetInt( p1 )); } else if( strncmp( Func, "CMONTH", 6 ) == 0 ) { ptype = 's'; buf = CMONTH( p1->StringResult ); } else if( strncmp( Func, "DATE", 4 ) == 0 ) { ptype = 's'; buf = DATE(); } else if( strncmp( Func, "DAY", 3 ) == 0 ) { ptype = 'd'; DoubResult = DAY( p1->StringResult ); } else if( strncmp( Func, "DESCEND", 7 ) == 0 ) { ptype = 'd'; DoubResult = DESCEND( p1->StringResult ); } else if( strncmp( Func, "DOW", 3 ) == 0 ) { ptype = 'd'; DoubResult = DOW( p1->StringResult ); } else if( strncmp( Func, "DTOC", 4 ) == 0 ) { ptype = 's'; buf = DTOC( p1->StringResult ); } else if( strncmp( Func, "DTOS", 4 ) == 0 ) { ptype = 's'; buf = DTOS( p1->StringResult ); } else if( strncmp( Func, "EXP", 3 ) == 0 ) { ptype = 'd'; DoubResult = EXP( GetDoub( p1 )); } else if( strncmp( Func, "INT", 3 ) == 0 ) { ptype = 'd'; DoubResult = INT( GetDoub( p1 )); } else if( strncmp( Func, "ISALPHA", 7 ) == 0 ) { ptype = 'l'; IntResult = ISALPHA( p1->StringResult ); } else if( strncmp( Func, "ISLOWER", 7 ) == 0 ) { ptype = 'l'; IntResult = ISLOWER( p1->StringResult ); } else if( strncmp( Func, "ISUPPER", 7 ) == 0 ) { ptype = 'l'; IntResult = ISUPPER( p1->StringResult ); } else if( strncmp( Func, "LEN", 3 ) == 0 ) { ptype = 'd'; DoubResult = LEN( p1->StringResult ); } else if( strncmp( Func, "LEFT", 4 ) == 0 ) { ptype = 's'; buf = LEFT( p1->StringResult, INT( p2->DoubResult )); } else if( strncmp( Func, "LTRIM", 5 ) == 0 ) { ptype = 's'; buf = LTRIM( p1->StringResult ); } else if( strncmp( Func, "LOG", 3 ) == 0 ) { ptype = 'd'; DoubResult = LOG( GetDoub( p1 )); } else if( strncmp( Func, "LOWER", 5 ) == 0 ) { ptype = 's'; buf = LOWER( p1->StringResult ); } else if( strncmp( Func, "MAX", 3 ) == 0 ) { ptype = 'd'; DoubResult = MAX( GetDoub( p1 ), GetDoub( p2 )); } else if( strncmp( Func, "MIN", 3 ) == 0 ) { ptype = 'd'; DoubResult = MIN( GetDoub( p1 ), GetDoub( p2 )); } else if( strncmp( Func, "MONTH", 5 ) == 0 ) { ptype = 'd'; DoubResult = MONTH( p1->StringResult ); } else if( strncmp( Func, "RECNO", 5 ) == 0 ) { ptype = 'l'; IntResult = RECNO( FuncNode->dbf ); } // else if( strncmp( Func, "RECNO", 5 ) == 0 ) // { // ptype = 'd'; // DoubResult = FuncNode->dbf->GetCurRecNo(); // } else if( strncmp( Func, "REPLICATE", 9 ) == 0 ) { ptype = 's'; buf = REPLICATE( p1->StringResult, GetInt( p2 )); } else if( strncmp( Func, "RIGHT", 5 ) == 0 ) { ptype = 's'; buf = RIGHT( p1->StringResult, GetInt( p2 )); } else if( strncmp( Func, "RTRIM", 5 ) == 0 ) { ptype = 's'; buf = RTRIM( p1->StringResult ); } else if( strncmp( Func, "SPACE", 5 ) == 0 ) { ptype = 's'; buf = SPACE( INT( GetDoub( p1 ))); } else if( strncmp( Func, "SQRT", 4 ) == 0 ) { ptype = 'd'; DoubResult = SQRT( GetDoub( p1 )); } else if( strncmp( Func, "STRZERO", 7 ) == 0 && ParmsNeeded == 1 ) { ptype = 's'; buf = STRZERO( p1->StringResult ); } else if( strncmp( Func, "STRZERO", 7 ) == 0 && ParmsNeeded == 2 ) { ptype = 's'; buf = STRZERO( p1->StringResult, GetInt( p2 )); } else if( strncmp( Func, "STRZERO", 7 ) == 0 && ParmsNeeded == 3 ) { ptype = 's'; buf = STRZERO( p1->StringResult, GetInt( p2 ), GetInt( p3 )); } else if( strncmp( Func, "STR", 3 ) == 0 && ParmsNeeded == 1) { ptype = 's'; buf = STR( p1->StringResult ); } else if( strncmp( Func, "STR", 3 ) == 0 && ParmsNeeded == 2) { ptype = 's'; buf = STR( p1->StringResult, GetInt( p2 )); } else if( strncmp( Func, "STR", 3 ) == 0 && ParmsNeeded == 3) { ptype = 's'; if(p1->ExpressionType == 'N') buf = STR( p1->DoubResult, GetInt( p2 ), GetInt( p3 )); else buf = STR( p1->StringResult, GetInt( p2 ), GetInt( p3 )); } else if( strncmp( Func, "SUBSTR", 6 ) == 0 ) { ptype = 's'; buf = SUBSTR( p1->StringResult, GetInt( p2 ), GetInt( p3 )); } else if( strncmp( Func, "TRIM", 4 ) == 0 ) { ptype = 's'; buf = TRIM( p1->StringResult ); } else if( strncmp( Func, "UPPER", 5 ) == 0 ) { ptype = 's'; buf = UPPER( p1->StringResult ); } else if( strncmp( Func, "VAL", 3 ) == 0 ) { ptype = 'd'; DoubResult = VAL( p1->StringResult ); } else if( strncmp( Func, "YEAR", 4 ) == 0 ) { ptype = 'd'; DoubResult = YEAR( p1->StringResult ); } if( p1 && !p1->InTree ) delete p1; if( p2 && !p2->InTree ) delete p2; if( p3 && !p3->InTree ) delete p3; if( !FuncNode->InTree ) delete FuncNode; if( buf ){ len = strlen( buf ); if(( WorkNode = GetExpNode( len+1 )) == NULL ) xb_memory_error; } else{ len = 0; if(( WorkNode = GetExpNode( 0 )) == NULL ) xb_memory_error; } switch( ptype ) { case 's': WorkNode->DataLen = len; WorkNode->ExpressionType = 'C'; WorkNode->Type = 's'; WorkNode->StringResult = buf; break; case 'd': WorkNode->DataLen = 0; WorkNode->ExpressionType = 'N'; WorkNode->Type = 'd'; WorkNode->DoubResult = DoubResult; break; case 'l': WorkNode->DataLen = 0; WorkNode->ExpressionType = 'L'; WorkNode->Type = 'l'; WorkNode->IntResult = IntResult; break; default: cout << "\nInternal error. " << ptype; break; } Push( (void *) WorkNode ); return XB_NO_ERROR; } /*************************************************************************/ //! Short description. /*! */ xbString & xbExpn::GetStringResult() { xbString *s = 0; xbExpNode *e; if( GetStackDepth() < 1 ) return *s; e = (xbExpNode *) Pop(); s = &e->StringResult; Push((void *) e ); return *s; } /*************************************************************************/ //! Short description. /*! */ xbLong xbExpn::GetIntResult( void ) { xbLong l; xbExpNode * e; if( GetStackDepth() < 1 ) return 0L; e = (xbExpNode *) Pop(); l = e->IntResult; Push( (void *) e ); return l; } /*************************************************************************/ //! Short description. /*! */ xbDouble xbExpn::GetDoubleResult( void ) { xbDouble d; xbExpNode * e; if( GetStackDepth() < 1 ) return (xbDouble) 0; e = (xbExpNode *) Pop(); d = e->DoubResult; Push( (void *) e ); return d; } /*************************************************************************/ //! Short description. /*! \param p */ xbDouble xbExpn::GetDoub( xbExpNode * p ) { if( p->Type == 'd' ) return p->DoubResult; else if( p->Type == 'N' || p->Type == 's' ) return( strtod( p->StringResult, NULL )); else if( p->Type == 'D' ) return( p->dbf->GetDoubleField( p->FieldNo )); else return 0; } /*************************************************************************/ //! Short description. /*! \param p */ xbLong xbExpn::GetInt( xbExpNode *p ) { if( p->Type == 'l' || p->Type == 'i' ) return p->IntResult; else if( p->Type == 'N' || p->Type == 's' ) return atoi( p->StringResult ); else if( p->Type == 'D' ) return p->dbf->GetLongField( p->FieldNo ); else return 0L; } /*************************************************************************/ //! Short description. /*! \param d */ xbDouble xbExpn::ABS( xbDouble d ) { if( d < (xbDouble) 0 ) return d * -1; else return d; } /*************************************************************************/ //! Short description. /*! \param String */ xbLong xbExpn::ASC( const char * String ) { return *String; } /*************************************************************************/ //! Short description. /*! \param s1 \param s2 */ xbLong xbExpn::AT( const char * s1, const char *s2 ) { /* looks for s1 in s2 */ xbLong cnt; const char *p; if( strlen( s1 ) > strlen( s2 )) return 0; if(( p = strstr( s2, s1 )) == NULL ) return 0; cnt = 1; while( s2++ != p ) cnt++; return cnt; } /*************************************************************************/ //! Short description. /*! \param Date8 */ char * xbExpn::CDOW( const char * Date8 ) { static char buf[10]; xbShort len,i; strcpy( buf, FormatDate( "DDDD", Date8 )); len = strlen( buf ); for( i = len; i < 9; i++ ) buf[i] = 0x20; buf[9] = 0x00; return buf; } /*************************************************************************/ //! Short description. /*! \param l */ char * xbExpn::CHR( xbLong l ) { static char buf[2]; xbShort i; i = (xbShort) l; buf[0] = i; buf[1] = 0x00; return buf; } /*************************************************************************/ //! Short description. /*! \param Date8 */ char * xbExpn::CMONTH( const char * Date8 ) { static char buf[10]; xbShort len,i; strcpy( buf, FormatDate( "MMMM", Date8 )); len = strlen( buf ); for( i = len; i < 9; i++ ) buf[i] = 0x20; buf[9] = 0x00; return buf; } /*************************************************************************/ //! Short description. /*! \param Date8 */ xbLong xbExpn::DAY( const char * Date8 ) { return DayOf( XB_FMT_MONTH, Date8 ); } /*************************************************************************/ //! Short description. /*! \param Date8 */ xbLong xbExpn::DESCEND( const char * Date8 ) { /* this function may be broken, went thru major code merge and couldn't figure out which code was correct - think it is ok */ xbDate x; xbLong l; l = x.JulianDays( "29991231" ) - x.JulianDays( Date8 ); return 2415021 + l; // This is for a string - but it doesn't work yet // int i,j; // for(i = 7, j = 0; j < 8; i--, j++ ) // WorkBuf[j] = Date8[i]; // WorkBuf[8] = 0x00; // return DayOf( XB_FMT_MONTH, Date8 ); } /*************************************************************************/ //! Short description. /*! \param Date8 */ xbLong xbExpn::DOW( const char * Date8 ) { return DayOf( XB_FMT_WEEK, Date8 ); } /*************************************************************************/ //! Short description. /*! \param Date8 */ char * xbExpn::DTOC( const char * Date8 ) { strcpy( WorkBuf, FormatDate( GetDefaultDateFormat(), Date8 )); return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param Date8 */ char * xbExpn::DTOS( const char * Date8 ) { strcpy( WorkBuf, FormatDate( "YYYYMMDD", Date8 )); return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param d */ xbDouble xbExpn::EXP( xbDouble d ) { return exp( d ); } /*************************************************************************/ //! Short description. /*! \param d */ xbLong xbExpn::INT( xbDouble d ) { return (xbLong) d; } /*************************************************************************/ //! Short description. /*! \param String */ xbLong xbExpn::ISALPHA( const char * String ) { if( isalpha(*String) ) return 1; else return 0; } /*************************************************************************/ //! Short description. /*! \param String */ xbLong xbExpn::ISLOWER( const char * String ) { if( islower(*String) ) return 1; else return 0; } /*************************************************************************/ //! Short description. /*! \param String */ xbLong xbExpn::ISUPPER( const char * String ) { if( isupper(*String) ) return 1; else return 0; } /*************************************************************************/ //! Short description. /*! \param String */ xbLong xbExpn::LEN( const char * String ) { xbLong len; len = strlen( String ); len--; while( len >= 0 && String[len] == 0x20 ) len--; return ++len; } /*************************************************************************/ //! Short description. /*! \param String \param Len */ char * xbExpn::LEFT( const char * String, xbShort Len ) { xbShort i; for( i = 0; i < Len && i < 100; i++ ) WorkBuf[i] = String[i]; WorkBuf[i] = 0x00; return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String */ /* This method removes any leading spaces from String */ char * xbExpn::LTRIM( const char *String) { WorkBuf[0] = 0x00; if (!String) return WorkBuf; xbShort i; i = 0; while( *String && *String == 0x20 ) String++; while( *String && i < WorkBufMaxLen ){ WorkBuf[i++] = *String; String++; } WorkBuf[i] = 0x00; return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param d */ xbDouble xbExpn::LOG( xbDouble d ) { return log( d ); } /*************************************************************************/ //! Short description. /*! \param String */ char *xbExpn::LOWER( const char *String ) { WorkBuf[0] = 0x00; if (!String) return WorkBuf; xbShort i = 0; while( *String && i < WorkBufMaxLen) { WorkBuf[i++] = tolower( *String ); String++; } WorkBuf[i] = 0x00; return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param d1 \param d2 */ xbDouble xbExpn::MAX( xbDouble d1, xbDouble d2 ) { if( d1 > d2 ) return d1; else return d2; } /*************************************************************************/ //! Short description. /*! \param d1 \param d2 */ xbDouble xbExpn::MIN( xbDouble d1, xbDouble d2 ) { if( d1 < d2 ) return d1; else return d2; } /*************************************************************************/ //! Short description. /*! \param Date8 */ xbLong xbExpn::MONTH( const char * Date8 ) { return MonthOf( Date8 ); } /*************************************************************************/ //! Short description. /*! \param d */ xbLong xbExpn::RECNO( xbDbf * d ) { return d->GetCurRecNo(); } /*************************************************************************/ //! Short description. /*! \param CurRec */ char * xbExpn::RECNO( xbULong CurRec ) { sprintf( WorkBuf, "%ld%c", CurRec, 0 ); return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String \param Cnt */ char * xbExpn::REPLICATE( const char * String, xbShort Cnt ) { xbShort len, i; len = strlen( String ); if(( len * Cnt ) > 100 ) return NULL; memset( WorkBuf, 0x00, len+1 ); for( i = 0; i < Cnt; i++ ) strcat( WorkBuf, String ); return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String \paran cnt */ char * xbExpn::RIGHT( const char * String, xbShort cnt ) { xbShort len; strcpy( WorkBuf, String ); len = strlen( String ); if( len < cnt ) return WorkBuf; len = LEN( String ); if( len < cnt ) return WorkBuf; strcpy( WorkBuf, String + len - cnt ); return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String */ char * xbExpn::RTRIM( const char * String ) { return TRIM( String ); } /*************************************************************************/ //! Short description. /*! \param Cnt */ char * xbExpn::SPACE( xbShort Cnt ) { if( Cnt > 100 ) return NULL; memset( WorkBuf, 0x20, Cnt ); WorkBuf[Cnt] = 0x00; return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param d */ xbDouble xbExpn::SQRT( xbDouble d ) { return sqrt( d ); } /*************************************************************************/ //! Short description. /*! \param d \param length \param numDecimals */ char * xbExpn::STR(xbDouble d, xbUShort length, xbShort numDecimals) { // sanity check for length arg if (length > WorkBufMaxLen) { // maybe should generate an error here instead ? length = WorkBufMaxLen; } // check the length required sprintf(WorkBuf, "%.*f", numDecimals, d); if (strlen(WorkBuf) > length) { memset(WorkBuf, '*', length); WorkBuf[length] = 0x00; } else sprintf( WorkBuf, "%*.*f", length, numDecimals, d ); return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param d \param length */ char * xbExpn::STR( xbDouble d, xbShort length ) { return STR( d, length, 0 ); } /*************************************************************************/ //! Short description. /*! \param d */ char * xbExpn::STR( xbDouble d ) { return STR( d, 10, 0 ); } /*************************************************************************/ //! Short description. /*! \param String \param length \param */ char * xbExpn::STR( const char * String, xbShort length, xbShort ) { xbShort len, i; len = strlen( String ); strcpy( WorkBuf, String ); for( i = len; i < length; i++ ) WorkBuf[i] = 0x20; WorkBuf[i] = 0x00; return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String \param length */ char * xbExpn::STR( const char *String, xbShort length ) { return STR( String, length, 0 ); } /*************************************************************************/ //! Short description. /*! \param String */ char * xbExpn::STR( const char * String ) { return STR( String, 10, 0 ); } /*************************************************************************/ //! Short description. /*! \param d \param length \param */ char * xbExpn::STRZERO( xbDouble d, xbShort length, xbShort ) { xbShort len,i; sprintf(WorkBuf, "%*.*g", length, length, d); // gcvt( d, length, WorkBuf ); len = strlen( WorkBuf ); if( len > length ) strcpy( WorkBuf, "**********" ); else if( len < length ) { for( i = len; i < length; i++ ) WorkBuf[i] = 0x30; WorkBuf[i] = 0x00; } return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param d \param length */ char * xbExpn::STRZERO( xbDouble d, xbShort length ) { return STRZERO( d, length, 0 ); } /*************************************************************************/ //! Short description. /*! \param d */ char * xbExpn::STRZERO( xbDouble d ) { return STRZERO( d, 10, 0 ); } /*************************************************************************/ //! Short description. /*! \param String \param length \param */ char * xbExpn::STRZERO( const char * String, xbShort length, xbShort ) { xbShort i, len ; while( *String == ' ' ) String++; len = strlen(String); for( i = 0; i < abs( length-len); i++ ) WorkBuf[i] = 0x30; WorkBuf[i] = 0x00; strcat( WorkBuf, String ); return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String \param length */ char * xbExpn::STRZERO( const char * String, xbShort length ) { return STRZERO( String, length, 0 ); } /*************************************************************************/ //! Short description. /*! \param String */ char * xbExpn::STRZERO( const char * String ) { return STRZERO( String, 10, 0 ); } /*************************************************************************/ //! Short description. /*! \param String \param StartPos \param Len */ char * xbExpn::SUBSTR( const char * String, xbShort StartPos, xbShort Len ) { xbShort i; if( StartPos < 1 ) return NULL; String += (StartPos - 1); for( i = 0; i < Len; i++ ) WorkBuf[i] = *String++; WorkBuf[i] = 0x00; return WorkBuf; } /*************************************************************************/ //! Short description. /*! */ char * xbExpn::DATE() { xbDate d; strcpy( WorkBuf, d.Sysdate()); return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String */ char * xbExpn::TRIM( const char * String ) { WorkBuf[0] = 0x00; if( !String ) return WorkBuf; char *sp; xbShort len; len = strlen( String ); if( len < WorkBufMaxLen ) { strcpy( WorkBuf, String ); } else { strncpy( WorkBuf, String, WorkBufMaxLen ); WorkBuf[ WorkBufMaxLen ] = 0x00; len = WorkBufMaxLen; } sp = WorkBuf + len - 1; while( *sp == 0x20 && sp >= WorkBuf ) { *sp = 0x00; sp--; } return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String */ char *xbExpn::UPPER( const char *String ) { WorkBuf[0] = 0x00; if (!String) return WorkBuf; xbShort i; i = 0; while(*String && i < WorkBufMaxLen) { WorkBuf[i++] = toupper(*String); String++; } WorkBuf[i] = 0x00; return WorkBuf; } /*************************************************************************/ //! Short description. /*! \param String */ xbLong xbExpn::VAL( const char * String ) { if( String ) return (xbLong) *String; else return 0; } /*************************************************************************/ //! Short description. /*! \param Date8 */ xbLong xbExpn::YEAR( const char * Date8 ){ return YearOf( Date8 ); } /*************************************************************************/ #endif // XB_EXPRESSIONS xbase-2.0.0/xbase/expproc.cpp0000644000000000000000000003722507230134245011541 /* $Id: expproc.cpp,v 1.6 2001/01/13 20:20:53 dbryson Exp $ Xbase project source code Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.7.1 5/25/98 - Enhanced expression support */ #ifdef __WIN32__ #include #else #include #endif #include #ifdef XB_EXPRESSIONS #include #include #include #include /*! \file expproc.cpp */ /*************************************************************************/ //! Short description /*! \param e */ xbExpNode * xbExpn::GetFirstTreeNode( xbExpNode * e ) { xbExpNode * WorkNode; if( !e ) return e; WorkNode = e; while( WorkNode->Sibling1 ) WorkNode = WorkNode->Sibling1; return WorkNode; } /*************************************************************************/ //! Short description /*! \param Operand \param Op1 \pamam Op2 */ xbShort xbExpn::ValidOperation( char * Operand, char Op1, char Op2 ) { /* Valid operation table operator Field1 Field2 operator Field1 Field2 ** N N = N N * N N = C C / N N <>,# N N + N N <>,# C C + C C <= N N - N N <= C C - C C >= N N < N N >= C C < C C > N N > C C */ if( Operand[0] == '*' && Operand[1] == '*' && Op1 == 'N' && Op2 == 'N' ) return 1; switch( Operand[0] ) { case '*': case '/': if( Op1 == 'N' && Op2 == 'N' ) return 1; else return 0; case '+': case '-': case '<': case '>': case '=': case '#': case '$': // added 3/26/00 dtb if(( Op1 == 'N' && Op2 == 'N' ) || ( Op1 == 'C' && Op2 == 'C' )) return 1; else return 0; case '.' : // logical operators, added 3/26/00 dtb if((Operand[1] == 'A' || Operand[1] == 'N' || Operand[1] == 'O')) /* && (Op1 == 'N' && Op2 == 'N')) */ return 1; return 0; default: return 0; } } /*************************************************************************/ //! Short description /*! \param e */ xbExpNode * xbExpn::GetNextTreeNode( xbExpNode * e ) { if( !e->Node ) return NULL; /* sibling 1 && sibling 2 exists */ if( e == e->Node->Sibling1 && e->Node->Sibling2 ) return GetFirstTreeNode( e->Node->Sibling2 ); /* sibling2 && sibling3 exists */ else if( e == e->Node->Sibling2 && e->Node->Sibling3 ) return GetFirstTreeNode( e->Node->Sibling3 ); else return e->Node; } /*************************************************************************/ //! Short description /*! \param e */ xbShort xbExpn::ProcessExpression( xbExpNode * e ) { return ProcessExpression( e, 0 ); } /*************************************************************************/ //! Short description /*! \param Wtree \param RecBufSw */ xbShort xbExpn::ProcessExpression( xbExpNode * Wtree, xbShort RecBufSw ) { xbExpNode * WorkNode; xbShort rc = 0; if( Wtree == 0 ) Wtree = Tree; memset(WorkBuf, 0x00, WorkBufMaxLen+1 ); /* initialize the stack - free any expnodes */ while( GetStackDepth() > 0 ) { WorkNode = (xbExpNode *) Pop(); if( !WorkNode->InTree ) delete WorkNode; } if(( WorkNode = GetFirstTreeNode( Wtree )) == NULL ) xb_error(XB_NO_DATA); while( WorkNode ) { Push( (void *) WorkNode ); if( WorkNode->Type == 'D' && WorkNode->dbf ) { WorkNode->dbf->GetField( WorkNode->FieldNo, WorkNode->StringResult, RecBufSw ); if( WorkNode->dbf->GetFieldType( WorkNode->FieldNo ) == 'N' || WorkNode->dbf->GetFieldType( WorkNode->FieldNo ) == 'F' ) WorkNode->DoubResult = WorkNode->dbf->GetDoubleField( WorkNode->FieldNo, RecBufSw ); } else if( WorkNode->Type == 'O' ) { if(( rc = ProcessOperator( RecBufSw )) != XB_NO_ERROR ) return rc; } else if( WorkNode->Type == 'F' ) if(( rc = ProcessFunction( WorkNode->NodeText )) != XB_NO_ERROR ) return rc; WorkNode = GetNextTreeNode( WorkNode ); } if( GetStackDepth() != 1 ) /* should only have result left in stack */ xb_error(XB_PARSE_ERROR); return XB_NO_ERROR; } /*************************************************************************/ //! Short description /*! \param e */ char xbExpn::GetOperandType( xbExpNode * e ) { /* this routine returns L - logical N - Numeric C - Character 0 - error */ char WorkType; if( e->Type == 'd' || e->Type == 'N' || e->Type == 'i' ) return 'N'; if( e->Type == 'l' ) return 'L'; if( e->Type == 's' ) return 'C'; if( e->Type == 'C' ) { if(e->NodeText[0]=='-' || e->NodeText[0]=='+' || (isdigit(e->NodeText[0]) && !(e->NodeText[e->DataLen] == '\'' || e->NodeText[e->DataLen] == '"')) ) return 'N'; else return 'C'; } else if( e->Type == 'D' && e->dbf ) { WorkType = e->dbf->GetFieldType( e->FieldNo ); if( WorkType == 'C' ) return 'C'; else if( WorkType == 'F' || WorkType == 'N' ) return 'N'; else if( WorkType == 'L' ) return 'L'; else return 0; } else return 0; } /*************************************************************************/ //! Short description /*! \param RecBufSw */ xbShort xbExpn::ProcessOperator( xbShort RecBufSw ) { xbExpNode * WorkNode; char Operator[6 /*3*/]; // changed for logical ops 3/26/00 dtb char t; if( GetStackDepth() < 3 ) xb_error(XB_PARSE_ERROR); WorkNode = (xbExpNode *) Pop(); if( WorkNode->Len > 5 /*2*/) // changed for logical ops 3/26/00 dtb { //printf("WorkNode->Len = %d\n", WorkNode->Len); xb_error(XB_PARSE_ERROR); } memset( Operator, 0x00, 6 /*3*/ ); // changed for logical ops 3/26/00 dtb strncpy( Operator, WorkNode->NodeText, WorkNode->Len ); //printf("Operator = '%s'\n", Operator); if( !WorkNode->InTree ) delete WorkNode; /* load up operand 1 */ WorkNode = (xbExpNode *) Pop(); //printf("Operand 1 WorkNode->Type = '%c'\n", WorkNode->Type); if(( OpType1 = GetOperandType( WorkNode )) == 0 ) xb_error(XB_PARSE_ERROR); if( OpLen1 < WorkNode->DataLen+1 && WorkNode->Type != 'd' ) { if( OpLen1 > 0 ) free( Op1 ); if(( Op1 = (char *) malloc( WorkNode->DataLen+1 )) == NULL ) { xb_memory_error; } OpLen1 = WorkNode->DataLen+1; } OpDataLen1 = WorkNode->DataLen; memset( Op1, 0x00, WorkNode->DataLen+1 ); if( WorkNode->Type == 'D' && WorkNode->dbf ) { /* database field */ WorkNode->dbf->GetField( WorkNode->FieldNo, Op1, RecBufSw ); t = WorkNode->dbf->GetFieldType( WorkNode->FieldNo ); if( t == 'N' || t == 'F' ) Opd1 = strtod( WorkNode->StringResult, 0 ); } else if( WorkNode->Type == 'C' ) /* constant */ memcpy( Op1, WorkNode->NodeText, WorkNode->DataLen ); else if( WorkNode->Type == 's' ) /* previous result */ memcpy( Op1, WorkNode->StringResult, WorkNode->DataLen+1 ); else if( WorkNode->Type == 'd' ) /* previous numeric result */ Opd1 = WorkNode->DoubResult; else if( WorkNode->Type == 'N' ) /* previous numeric result */ Opd1 = strtod( WorkNode->StringResult, 0 ); else if(WorkNode->Type == 'l') /* previous logical result 3/26/00 dtb */ Opd1 = WorkNode->IntResult; if( !WorkNode->InTree ) delete WorkNode; /* load up operand 2 */ WorkNode = (xbExpNode *) Pop(); //printf("Operand 2 WorkNode->Type = '%c'\n", WorkNode->Type); if(( OpType2 = GetOperandType( WorkNode )) == 0 ) xb_error(XB_PARSE_ERROR); if( OpLen2 < WorkNode->DataLen+1 && WorkNode->Type != 'd' ) { if( OpLen2 > 0 ) free( Op2 ); if(( Op2 = (char *) malloc( WorkNode->DataLen+1 )) == NULL ) { xb_memory_error; } OpLen2 = WorkNode->DataLen+1; } OpDataLen2 = WorkNode->DataLen; memset( Op2, 0x00, WorkNode->DataLen+1 ); if( WorkNode->Type == 'D' && WorkNode->dbf ) { /* database field */ WorkNode->dbf->GetField( WorkNode->FieldNo, Op2, RecBufSw ); t = WorkNode->dbf->GetFieldType( WorkNode->FieldNo ); if( t == 'N' || t == 'F' ) Opd2 = strtod( WorkNode->StringResult, 0 ); } else if( WorkNode->Type == 'C' ) /* constant */ memcpy( Op2, WorkNode->NodeText, WorkNode->DataLen ); else if( WorkNode->Type == 's' ) /* previous result */ memcpy( Op2, WorkNode->StringResult, WorkNode->DataLen+1 ); else if( WorkNode->Type == 'd' ) /* previous numeric result */ Opd2 = WorkNode->DoubResult; else if( WorkNode->Type == 'N' ) /* previous numeric result */ Opd2 = strtod( WorkNode->StringResult, 0 ); else if(WorkNode->Type == 'l') /* previous logical result 3/26/00 dtb*/ Opd2 = WorkNode->IntResult; if( !WorkNode->InTree ) delete WorkNode; if( !ValidOperation( Operator, OpType1, OpType2 )) xb_error(XB_PARSE_ERROR); if( OpType1 == 'N' || OpType1 == 'L') /* numeric procesing */ { return NumericOperation( Operator ); } else /* must be character */ return AlphaOperation( Operator ); } /*************************************************************************/ //! Short description /*! \param Operator */ xbShort xbExpn::NumericOperation( char * Operator ) { xbDouble Operand1, Operand2; xbExpNode * WorkNode; xbShort ResultLen; char SaveType; ResultLen = 0; //printf("NumericOperation(%s)\n", Operator); if( Operator[0] == '=' || Operator[0] == '<' || Operator[0] == '>' || Operator[0] == '#' || Operator[0] == '.') SaveType = 'l'; else SaveType = 'd'; if(( WorkNode = GetExpNode( ResultLen )) == NULL ) xb_error(XB_PARSE_ERROR); WorkNode->Type = SaveType; WorkNode->DataLen = ResultLen; if( OpType1 == 'd' || OpType1 == 'N' ) Operand1 = Opd1; else Operand1 = strtod( Op1, NULL ); if( OpType2 == 'd' || OpType2 == 'N' ) Operand2 = Opd2; else Operand2 = strtod( Op2, NULL ); if( Operator[0] == '*' && Operator[1] == '*' ) WorkNode->DoubResult = pow( Operand2, Operand1 ); else if( Operator[0] == '*' ) WorkNode->DoubResult = Operand2 * Operand1; else if( Operator[0] == '/') WorkNode->DoubResult = Operand2 / Operand1; else if( Operator[0] == '+' ) WorkNode->DoubResult = Operand2 + Operand1; else if( Operator[0] == '-' ) WorkNode->DoubResult = Operand2 - Operand1; /* = */ else if((Operator[0]== '=' || Operator[1]== '=' ) && Operand1 == Operand2) WorkNode->IntResult = 1; else if( Operator[0] == '=' ) WorkNode->IntResult = 0; /* not = */ else if((Operator[0] == '<' && Operator[1] == '>')||Operator[0] == '#') { if( Operand1 != Operand2 ) WorkNode->IntResult = 1; else WorkNode->IntResult = 0; } /* less than */ else if( Operator[0] == '<' ) { if( Operand2 < Operand1 ) WorkNode->IntResult = 1; else WorkNode->IntResult = 0; } /* greater than */ else if( Operator[0] == '>' ) { if( Operand2 > Operand1 ) WorkNode->IntResult = 1; else WorkNode->IntResult = 0; } else if(Operator[0] == '.') // logical operators, added 3/26/00 dtb { //printf("Operand1 = %d, Operand2 = %d\n", Operand1, Operand2); switch(Operator[1]) { case 'A' : // and WorkNode->IntResult = (Opd1 && Opd2) ? 1 : 0; break; case 'N' : // not WorkNode->IntResult = (!(Opd1 && Opd2)) ? 1 : 0; break; case 'O' : // or WorkNode->IntResult = (Opd1 || Opd2) ? 1 : 0; break; default : xb_error(XB_PARSE_ERROR); } } else xb_error(XB_PARSE_ERROR); Push((void *) WorkNode ); return 0; } /*************************************************************************/ //! Short description /*! \param Operator */ xbShort xbExpn::AlphaOperation( char * Operator ) { xbShort ResultLen, i; char SaveType; xbExpNode * WorkNode; //printf("AlphaOperation(%s): Op1 = '%*s', Op2 = '%*s'\n", Operator, // OpDataLen1, Op1, OpDataLen2, Op2); if( Operator[0] == '=' || Operator[0] == '<' || Operator[0] == '>' || Operator[0] == '#' || Operator[0] == '$') { ResultLen = 0; SaveType = 'l'; } else { ResultLen = OpDataLen1 + OpDataLen2 + 1; SaveType = 's'; } if(( WorkNode = GetExpNode( ResultLen )) == NULL ) xb_error(XB_PARSE_ERROR); WorkNode->Type = SaveType; if( WorkNode->Type == 'l' ) WorkNode->DataLen = 0; else WorkNode->DataLen = ResultLen - 1; if( Operator[0] == '+' ) { WorkNode->StringResult = Op2; WorkNode->StringResult += Op1; } else if( Operator[0] == '-' ) { WorkNode->StringResult = LTRIM( Op2 ); WorkNode->StringResult += Op1; i = WorkNode->StringResult.len(); for( ; i < ResultLen-1; i++) WorkNode->StringResult += " "; } /* = */ else if((Operator[0]== '=' || Operator[1]== '=' ) && strcmp(Op1,Op2) == 0) WorkNode->IntResult = 1; else if( Operator[0] == '=' ) WorkNode->IntResult = 0; /* not = */ else if((Operator[0] == '<' && Operator[1] == '>')||Operator[0] == '#') { if( strcmp( Op1, Op2 ) != 0 ) WorkNode->IntResult = 1; else WorkNode->IntResult = 0; } /* less than */ else if( Operator[0] == '<' ) { if( strcmp( Op2, Op1 ) < 0 ) WorkNode->IntResult = 1; else WorkNode->IntResult = 0; } /* greater than */ else if( Operator[0] == '>' ) { if( strcmp( Op2, Op1 ) > 0 ) WorkNode->IntResult = 1; else WorkNode->IntResult = 0; } // contains, added 3/26/00 dtb else if(Operator[0] == '$') { if(strstr(Op2, Op1)) WorkNode->IntResult = 1; else WorkNode->IntResult = 0; } else xb_error(XB_PARSE_ERROR); //printf("WorkNode->IntResult = %d\n", WorkNode->IntResult); Push((void *) WorkNode); return XB_NO_ERROR; } /*************************************************************************/ #endif // XB_EXPRESSIONS xbase-2.0.0/xbase/fields.cpp0000644000000000000000000005051607234452760011336 /* $Id: fields.cpp,v 1.8 2001/01/27 05:00:32 dbryson Exp $ Xbase project source code This file contains the basic X-Base routines for reading and writing Xbase fields. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added Dbase IV Memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.4b 7/2/98 - Changed gcvt to sprintf for portability reasons - PS 9/29/98 - Added GetLogicalField() 10/7/98 - Modified PutFloatField - was broke V 1.8 11/30/98 - Version 1.8 upgrade - additional PutFloat Field fix */ #ifdef __WIN32__ #include #else #include #endif #include #include #include #include /*! \file fields.cpp */ /************************************************************************/ /* This function returns true if the data is valid logical data */ //! Determines if data is valid logical data. /*! Determines if the data in buf is valid for a logical field value. \param buf data to be tested \returns TRUE (non-zero) if valid, FALSE (zero) if not. */ xbShort xbDbf::ValidLogicalData(const char * buf) { if( buf[0] ) if( buf[0] == 'T' || buf[0] == 't' || buf[0] == 'F' || buf[0] == 'f' || buf[0] == 'Y' || buf[0] == 'y' || buf[0] == 'N' || buf[0] == 'n' || buf[0] == '?' ) return 1; return 0; } /************************************************************************/ /* This function returns true if the data is valid numeric data */ //! Determines if data is valid numeric data. /*! Determines if the data in buf is valid for a numeric field value. \param buf \returns TRUE (non-zero) if valid, FALSE (zero) if not. */ xbShort xbDbf::ValidNumericData(const char * buf) { const char *p; p = buf; while( *p ) { if( *p != '+' && *p != '-' && *p != '.' && *p != '0' && *p != '1' && *p != '2' && *p != '3' && *p != '4' && *p != '5' && *p != '6' && *p != '7' && *p != '8' && *p != '9' ) return 0; else p++; } return 1; } /************************************************************************/ /* This function returns a fields length */ //! Returns the length of the specified field. /*! Returns the length of the field specified by FieldNo. \param FieldNo Number of field. \returns Length of the specified field in bytes. */ xbShort xbDbf::GetFieldLen( const xbShort FieldNo ) { if( FieldNo >= 0 && FieldNo < NoOfFields ) { if( SchemaPtr[FieldNo].Type == 'C' && SchemaPtr[FieldNo].NoOfDecs > 0 ) return SchemaPtr[FieldNo].LongFieldLen; else return SchemaPtr[FieldNo].FieldLen; } else return 0; } /************************************************************************/ /* This function returns a fields decimal length */ //! Returns the number of decimals in the specified field. /*! Returns the number decimals in the field specified by FieldNo. \param FieldNo Number of field. \returns Number of decimals in the specified field. */ xbShort xbDbf::GetFieldDecimal( const xbShort FieldNo ) { if( FieldNo >= 0 && FieldNo < NoOfFields ) return SchemaPtr[FieldNo].NoOfDecs; else return 0; } /************************************************************************/ /* This function returns a fields type */ //! Returns the type of the specified field. /*! Returns the type of the field specified by FieldNo. \param FieldNo Number of field. \returns Type of specified field. */ char xbDbf::GetFieldType( const xbShort FieldNo ) const { if( FieldNo >= 0 && FieldNo < NoOfFields ) return SchemaPtr[FieldNo].Type; else return 0; } /************************************************************************/ /* This function returns a fields name */ //! Returns the name of the specified field. /*! Returns a pointer to the name for the field specified by FieldNo. \param FieldNo Number of field. \returns A pointer to the name of the field. */ char * xbDbf::GetFieldName( const xbShort FieldNo ) { if( FieldNo >= 0 && FieldNo < NoOfFields ) return SchemaPtr[FieldNo].FieldName; else return 0; } /************************************************************************/ /* This function returns the field ID number for a given field or -1 if the field is not one of the fields of the database */ //! Returns the field number of the specified field. /*! Returns the field number for the named field. \param name Name of field. \returns Number of field named name. */ xbShort xbDbf::GetFieldNo( const char * name ) const { int i, len1, len2; if(( len1 = strlen( name )) > 10 ) return -1; for( i = 0; i < NoOfFields; i++ ) { len2 = strlen( SchemaPtr[i].FieldName ); if( len1 == len2 ) // if( strstr( SchemaPtr[i].FieldName, name )) return i; #ifndef __WIN32__ if(!strcasecmp( SchemaPtr[i].FieldName, name )) #else if(!stricmp( SchemaPtr[i].FieldName, name )) #endif return i; } return -1; } /************************************************************************/ /* Helpers */ //! Get the value of the specified field. /*! Get the value of the field referenced by Name and place its value in buf. \param Name Name of field. \param buf Buffer to hold field value. Must be large enough to hold the entire field value. Use GetFieldLen() to determine the length of the field, if necessary. \param RecBufSw \returns One of the following: */ xbShort xbDbf::GetField(const char *Name, char *buf, const xbShort RecBufSw ) const { return GetField(GetFieldNo(Name), buf, RecBufSw); } //! Get the value of the specified field. /*! Get the value of the field specified by Name and place its value in buf. \param Name Name of field. \param buf Buffer to hold field value. Must be large enough to hold the entire field value. Use GetFieldLen() to determine the length of the field, if necessary. \returns One of the following: */ xbShort xbDbf::GetField(const char *Name, char *buf) const { return GetField(GetFieldNo(Name), buf); } //! Get the raw value of the specified field. /*! Get the value of the field specified by Name and place its value in buf. \param Name Name of field. \param buf Buffer to hold field value. Must be large enough to hold the entire field value. Use GetFieldLen() to determine the length of the field, if necessary. \returns One of the following: */ xbShort xbDbf::GetRawField(const char *Name, char *buf) const { return GetRawField(GetFieldNo(Name), buf); } static char __buf[1024]; static void trim(char *s) { int len = strlen(s)-1; if (len > 0) { while ((len != 0) && (s[len] == ' ')) len--; s[len+1] = 0; } } //! Get the value of the specified field. /*! Returns the value of the field specified by Name. \param Name Name of field. \returns Value of the specified field. */ const char *xbDbf::GetField(const char *Name) const { GetField(GetFieldNo(Name), __buf); trim(__buf); return __buf; } //! Get the value of the specified field. /*! Returns the value of the field specified by FieldNo. \param FieldNo Number of field. \returns Value of the specified field. */ const char *xbDbf::GetField(xbShort FieldNo) const { GetField(FieldNo, __buf); trim(__buf); return __buf; } /************************************************************************/ /* This function fills a buffer with data from the record buffer for a particular field number. Use GetFieldNo to get a number based on a field's name If successful, this function returns the field size. */ //! Get the value of the specified field. /*! Get the value of the field specified by FieldNo and place its value in buf. \param FieldNo Number of field. \param buf Buffer to hold field value. Must be large enough to hold the entire field value. Use GetFieldLen() to determine the length of the field, if necessary. \param RecBufSw \returns The length of the field. */ xbShort xbDbf::GetField(const xbShort FieldNo, char * buf, const xbShort RecBufSw) const { xbShort length = 0; if( FieldNo < 0 || FieldNo >= NoOfFields ) { #ifdef HAVE_EXCEPTIONS xb_error(XB_INVALID_FIELDNO); #else buf[0] = 0x00; return 0x00; #endif } // Check for existence of a long field length if( SchemaPtr[FieldNo].Type == 'C' && SchemaPtr[FieldNo].NoOfDecs > 0 ) length = SchemaPtr[FieldNo].LongFieldLen; else length = SchemaPtr[FieldNo].FieldLen; if( RecBufSw ) memcpy( buf, SchemaPtr[FieldNo].Address2, length ); else memcpy( buf, SchemaPtr[FieldNo].Address, length ); buf[length] = 0x00; return( length ); } /************************************************************************/ xbShort xbDbf::GetField(const xbShort FieldNo, xbString & sf, const xbShort RecBufSw) const { xbShort length = 0; if( FieldNo < 0 || FieldNo >= NoOfFields ) { #ifdef HAVE_EXCEPTIONS sf = ""; xb_error(XB_INVALID_FIELDNO); #else sf = ""; return 0; #endif } // Check for existence of a long field length if( SchemaPtr[FieldNo].Type == 'C' && SchemaPtr[FieldNo].NoOfDecs > 0 ) length = SchemaPtr[FieldNo].LongFieldLen; else length = SchemaPtr[FieldNo].FieldLen; if( RecBufSw ) sf.assign( xbString(SchemaPtr[FieldNo].Address2, length), 0, length ); // sf.assign( SchemaPtr[FieldNo].Address2, length ); else sf.assign( xbString(SchemaPtr[FieldNo].Address, length), 0, length ); // sf.assign( SchemaPtr[FieldNo].Address, length ); return( length ); } /************************************************************************/ /* This function fills a field in the record buffer with data from a buffer for a particular field. Use GetFieldNo to get a number based on a field's name Field type N or F is loaded as right justified, left blank filled. Other fields are loaded as left justified, right blank filled. This method does check the data's validity. If successful, this function returns 0, if invalid data, it returns -1 or XB_INVALID_FIELDNO */ //! Put a value into the specified field. /*! */ xbShort xbDbf::PutField(const char *Name, const char *buf) { return PutField(GetFieldNo(Name), buf); } //! Put a raw value into the specified field. /*! */ xbShort xbDbf::PutRawField(const char *Name, const char *buf) { return PutRawField(GetFieldNo(Name), buf); } //! Put a value into the specified field. /*! */ xbShort xbDbf::PutField(const xbShort FieldNo, const char *buf) { xbShort len, i; char * startpos; char * tp; /* target pointer */ const char * sp; /* source pointer */ if( FieldNo < 0 || FieldNo >= NoOfFields ) xb_error(XB_INVALID_FIELDNO); if( DbfStatus != XB_UPDATED ) { DbfStatus = XB_UPDATED; memcpy( RecBuf2, RecBuf, RecordLen ); } if( SchemaPtr[FieldNo].Type == 'L' && !ValidLogicalData( buf )) xb_error(XB_INVALID_DATA) else if(( SchemaPtr[FieldNo].Type == 'F' || SchemaPtr[FieldNo].Type == 'N' ) && !ValidNumericData( buf )) xb_error(XB_INVALID_DATA) else if( SchemaPtr[FieldNo].Type == 'D' ){ xbDate d; if( !d.DateIsValid( buf )) xb_error(XB_INVALID_DATA); } if( SchemaPtr[FieldNo].Type == 'C' && SchemaPtr[FieldNo].NoOfDecs > 0 ) memset( SchemaPtr[FieldNo].Address, 0x20, SchemaPtr[FieldNo].LongFieldLen ); else memset( SchemaPtr[FieldNo].Address, 0x20, SchemaPtr[FieldNo].FieldLen ); len = strlen( buf ); if(( SchemaPtr[FieldNo].Type == 'N' || SchemaPtr[FieldNo].Type == 'F') && len > SchemaPtr[FieldNo].FieldLen ) xb_error(XB_INVALID_DATA) else if( len > SchemaPtr[FieldNo].FieldLen ) len = SchemaPtr[FieldNo].FieldLen; if( SchemaPtr[FieldNo].Type == 'F' || SchemaPtr[FieldNo].Type == 'N' || SchemaPtr[FieldNo].Type == 'M' ) { const char *sdp = strchr( buf, '.' ); /* source decimal point */ len = 0; sp =buf; while( *sp && *sp != '.' ) { len++; sp++; } if( SchemaPtr[FieldNo].NoOfDecs > 0 ) { /* do the right of decimal area */ tp = SchemaPtr[FieldNo].Address; tp += SchemaPtr[FieldNo].FieldLen - SchemaPtr[FieldNo].NoOfDecs - 1; *tp++ = '.'; sp = sdp; if( sp ) sp++; for( i = 0; i < SchemaPtr[FieldNo].NoOfDecs; i++ ) if( sp && *sp ) *tp++ = *sp++; else *tp++ = '0'; startpos= SchemaPtr[FieldNo].Address + SchemaPtr[FieldNo].FieldLen - SchemaPtr[FieldNo].NoOfDecs - len - 1; } else { startpos=SchemaPtr[FieldNo].Address+SchemaPtr[FieldNo].FieldLen-len; } } else startpos = SchemaPtr[FieldNo].Address; memcpy( startpos, buf, len ); return 0; } //! Put a raw value into the specified field. /*! */ xbShort xbDbf::PutRawField(const xbShort FieldNo, const char *buf) { xbShort len; char * startpos; if( FieldNo < 0 || FieldNo >= NoOfFields ) xb_error(XB_INVALID_FIELDNO); if( DbfStatus != XB_UPDATED ) { DbfStatus = XB_UPDATED; memcpy( RecBuf2, RecBuf, RecordLen ); } startpos = SchemaPtr[FieldNo].Address; len = SchemaPtr[FieldNo].FieldLen; memcpy( startpos, buf, len ); return 0; } /************************************************************************/ //! Get the value of the specified field. /*! */ xbShort xbDbf::GetField(const xbShort FieldNo, char *buf) const { return GetField(FieldNo, buf, 0); } /************************************************************************/ //! Get the raw value of the specified field. /*! */ xbShort xbDbf::GetRawField(const xbShort FieldNo, char *buf) const { return GetField(FieldNo, buf, 0); } /************************************************************************/ //! Get the long value of the specified field. /*! */ xbLong xbDbf::GetLongField( const xbShort FieldNo ) const { char buf[18]; memset( buf, 0x00, 18 ); GetField( FieldNo, buf ); return atol( buf ); } /************************************************************************/ //! Get the long value of the specified field. /*! */ xbLong xbDbf::GetLongField( const char * FieldName ) const { return( GetLongField( GetFieldNo( FieldName ))); } /************************************************************************/ //! Put a long value into the specified field. /*! */ xbShort xbDbf::PutLongField( const xbShort FieldNo, const xbLong Val ) { char buf[18]; memset( buf, 0x00, 18 ); sprintf( buf, "%ld", Val ); return( PutField( FieldNo, buf )); } /************************************************************************/ //! Put a long value into the specified field. /*! */ xbShort xbDbf::PutLongField(const char *FieldName, const xbLong Val) { return (PutLongField(GetFieldNo(FieldName), Val)); } /************************************************************************/ //! Get the float value of the specified field. /*! */ xbFloat xbDbf::GetFloatField(const xbShort FieldNo) { char buf[21]; memset( buf, 0x00, 21 ); if( GetField( FieldNo, buf ) != 0 ) return atof( buf ); else return 0; } /************************************************************************/ //! Get the float value of the specified field. /*! */ xbFloat xbDbf::GetFloatField(const char * FieldName) { xbShort fnum; if ((fnum = GetFieldNo(FieldName)) != -1) return GetFloatField(fnum); else return 0; } /************************************************************************/ //! Put a float value into the specified field. /*! */ xbShort xbDbf::PutFloatField( const xbShort FldNo, const xbFloat f ) { char buf[25]; char buf2[12]; memset( buf, 0x00, 25 ); memset( buf2, 0x00, 12 ); sprintf( buf, "%d.%df", GetFieldLen( FldNo ), GetFieldDecimal( FldNo )); strcpy( buf2, "%-" ); strcat( buf2, buf ); sprintf( buf, buf2, f ); /* remove trailing space */ xbShort i = 0; while( i < 25 ) if( buf[i] == 0x20 ){ buf[i] = 0x00; break; } else i++; return PutField( FldNo, buf ); } /************************************************************************/ //! Put a float value into the specified field. /*! */ xbShort xbDbf::PutFloatField(const char *FieldName, const xbFloat f) { xbShort fnum; if ((fnum = GetFieldNo(FieldName)) != -1) return PutFloatField(fnum, f); else return 0; } /************************************************************************/ //! Get the double value of the specified field. /*! */ xbDouble xbDbf::GetDoubleField( const xbShort FieldNo, xbShort RecBufSw ) { char buf[21]; memset( buf, 0x00, 21 ); if( GetField( FieldNo, buf, RecBufSw ) != 0 ) return strtod( buf, NULL ); else return 0; } /************************************************************************/ //! Get the double value of the specified field. /*! */ xbDouble xbDbf::GetDoubleField(const char *FieldName) { xbShort fnum; if ((fnum = GetFieldNo(FieldName)) != -1) return GetDoubleField(fnum); else return 0; } /************************************************************************/ //! Put a double value into the specified field. /*! */ xbShort xbDbf::PutDoubleField( const xbShort FieldNo, const xbDouble d) { return PutFloatField(FieldNo, (xbFloat)d); } /************************************************************************/ //! Put a double value into the specified field. /*! */ xbShort xbDbf::PutDoubleField(const char *FieldName, const xbDouble d) { xbShort fnum; if ((fnum = GetFieldNo(FieldName)) != -1) return PutFloatField(fnum, (xbFloat)d); else return 0; } /************************************************************************/ //! Get the logical value of the specified field. /*! */ xbShort xbDbf::GetLogicalField( const xbShort FieldNo ) { char buf[3]; if( GetFieldType( FieldNo ) != 'L' ) return -1; memset( buf, 0x00, 3 ); GetField( FieldNo, buf ); if( buf[0] == 'Y' || buf[0] == 'y' || buf[0] == 'T' || buf[0] == 't' ) return 1; else return 0; } /************************************************************************/ //! Get the logical value of the specified field. /*! */ xbShort xbDbf::GetLogicalField( const char * FieldName ) { xbShort fnum; if(( fnum = GetFieldNo( FieldName )) != -1 ) return GetLogicalField( fnum ); else return -1; } /************************************************************************/ //! Get the string value of the specified field. /*! */ char * xbDbf::GetStringField( const char * FieldName ) { return GetStringField(GetFieldNo(FieldName)); } /************************************************************************/ //! Get the string value of the specified field. /*! */ char * xbDbf::GetStringField( const xbShort FieldNo ) { /* allocate memory if needed */ if( !SchemaPtr[FieldNo].fp ) SchemaPtr[FieldNo].fp = new char[GetFieldLen(FieldNo)+1]; if( !SchemaPtr[FieldNo].fp ) #ifdef HAVE_EXCEPTIONS throw xbOutOfMemoryException(); #else return 0; #endif GetField( FieldNo, SchemaPtr[FieldNo].fp ); return SchemaPtr[FieldNo].fp; } /************************************************************************/ xbase-2.0.0/xbase/html.cpp0000644000000000000000000003376607203043261011030 /* $Id: html.cpp,v 1.6 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains the basic Xbase routines for creating html Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.4.c 7/7/98 - Continued development on GenFormFields method */ #ifdef __GNUG__ #pragma implementation "html.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #ifdef XB_HTML #include #include #include #include #include #include /* BSDI BSD/OS 3.1 */ #include /*! \file html.cpp */ /************************************************************************/ //! Short description /*! \param String */ void xbHtml::TextOut( const char * String ) { cout << String; } /************************************************************************/ //! Short description /*! */ void xbHtml::InitVals( void ) { FieldNameArray = NULL; DataValueArray = NULL; NoOfDataFields = 0; HtmlBufLen = 0; HtmlWorkBuf = NULL; LoadArray(); } /************************************************************************/ //! Short description /*! */ xbHtml::xbHtml( void ) { InitVals(); } /************************************************************************/ //! Short description /*! */ void xbHtml::DumpArray( void ) { /* dont forget Content-type */ xbShort i; if( NoOfDataFields == 0 ) cout << "No Input Data From Form\n"; else { cout << "There are " << NoOfDataFields << " fields"; cout << "
" << NoOfDataFields << " Field Name / Data Values received\n"; cout << "
-----------------------------------\n"; for( i = 0; i < NoOfDataFields; i++ ) { cout << "
" << FieldNameArray[i] << " => "; // PrintEncodedString( DataValueArray[i] ); if( DataValueArray[i] ) cout << DataValueArray[i]; } } } /***********************************************************************/ //! Short description /*! \param pos */ char * xbHtml::GetData( xbShort pos ) { if( pos < NoOfDataFields && pos >= 0 ) return DataValueArray[pos]; else return NULL; } /************************************************************************/ //! Short description /*! \param FieldName */ xbShort xbHtml::GetArrayNo( const char * FieldName ) { xbShort i; for( i = 0; i < NoOfDataFields; i++ ) if( strcmp( FieldName, FieldNameArray[i] ) == 0 ) return i; return -1; } /************************************************************************/ //! Short description /*! \param FieldName */ char * xbHtml::GetDataForField( const char * FieldName ) { return( GetData( GetArrayNo( FieldName ))); } /************************************************************************/ //! Short description /*! */ void xbHtml::LoadArray( void ) { xbShort Len; /* length of data string from form */ xbShort Len1, Len2; /* tokenized string lengths */ xbShort i; char *FormData; /* actual data from form */ char *QueryStringPtr; char *Token; char **Names, **Values; if( !getenv( "REQUEST_METHOD" )) return; /* put the input data into field FormData */ if( !strcmp( "POST", getenv( "REQUEST_METHOD" ))) { if(( Len = atoi( getenv( "CONTENT_LENGTH" ))) == 0 ) return; FormData = (char *) malloc( sizeof( char ) * ( Len + 1 )); fgets( FormData, Len+1, stdin ); } else /* GET */ { if(( QueryStringPtr = getenv( "QUERY_STRING" )) == NULL ) return; Len = strlen( QueryStringPtr ); if( Len == 0 ) return; FormData = (char *) malloc( sizeof( char ) * ( Len + 1 )); strcpy( FormData, QueryStringPtr ); } /* count the number of data fields, & is the field separator */ Token = strchr( FormData, '&' ); NoOfDataFields++; while( Token != NULL ) { NoOfDataFields++; Token++; Token = strchr( Token, '&' ); } Names = (char **)malloc(sizeof(char*)*NoOfDataFields); Values = (char **)malloc(sizeof(char*)*NoOfDataFields); for( i =0, Token=strtok(FormData, "&"); Token != NULL; i++ ) { Len1 = strlen( Token ); Len2 = strcspn( Token, "=" ); Names[i] = (char *) malloc( sizeof(char) * (Len2 + 1)); strncpy( Names[i], Token, Len2 ); Names[i][Len2] = 0x00; DeleteEscChars( Names[i] ); if( Len1 != Len2+1 ) { Values[i] = (char *)malloc(sizeof(char) * (Len1 - Len2)); strcpy( Values[i], Token+Len2+1 ); DeleteEscChars( Values[i] ); } else /* no data for field name=& */ Values[i] = NULL; Token = strtok( NULL, "&" ); } free( FormData ); FieldNameArray = Names; DataValueArray = Values; } /************************************************************************/ //! Short description /*! \param String */ void xbHtml::DeleteEscChars( char * String ) { xbShort s,t; /* source && target */ char HexVal[3]; xbShort EscCnt = 0; for( s=0, t=0; String[s]; s++, t++ ) { if( String[s] == '+' ) String[t] = ' '; else if( String[s] == '%' ) { HexVal[0] = String[s+1]; HexVal[1] = String[s+2]; HexVal[2] = 0x00; String[t] = strtol( HexVal, NULL, 16 ); s+=2; EscCnt++; } else String[t] = String[s]; } for( t = strlen( String ) - 1; t > 1 && EscCnt > 0; t-=2, EscCnt-- ) { String[t] = 0x20; String[t-1] = 0x20; } } /************************************************************************/ //! Short description /*! \param File */ xbLong xbHtml::Tally( const char * File ) { /* FIXME: Locking works under Unix only: does not warrant fcntl() Noticed with Borland 4.5. Current workaround effectively disables locking even with XB_LOCKING_ON -- willy */ /* must have write access to the directory for this routine to work */ #if defined(HAVE_FCNTL) && defined(XB_LOCKING_ON) struct flock fl; #endif xbLong cnt; FILE *f; xbShort rc; if(( f = fopen( File, "r+" )) == NULL ) { /* land here if file does not exist - initialize it */ if(( f = fopen( File, "w+" )) == NULL ) return 0L; rc = fprintf( f, "%08lu\n", 1L ); fclose( f ); if( rc == EOF ) return 0L; else return 1L; } /* lock the file */ #if defined(HAVE_FCNTL) && defined(XB_LOCKING_ON) fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; fl.l_start = 0L; fl.l_len = 1L; fcntl( fileno( f ), F_SETLKW, &fl ); #endif fseek( f, 0L, SEEK_SET ); fscanf( f, "%08lu", &cnt ); fseek( f, 0L, SEEK_SET ); rc = fprintf( f, "%08lu\n", ++cnt ); /* unlock the file */ #if defined(HAVE_FCNTL) && defined(XB_LOCKING_ON) fl.l_type = F_UNLCK; fcntl( fileno( f ), F_SETLKW, &fl ); #endif fclose( f ); return cnt; } /************************************************************************/ //! Short description /*! */ xbShort xbHtml::PostMethod( void ) { char s[5]; xbShort i; if( !getenv( "REQUEST_METHOD" )) return 0; else { memset( s, 0x00, 5 ); strncpy( s, getenv( "REQUEST_METHOD" ), 4 ); for( i = 0; i < 5; i++) s[i] = toupper( s[i] ); if( strcmp( s, "POST" ) == 0 ) return 1; } return 0; } /************************************************************************/ //! Short description /*! */ xbShort xbHtml::GetMethod( void ) { char s[4]; xbShort i; if( !getenv( "REQUEST_METHOD" )) return 0; else { memset( s, 0x00, 4 ); strncpy( s, getenv( "REQUEST_METHOD" ), 3 ); for( i = 0; i < 4; i++) s[i] = toupper( s[i] ); if( strcmp( s, "GET" ) == 0 ) return 1; } return 0; } /************************************************************************/ //! Short description /*! \param d \param Option \param Title \param fl */ xbShort xbHtml::GenFormFields(xbDbf *d, xbShort Option, const char *Title, xbFieldList *fl) { xbShort i; char buf[255]; cout << "\n"; if( Title ) cout << "\n
"; i = 0; while( fl[i].FieldLen != 0 ) { cout << "\n
" << Title << "
" << fl[i].Label; if( fl[i].Option == 2 ) { if( !d ) xb_error(XB_NOT_OPEN); d->GetField( fl[i].FieldNo, buf ); cout << "" << buf; } else { cout << ""; } i++; } cout << "\n
"; return XB_NO_ERROR; } /************************************************************************/ //! Short description /*! \param Title */ void xbHtml::StartHtmlPage( const char * Title ) { cout << "Content-type: text/html\n\n"; cout << "\n" << Title << ""; } /************************************************************************/ //! Short description /*! \param c */ void xbHtml::PrintEncodedChar( char c ) { switch( c ) { case '<': cout << "<"; break; case '>': cout << ">"; break; case '&': cout << "&"; break; case '"': cout << """; break; default: cout << c; break; } return; } /************************************************************************/ //! Short description /*! \param s */ void xbHtml::PrintEncodedString( const char * s ) { const char *p; p = s; while( *p ) PrintEncodedChar( *p++ ); return; } /************************************************************************/ //! Short description /*! \param Name \param Value \param ExpDate \param ExpTime \param TimeZone \param Path \param Domain \param Secure */ xbShort xbHtml::SetCookie( const char * Name,const char * Value, const char * ExpDate, const char * ExpTime, const char * TimeZone, const char * Path, const char * Domain, xbShort Secure ) { if( ( !Name || !Value ) || ( ExpDate && !TimeZone) ) xb_error(XB_INVALID_OPTION); cout << "\nSet-Cookie: " << Name << "=" << Value << ";"; if( ExpDate ) { cout << ExpDate << ";"; if( ExpTime ) cout << ExpTime; else cout << "00:00:00"; cout << TimeZone << ";"; } if( Path ) cout << "\nPath=" << Path << ";"; if( Domain ) cout << "domain=" << Domain << ";"; if( Secure ) cout << "Secure"; cout << "\n"; return XB_NO_ERROR; } /************************************************************************/ //! Short description /*! \param String */ void xbHtml::SpaceToPlus( char * String ) { char * p; p = String; while( *p ) { if( *p == ' ' ) *p = '+'; p++; } /* eliminate trailing white space */ p--; while( *p == '+' && p > String ) { *p = 0x00; p--; } } /************************************************************************/ //! Short description /*! \param url */ void xbHtml::SendRedirect( char * url ) const { cout << "Location: " << url << endl << endl; } /************************************************************************/ //! Short description /*! \param String */ void xbHtml::PlusToSpace( char * String ) { char * p; p = String; while( *p ) { if( *p == '+' ) *p = ' '; p++; } } /************************************************************************/ //! Short description /*! \param CookieName */ const char * xbHtml::GetCookie( const char * CookieName ) { char * CookieData; char * TempPtr; char * q; xbShort len; if(( CookieData = GetEnv( "HTTP_COOKIE" )) == NULL ) return NULL; len = strlen( CookieName ); len += 2; if(( TempPtr = (char *) malloc(len)) == NULL ) return NULL; strcpy( TempPtr, CookieName ); strcat( TempPtr, "=" ); if(( q = strstr( CookieData, TempPtr )) == NULL ) { free( TempPtr ); return NULL; } free( TempPtr ); len--; q += len; TempPtr = q; len = 0; while( *q && *q != ';' ) { len++; q++; } len++; if( len > HtmlBufLen ) { if( HtmlBufLen ) free( HtmlWorkBuf ); if(( HtmlWorkBuf = (char *) malloc( len )) == NULL ) return NULL; } memset( HtmlWorkBuf, 0x00, len ); q = HtmlWorkBuf; while( *TempPtr && *TempPtr != ';' ) *q++ = *TempPtr++; return HtmlWorkBuf; } /************************************************************************/ #endif /* XB_HTML */ xbase-2.0.0/xbase/lock.cpp0000644000000000000000000003572407202063230011005 /* $Id: lock.cpp,v 1.5 2000/11/07 20:31:20 dbryson Exp $ Xbase project source code This file contains the basic Xbase routines for locking Xbase files Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.4b 7/3/98 - Modified Exclusive Lock to conditionally lock memo file V 1.7.4d 10/28/98 - Added OS2/DOS/Windows/NT Locking support, added const */ #ifdef __WIN32__ #include #else #include #endif #include #ifdef XB_LOCKING_ON #include #include #ifdef HAVE_SYS_TYPES_H #include /* BSDI BSD/OS 3.1 */ #endif #ifdef HAVE_SYS_LOCKING_H #include #endif #ifdef HAVE_IO_H #include #endif #include #include /*! \file lock.cpp */ /************************************************************************/ //! UnixToDosLockCommand /*! \param WaitOption \param LockType */ #ifndef HAVE_FCNTL xbShort xbDbf::UnixToDosLockCommand( const xbShort WaitOption, const xbShort LockType ) const // this method converts the unix locking commands into as close of // a dos lock command as is possible { if( LockType == LK_LOCK ) return LK_UNLCK; else if( WaitOption == F_SETLK ) return LK_NBLCK; else return LK_LOCK; } #endif /************************************************************************/ //! Short description /*! \param WaitOption \param LockType \param LRecNo */ xbShort xbDbf::LockDatabase( const xbShort WaitOption, const xbShort LockType, const xbULong LRecNo ) { /* if WaitOption = F_SETLK - return immediately F_SETLKW - wait until lock function executes if LockType = F_RDLCK - do a read / shared lock F_WRLCK - do a write / exclusive lock F_UNLCK - do an unlock if LRecNo = 0L - lock the dbf header = 1-n - lock appropriate record if locking routines fail, look in errno or do perror() for explanation Nested record locking support added Oct 26, 1998 by Derry Bryson */ #ifdef HAVE_FCNTL struct flock fl; fl.l_type = LockType; #else long length; int whence, Cmd; long offset; #endif //fprintf(stderr, "LockDatabase: %s %s CurLockCount=%d\n", LRecNo ? "Record" : "File" , // LockType == F_RDLCK ? "F_RDLCK" : LockType == F_WRLCK ? "F_WRLCK" : "F_UNLCK", // CurLockCount); if( LRecNo > NoOfRecs ) xb_error(XB_INVALID_RECORD); if( LRecNo == 0L ) { /* ** This is a file lock. The following code (and some below) ** allows nesting of file lock calls by only locking on the ** first lock call (unless upgrading a read lock to a write lock) ** and counting the number of locks to allow unnesting of locks. */ if(CurLockType != -1) { if(LockType != F_UNLCK) { /* ** Allow changing a read lock into a write lock, but ** if a write lock is already held just say success. */ if(CurLockType == F_WRLCK || CurLockType == LockType) { //fprintf(stderr, "LockDatabase: nested lock succeeds\n"); CurLockCount++; return XB_NO_ERROR; } } else { CurLockCount--; /* ** If there are still outstanding locks, just indicate success. */ if(CurLockCount) { //fprintf(stderr, "LockDatabase: nested unlock returns with remaining locks\n"); return XB_NO_ERROR; } } } #ifdef HAVE_FCNTL fl.l_whence = SEEK_SET; fl.l_start = 0L; fl.l_len = 7L; #else whence = SEEK_SET; offset = 0L; length = 7L; #endif } #if 0 /* ** I don't understand why this code is here (hence I have removed it) ** as it causes locks which are never removed - Derry Bryson */ else if ( CurRec ) { #ifdef HAVE_FCNTL fl.l_whence = SEEK_CUR; fl.l_start = (HeaderLen+(RecordLen*(LRecNo-1))) - DbfTell(); fl.l_len = 1L; #else whence = SEEK_CUR; offset = (HeaderLen+(RecordLen*(LRecNo-1))) - DbfTell(); length = 1L; #endif } #endif else /* CurRec = 0 */ { /* ** This is a record lock. The following code (and some below) ** allows nesting of record lock calls by only locking on the ** first lock call (unless upgrading a read lock to a write lock) ** and counting the number of locks to allow unnesting of locks. */ if(CurLockedRecNo) { if(LockType != F_UNLCK) { /* ** Allow changing a read lock into a write lock, but ** if a write lock is already held just say success. */ if(CurRecLockType == F_WRLCK || CurRecLockType == LockType) { //fprintf(stderr, "LockDatabase: nested lock succeeds\n"); CurRecLockCount++; return XB_NO_ERROR; } } else { CurRecLockCount--; /* ** If there are still outstanding locks, just indicate success. */ if(CurRecLockCount) { //fprintf(stderr, "LockDatabase: nested unlock returns with remaining locks\n"); return XB_NO_ERROR; } } } #ifdef HAVE_FCNTL fl.l_whence = SEEK_SET; fl.l_start = HeaderLen + (RecordLen*(LRecNo-1) ); fl.l_len = 1L; #else whence = SEEK_SET; offset = HeaderLen + (RecordLen*(LRecNo-1)); length = 1L; #endif } #ifdef HAVE_FCNTL if(fcntl(fileno(fp), WaitOption, &fl) == -1) { //fprintf(stderr, "LockDatabase: failed!\n"); xb_error(XB_LOCK_FAILED) } else { if(LRecNo) /* record lock */ { if(LockType != F_UNLCK) { CurLockedRecNo = LRecNo; CurRecLockType = LockType; CurRecLockCount++; } else if(!CurRecLockCount) { CurLockedRecNo = 0; CurRecLockType = -1; } } else { if(LockType != F_UNLCK) { CurLockType = LockType; CurLockCount++; } else if (!CurLockCount) CurLockType = -1; } //fprintf(stderr, "LockDatabase: success!\n"); return XB_NO_ERROR; } #else if( fseek( fp, offset, whence ) != 0 ) xb_error(XB_SEEK_ERROR); Cmd = UnixToDosLockCommand( WaitOption, LockType ); if( locking( fileno( fp ), Cmd, length ) != 0 ) xb_error(XB_LOCK_FAILED) else { if(LRecNo) /* record lock */ { if(LockType != F_UNLCK) { CurLockedRecNo = LRecNo; CurRecLockType = LockType; CurRecLockCount++; } else if(!CurRecLockCount) { CurLockedRecNo = 0; CurRecLockType = -1; } } else { if(LockType != F_UNLCK) { CurLockType = LockType; CurLockCount++; } else if (!CurLockCount) CurLockType = -1; } return XB_NO_ERROR; } #endif } /************************************************************************/ //! Short Description /*! \param WaitOption \param LockType */ #ifdef XB_INDEX_ANY xbShort xbIndex::LockIndex( const xbShort WaitOption, const xbShort LockType ) { /* This method locks the first 512 bytes of the index file, effectively locking the file from other processes that are using the locking protocols if WaitOption = F_SETLK - return immediately F_SETLKW - wait until lock function executes if LockType = F_RDLCK - do a read / shared lock F_WRLCK - do a write / exclusive lock F_UNLCK - do an unlock if locking routines fail, look in errno or do perror() for explanation */ //fprintf(stderr, "LockIndex\n"); /* ** Support nested index locking. */ if(CurLockCount) { if(LockType != F_UNLCK) { /* ** Allow changing a read lock into a write lock, but ** if a write lock is already held or the current lock ** type is the same as the new lock type just say success. */ if(CurLockType == F_WRLCK || CurLockType == LockType) { CurLockCount++; return XB_NO_ERROR; } } else { /* ** This is an unlock */ CurLockCount--; /* ** If there are still outstanding locks, just indicate success. */ if(CurLockCount) return XB_NO_ERROR; } } #ifdef HAVE_FCNTL struct flock fl; fl.l_type = LockType; fl.l_whence = SEEK_SET; fl.l_start = 0L; // fl.l_len = XB_NDX_NODE_SIZE; fl.l_len = 1; if( fcntl( fileno( indexfp ), WaitOption, &fl ) == -1 ) xb_error(XB_LOCK_FAILED) else { if(LockType != F_UNLCK) { CurLockType = LockType; CurLockCount++; } else if(!CurLockCount) CurLockType = 0; return XB_NO_ERROR; } #else if( fseek( indexfp, 0L, SEEK_SET ) != 0 ) return XB_SEEK_ERROR; if( locking( fileno( indexfp ), dbf->UnixToDosLockCommand( WaitOption, LockType ),XB_NDX_NODE_SIZE ) != 0 ) xb_error(XB_LOCK_FAILED) else { if(LockType != F_UNLCK) { CurLockType = LockType; CurLockCount++; } else if(!CurLockCount) CurLockType = 0; return XB_NO_ERROR; } #endif } #endif /* XB_INDEX_ANY */ /************************************************************************/ //! Short description /*! \param WaitOption \param LockType */ #ifdef XB_MEMO_FIELDS xbShort xbDbf::LockMemoFile( const xbShort WaitOption, const xbShort LockType ) { /* This method locks the first 4 bytes of the memo file, effectively locking the file from other processes that are using the locking protocols The first four bytes point to the free block chain if WaitOption = F_SETLK - return immediately F_SETLKW - wait until lock function executes if LockType = F_RDLCK - do a read / shared lock F_WRLCK - do a write / exclusive lock F_UNLCK - do an unlock if locking routines fail, look in errno or do perror() for explanation */ /* ** Support nested index locking. */ if(CurMemoLockCount) { if(LockType != F_UNLCK) { /* ** Allow changing a read lock into a write lock, but ** if a write lock is already held or the current lock ** type is the same as the new lock type just say success. */ if(CurMemoLockType == F_WRLCK || CurMemoLockType == LockType) { CurMemoLockCount++; return XB_NO_ERROR; } } else { /* ** This is an unlock */ CurMemoLockCount--; /* ** If there are still outstanding locks, just indicate success. */ if(CurMemoLockCount) return XB_NO_ERROR; } } #ifdef HAVE_FCNTL struct flock fl; fl.l_type = LockType; fl.l_whence = SEEK_SET; fl.l_start = 0L; fl.l_len = 4L; if( fcntl( fileno( mfp ), WaitOption, &fl ) == -1 ) xb_error(XB_LOCK_FAILED) else { if(LockType != F_UNLCK) { CurMemoLockType = LockType; CurMemoLockCount++; } else if(!CurMemoLockCount) CurMemoLockType = 0; return XB_NO_ERROR; } #else if( fseek( mfp , 0L, SEEK_SET ) != 0 ) xb_error(XB_SEEK_ERROR); if( locking( fileno( mfp ), UnixToDosLockCommand( WaitOption, LockType ), 4L ) != 0 ) xb_error(XB_LOCK_FAILED) else { if(LockType != F_UNLCK) { CurMemoLockType = LockType; CurMemoLockCount++; } else if(!CurMemoLockCount) CurMemoLockType = 0; return XB_NO_ERROR; } #endif } #endif /* XB_MEMO_FIELDS */ /***********************************************************************/ //! Short description /*! \param LockWaitOption */ xbShort xbDbf::ExclusiveLock( const xbShort LockWaitOption ) { /* this routine locks all files and indexes for a database file */ /* if it fails, no locks are left on (theoretically) */ xbIxList *i; xbShort rc; AutoLockOff(); if(( rc = LockDatabase( LockWaitOption, F_WRLCK, 0 )) != XB_NO_ERROR ) return rc; #ifdef XB_MEMO_FIELDS if( MemoFieldsPresent()) if(( rc = LockMemoFile( LockWaitOption, F_WRLCK )) != XB_NO_ERROR ) return rc; #endif #ifdef XB_INDEX_ANY i = NdxList; while( i ) { #ifdef HAVE_EXCEPTIONS try { #endif if(( rc = i->index->LockIndex( LockWaitOption, F_WRLCK )) != XB_NO_ERROR ) { ExclusiveUnlock(); #ifndef HAVE_EXCEPTIONS return rc; #endif } #ifdef HAVE_EXCEPTIONS } catch (xbException &x) { ExclusiveUnlock(); xb_error(XB_LOCK_FAILED); } #endif i = i->NextIx; } #endif return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! */ xbShort xbDbf::ExclusiveUnlock( void ) { /* this routine unlocks all files and indexes for a database file */ xbIxList *i; LockDatabase( F_SETLK, F_UNLCK, 0 ); #ifdef XB_MEMO_FIELDS if( MemoFieldsPresent()) LockMemoFile( F_SETLK, F_UNLCK ); #endif #ifdef XB_INDEX_ANY i = NdxList; while( i ) { i->index->LockIndex( F_SETLK, F_UNLCK ); i = i->NextIx; } #endif AutoLockOn(); return XB_NO_ERROR; } /***********************************************************************/ #endif /* XB_LOCKING_ON */ xbase-2.0.0/xbase/memo.cpp0000644000000000000000000007134007202063230011004 /* $Id: memo.cpp,v 1.5 2000/11/07 20:31:20 dbryson Exp $ Xbase project source code This file contains the basic Xbase routines for handling dBASE III+ and dBASE IV style memo .dbt files Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.1 5/25/98 - Added support for dBase III+ type memo files */ #ifdef __WIN32__ #include #else #include #endif #include #ifdef XB_MEMO_FIELDS #include #include /*! \file memo.cpp */ /************************************************************************/ //! Short description /*! */ xbLong xbDbf::CalcLastDataBlock() { xbShort rc; if(( rc = fseek( mfp, 0, SEEK_END )) != 0 ) xb_error( XB_SEEK_ERROR ); return ( ftell( mfp ) / MemoHeader.BlockSize ); } /************************************************************************/ //! Short description /*! \param BlocksNeeded \param Location \param PrevNode */ xbShort xbDbf::GetBlockSetFromChain( const xbLong BlocksNeeded, const xbLong Location, const xbLong PrevNode ) /* this routine grabs a set of blocks out of the free block chain */ { xbShort rc; xbLong NextFreeBlock2, NewFreeBlocks, SaveNextFreeBlock; if(( rc = ReadMemoBlock( Location, 2 )) != XB_NO_ERROR ) xb_error( rc ); if( BlocksNeeded == FreeBlockCnt ) /* grab this whole set of blocks */ { if( PrevNode == 0 ) /* first in the chain */ { MemoHeader.NextBlock = NextFreeBlock; if(( rc = UpdateHeadNextNode()) != XB_NO_ERROR ) xb_error( rc ); } else /* remove out of the middle or end */ { NextFreeBlock2 = NextFreeBlock; if(( rc = ReadMemoBlock( PrevNode, 2 )) != XB_NO_ERROR ) xb_error( rc ); NextFreeBlock = NextFreeBlock2; if(( rc = WriteMemoBlock( PrevNode, 2 )) != XB_NO_ERROR ) xb_error( rc ); } } else /* only take a portion of this set */ { if( PrevNode == 0 ) /* first in the set */ { MemoHeader.NextBlock = Location + BlocksNeeded; if(( rc = UpdateHeadNextNode()) != XB_NO_ERROR ) xb_error( rc ); FreeBlockCnt -= BlocksNeeded; if(( rc = WriteMemoBlock( MemoHeader.NextBlock, 2 )) != XB_NO_ERROR ) xb_error( rc ); } else /* remove out of the middle or end */ { NewFreeBlocks = FreeBlockCnt - BlocksNeeded; SaveNextFreeBlock = NextFreeBlock; NextFreeBlock2= Location + BlocksNeeded; if(( rc = ReadMemoBlock( PrevNode, 2 )) != XB_NO_ERROR ) xb_error( rc ); NextFreeBlock = NextFreeBlock2; if(( rc = WriteMemoBlock( PrevNode, 2 )) != XB_NO_ERROR ) xb_error( rc ); FreeBlockCnt = NewFreeBlocks; NextFreeBlock = SaveNextFreeBlock; if(( rc = WriteMemoBlock( NextFreeBlock2, 2 )) != XB_NO_ERROR ) xb_error( rc ); } } return 0; } /************************************************************************/ //! Short description /*! \param BlocksNeeded \param LastDataBlock \param Location \param PreviousNode */ xbShort xbDbf::FindBlockSetInChain( const xbLong BlocksNeeded, const xbLong LastDataBlock, xbLong &Location, xbLong &PreviousNode ) /* this routine searches thru the free node chain in a dbase IV type memo file searching for a place to grab some free blocks for reuse LastDataBlock- is the last data block in the file, enter 0 for the routine to calculate it. BlocksNeeded - is the size to look in the chain for Location - is the location it finds PreviousNode - is the block number of the node imediately previous to this node in the chain - 0 if header node returns - 0 if no spot in chain found 1 if spot in chain is found */ { xbShort rc; xbLong LDB, PrevNode, CurNode; if( LastDataBlock == 0 ) LDB = CalcLastDataBlock(); else LDB = LastDataBlock; if( MemoHeader.NextBlock < LDB ){ PrevNode = 0L; CurNode = MemoHeader.NextBlock; if(( rc = ReadMemoBlock( MemoHeader.NextBlock, 2 )) != XB_NO_ERROR ) return rc; while( BlocksNeeded > FreeBlockCnt && NextFreeBlock < LDB ){ PrevNode = CurNode; CurNode = NextFreeBlock; if(( rc = ReadMemoBlock( NextFreeBlock, 2 )) != XB_NO_ERROR ) return rc; } if( BlocksNeeded <= FreeBlockCnt ){ Location = CurNode; PreviousNode = PrevNode; return 1; } else{ /* no data found and at end of chain */ PreviousNode = CurNode; return 0; } } else{ PreviousNode = 0; return 0; } } /************************************************************************/ //! Short description /*! \param BlockSize */ xbShort xbDbf::SetMemoBlockSize( const xbShort BlockSize ) { if(IsType3Dbt()) return XB_NO_ERROR; // not applicable for type 3 if( BlockSize % 512 != 0 ) xb_error(XB_INVALID_BLOCK_SIZE); MemoHeader.BlockSize = BlockSize; return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param Option */ xbShort xbDbf::GetDbtHeader( const xbShort Option ) { char *p; xbShort i; char MemoBlock[24]; /* Option = 0 --> read only first four bytes 1 --> read the entire thing */ if( !mfp ) xb_error(XB_NOT_OPEN); if( fseek( mfp, 0, SEEK_SET )) xb_error(XB_SEEK_ERROR); if(( fread( MemoBlock, 24, 1, mfp )) != 1 ) xb_error(XB_READ_ERROR); p = MemoBlock; MemoHeader.NextBlock = xbase->GetLong( p ); if(IsType3Dbt() || Option == 0) return XB_NO_ERROR; /* version IV stuff follows */ p+=8; for( i = 0; i < 8; i++, p++ ) MemoHeader.FileName[i] = *p; MemoHeader.Version = *p; p+=4; MemoHeader.BlockSize = xbase->GetShort( p ); return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! */ xbShort xbDbf::OpenMemoFile( void ) { xbLong Size, NewSize, l; xbShort len, rc; len = DatabaseName.len() - 1; char lb = DatabaseName.getCharacter( len ); if( lb == 'F' ) DatabaseName.putAt(len, 'T'); else if( lb == 'f' ) DatabaseName.putAt(len, 't'); else xb_error(XB_INVALID_NAME); if(( mfp = fopen( DatabaseName, "r+b" )) == NULL ){ DatabaseName.putAt(len, lb); xb_open_error(DatabaseName); } #ifdef XB_LOCKING_ON setbuf( mfp, NULL ); #endif DatabaseName.putAt(len, lb); if(( rc = GetDbtHeader(1)) != 0 ) { fclose( mfp ); return rc; } len = GetMemoBlockSize(); if( len == 0 || ((len % 512) != 0 )) { fclose( mfp ); xb_error(XB_INVALID_BLOCK_SIZE); } /* logic to verify file size is a multiple of block size */ if(( rc = fseek( mfp, 0, SEEK_END )) != 0 ) { fclose( mfp ); xb_io_error(XB_SEEK_ERROR, DatabaseName); } /* if the file is not a multiple of block size, fix it, append nulls */ Size = ftell( mfp ); if(( Size % MemoHeader.BlockSize ) != 0 ) { NewSize = ( Size / MemoHeader.BlockSize + 1) * MemoHeader.BlockSize; for( l = Size; l < NewSize; l++ ) fputc( 0x00, mfp ); } if(( mbb = (void *) malloc(len)) == NULL ) { fclose( mfp ); xb_memory_error; } return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! */ xbShort xbDbf::CreateMemoFile( void ) { xbShort len,i; char *sp; char buf[4]; len = GetMemoBlockSize(); if( len == 0 || len % 512 != 0 ) xb_error(XB_INVALID_BLOCK_SIZE); if(( sp = (char*)strrchr(DatabaseName, PATH_SEPARATOR)) != NULL ) sp++; else sp = MemoHeader.FileName; memset( MemoHeader.FileName, 0x00, 8 ); for( i = 0; i < 8 && *sp != '.'; i++ ) MemoHeader.FileName[i] = *sp++; len = DatabaseName.len() - 1; char lb = DatabaseName.getCharacter( len ); if( lb == 'F' ) DatabaseName.putAt(len, 'T'); else if( lb == 'f' ) DatabaseName.putAt(len, 't'); else xb_io_error(XB_INVALID_NAME, DatabaseName); /* Initialize the variables */ MemoHeader.NextBlock = 1L; if(( mfp = fopen( DatabaseName, "w+b" )) == NULL ) { DatabaseName.putAt(len, lb); xb_open_error(DatabaseName); } #ifdef XB_LOCKING_ON setbuf( mfp, NULL ); #endif DatabaseName.putAt(len, lb); if(( fseek( mfp, 0L, SEEK_SET )) != 0 ) { fclose( mfp ); xb_io_error(XB_SEEK_ERROR, DatabaseName); } memset( buf, 0x00, 4 ); xbase->PutLong( buf, MemoHeader.NextBlock ); if(( fwrite( &buf, 4, 1, mfp )) != 1 ) { fclose( mfp ); xb_io_error(XB_WRITE_ERROR, DatabaseName); } if( IsType3Dbt() ) /* dBASE III+ */ { for( i = 0; i < 12; i++ ) fputc( 0x00, mfp ); fputc( 0x03, mfp ); for( i = 0; i < 495; i++ ) fputc( 0x00, mfp ); } else { for( i = 0; i < 4; i++ ) fputc( 0x00, mfp ); fwrite( &MemoHeader.FileName, 8, 1, mfp ); for( i = 0; i < 4; i++ ) fputc( 0x00, mfp ); memset( buf, 0x00, 2 ); xbase->PutShort( buf, MemoHeader.BlockSize ); if(( fwrite( &buf, 2, 1, mfp )) != 1 ) { fclose( mfp ); xb_io_error(XB_WRITE_ERROR, DatabaseName); } for( i = 22; i < MemoHeader.BlockSize; i++ ) fputc( 0x00, mfp ); } if(( mbb = (void *) malloc( MemoHeader.BlockSize )) == NULL ) { fclose( mfp ); xb_memory_error; } return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param BlockNo \param Option */ /* Option = 0 - 1st Block of a set of valid data blocks, load buckets */ /* Option = 1 - subsequant block of data in a multi block set or db III*/ /* Option = 2 - 1st block of a set of free blocks, load buckets */ /* Option = 3 - read 8 bytes of a block, don't load any buckets */ /* Option = 4 - read 8 bytes of a block, load data buckets */ xbShort xbDbf::ReadMemoBlock( const xbLong BlockNo, const xbShort Option ) { xbLong ReadSize; CurMemoBlockNo = -1; if( BlockNo < 1L ) xb_error(XB_INVALID_BLOCK_NO); if( fseek( mfp,(xbLong) BlockNo * MemoHeader.BlockSize, SEEK_SET )) xb_error(XB_SEEK_ERROR); if( Option == 0 || Option == 1 ) ReadSize = MemoHeader.BlockSize; else ReadSize = 8L; if(fread( mbb, ReadSize, 1, mfp ) != 1 ) xb_error(XB_READ_ERROR); if( Option == 0 || Option == 4) // 1st block of a set of valid data blocks { mfield1 = xbase->GetShort( (char *) mbb ); MStartPos = xbase->GetShort( (char *) mbb+2 ); MFieldLen = xbase->GetLong ( (char *) mbb+4 ); } else if( Option == 2 ) // 1st block of a set of free blocks { NextFreeBlock = xbase->GetLong( (char *) mbb ); FreeBlockCnt = xbase->GetLong( (char *) mbb+4 ); } if( Option == 0 || Option == 1 ) CurMemoBlockNo = BlockNo; return XB_NO_ERROR; } /************************************************************************/ //! Short description /*! \param BlockNo \param Option */ xbShort xbDbf::WriteMemoBlock( const xbLong BlockNo, const xbShort Option ) { /* Option = 0 - 1st Block of a set of valid data blocks, set buckets */ /* Option = 1 - subsequant block of data in a multi block set or db III */ /* Option = 2 - 1st block of a set offree blocks, set buckets */ xbLong WriteSize; if( BlockNo < 1L ) xb_error(XB_INVALID_BLOCK_NO); CurMemoBlockNo = -1; if( Option == 0 ) { xbase->PutShort( (char *) mbb, mfield1 ); xbase->PutShort( (char *) mbb+2, MStartPos ); xbase->PutLong ( (char *) mbb+4, MFieldLen ); WriteSize = MemoHeader.BlockSize; } else if( Option == 2 ) { xbase->PutLong((char *) mbb, NextFreeBlock ); xbase->PutLong((char *) mbb+4, FreeBlockCnt ); WriteSize = 8L; } else WriteSize = MemoHeader.BlockSize; if( fseek( mfp,(xbLong) BlockNo * MemoHeader.BlockSize, SEEK_SET )) xb_error(XB_SEEK_ERROR); if(( fwrite( mbb, WriteSize, 1, mfp )) != 1 ) xb_error(XB_WRITE_ERROR); if( Option == 0 || Option == 1 ) CurMemoBlockNo = BlockNo; return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param FieldNo \param len \param Buf \param LockOpt */ xbShort xbDbf::GetMemoField( const xbShort FieldNo, const xbLong len, char * Buf, const xbShort LockOpt ) { xbLong BlockNo, Tcnt, Scnt; char *tp, *sp; /* target and source pointers */ xbShort rc; xbShort Vswitch; if( FieldNo < 0 || FieldNo > ( NoOfFields - 1 )) xb_error(XB_INVALID_FIELDNO); if( GetFieldType( FieldNo ) != 'M' ) xb_error(XB_NOT_MEMO_FIELD); #ifdef XB_LOCKING_ON if( LockOpt != -1 ) if(( rc = LockMemoFile( LockOpt, F_RDLCK )) != XB_NO_ERROR ) return XB_LOCK_FAILED; #endif if(( BlockNo = GetLongField( FieldNo )) == 0 ) { #ifdef XB_LOCKING_ON if( LockOpt != -1 ) LockMemoFile( F_SETLK, F_UNLCK ); #endif xb_error(XB_NO_MEMO_DATA); } if( IsType3Dbt() ) Vswitch = 1; else Vswitch = 0; if(( rc = ReadMemoBlock( BlockNo, Vswitch )) != 0 ) { #ifdef XB_LOCKING_ON if( LockOpt != -1 ) LockMemoFile( F_SETLK, F_UNLCK ); #endif return rc; } tp = Buf; sp = (char *) mbb; if( IsType4Dbt() ) { sp+=8; Scnt = 8L; } else Scnt = 0L; Tcnt = 0L; while( Tcnt < len ) { *tp++ = *sp++; Scnt++; Tcnt++; if( Scnt >= MemoHeader.BlockSize ) { BlockNo++; if(( rc = ReadMemoBlock( BlockNo, 1 )) != 0 ) return rc; Scnt = 0; sp = (char *) mbb; } } #ifdef XB_LOCKING_ON if( LockOpt != -1 ) LockMemoFile( F_SETLK, F_UNLCK ); #endif return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param FieldNo */ xbLong xbDbf::GetMemoFieldLen( const xbShort FieldNo ) { xbLong BlockNo, ByteCnt; xbShort scnt, NotDone; char *sp, *spp; if(( BlockNo = GetLongField( FieldNo )) == 0L ) return 0L; if( IsType4Dbt()) /* dBASE IV */ { if( BlockNo == CurMemoBlockNo && CurMemoBlockNo != -1 ) return MFieldLen - MStartPos; if( ReadMemoBlock( BlockNo, 0 ) != XB_NO_ERROR ) return 0L; return MFieldLen - MStartPos; } else /* version 0x03 dBASE III+ */ { ByteCnt = 0L; sp = spp = NULL; NotDone = 1; while( NotDone ) { if( ReadMemoBlock( BlockNo++, 1 ) != XB_NO_ERROR ) return 0L; scnt = 0; sp = (char *) mbb; while( scnt < 512 && NotDone ) { if( *sp == 0x1a && *spp == 0x1a ) NotDone = 0; else { ByteCnt++; scnt++; spp = sp; sp++; } } } if( ByteCnt > 0 ) ByteCnt--; return ByteCnt; } } /***********************************************************************/ //! Short description /*! */ xbShort xbDbf::MemoFieldsPresent( void ) const { xbShort i; for( i = 0; i < NoOfFields; i++ ) if( GetFieldType( i ) == 'M' ) return 1; return 0; } /***********************************************************************/ //! Short description /*! \param FieldNo */ xbShort xbDbf::DeleteMemoField( const xbShort FieldNo ) { xbLong SBlockNo, SNoOfBlocks = 0L, SNextBlock; xbLong LastFreeBlock, LastFreeBlockCnt, LastDataBlock; xbShort rc; NextFreeBlock = 0L; LastFreeBlockCnt = 0L; LastFreeBlock = 0L; SNextBlock = 0L; if( IsType3Dbt() ) /* type III */ { PutField( FieldNo, " " ); return XB_NO_ERROR; } /* Get Block Number */ if(( SBlockNo = GetLongField( FieldNo )) == 0 ) xb_error(XB_INVALID_BLOCK_NO); /* Load the first block */ if(( rc = ReadMemoBlock( SBlockNo, 4 )) != XB_NO_ERROR ) return rc; if( (MFieldLen+2) % MemoHeader.BlockSize ) SNoOfBlocks = (MFieldLen+2)/MemoHeader.BlockSize+1L; else SNoOfBlocks = (MFieldLen+2)/MemoHeader.BlockSize; /* Determine last good data block */ LastDataBlock = CalcLastDataBlock(); /* position to correct location in chain */ NextFreeBlock = MemoHeader.NextBlock; while( SBlockNo > NextFreeBlock && SBlockNo < LastDataBlock ) { LastFreeBlock = NextFreeBlock; if(( rc = ReadMemoBlock( NextFreeBlock, 2 )) != XB_NO_ERROR ) return rc; LastFreeBlockCnt = FreeBlockCnt; } /* if next block should be concatonated onto the end of this set */ if((SBlockNo+SNoOfBlocks) == NextFreeBlock && NextFreeBlock < LastDataBlock ) { if(( rc = ReadMemoBlock( NextFreeBlock, 2 )) != XB_NO_ERROR ) return XB_NO_ERROR; SNoOfBlocks += FreeBlockCnt; SNextBlock = NextFreeBlock; } else if( LastFreeBlock == 0L ) SNextBlock = MemoHeader.NextBlock; else SNextBlock = NextFreeBlock; /* if this is the first set of free blocks */ if( LastFreeBlock == 0L ) { /* 1 - write out the current block */ /* 2 - update header block */ /* 3 - write header block */ /* 4 - update data field */ NextFreeBlock = SNextBlock; FreeBlockCnt = SNoOfBlocks; if(( rc = WriteMemoBlock( SBlockNo, 2 )) != XB_NO_ERROR ) return rc; MemoHeader.NextBlock = SBlockNo; if(( rc = UpdateHeadNextNode()) != XB_NO_ERROR ) return rc; PutField( FieldNo, " " ); return XB_NO_ERROR; } /* determine if this block set should be added to the previous set */ if(( LastFreeBlockCnt + LastFreeBlock ) == SBlockNo ) { if(( rc = ReadMemoBlock( LastFreeBlock, 2 )) != XB_NO_ERROR ) return rc; NextFreeBlock = SNextBlock; FreeBlockCnt += SNoOfBlocks; if(( rc = WriteMemoBlock( LastFreeBlock, 2 )) != XB_NO_ERROR ) return rc; PutField( FieldNo, " " ); return XB_NO_ERROR; } /* insert into the chain */ /* 1 - set the next bucket on the current node */ /* 2 - write this node */ /* 3 - go to the previous node */ /* 4 - insert this nodes id into the previous node set */ /* 5 - write previous node */ FreeBlockCnt = SNoOfBlocks; if(( rc = WriteMemoBlock( SBlockNo, 2 )) != XB_NO_ERROR ) return rc; if(( rc = ReadMemoBlock( LastFreeBlock, 2 )) != XB_NO_ERROR ) return rc; NextFreeBlock = SBlockNo; if(( rc = WriteMemoBlock( LastFreeBlock, 2 )) != XB_NO_ERROR ) return rc; PutField( FieldNo, " " ); return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param FieldNo \param DataLen \param Buf */ xbShort xbDbf::AddMemoData( const xbShort FieldNo, const xbLong DataLen, const char * Buf ) { xbShort rc; xbLong BlocksNeeded, LastDataBlock; xbLong PrevNode, HeadBlock; xbLong TotalLen; /* total length of needed area for memo field */ TotalLen = DataLen+2; LastDataBlock = CalcLastDataBlock(); if( IsType3Dbt() || /* always append to end */ ( LastDataBlock == MemoHeader.NextBlock )) /* no free space */ { if( TotalLen % MemoHeader.BlockSize ) BlocksNeeded = TotalLen / MemoHeader.BlockSize + 1; else BlocksNeeded = TotalLen / MemoHeader.BlockSize; MemoHeader.NextBlock = LastDataBlock + BlocksNeeded; /* reset to eof */ if(( rc = PutMemoData( LastDataBlock, BlocksNeeded, DataLen, Buf )) != XB_NO_ERROR ) return rc; HeadBlock = LastDataBlock; if(( rc = UpdateHeadNextNode()) != XB_NO_ERROR ) return rc; } else { TotalLen += 8; if( TotalLen % MemoHeader.BlockSize ) BlocksNeeded = TotalLen / MemoHeader.BlockSize + 1; else BlocksNeeded = TotalLen / MemoHeader.BlockSize; if(( rc = FindBlockSetInChain( BlocksNeeded, LastDataBlock, HeadBlock, PrevNode )) == 1 ) { if(( rc = GetBlockSetFromChain( BlocksNeeded, HeadBlock, PrevNode )) != XB_NO_ERROR ) return rc; if(( rc = PutMemoData( HeadBlock, BlocksNeeded, DataLen, Buf )) != XB_NO_ERROR ) return rc; } else /* append to the end */ { /* if header block needed updated, already done by here */ if(( rc = PutMemoData( LastDataBlock, BlocksNeeded, DataLen, Buf )) != XB_NO_ERROR ) return rc; HeadBlock = LastDataBlock; if(( rc = ReadMemoBlock( PrevNode, 2 )) != XB_NO_ERROR ) return rc; NextFreeBlock += BlocksNeeded; if(( rc = WriteMemoBlock( PrevNode, 2 )) != XB_NO_ERROR ) return rc; } } PutLongField( FieldNo, HeadBlock ); return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! */ xbShort xbDbf::UpdateHeadNextNode( void ) const { char buf[4]; memset( buf, 0x00, 4 ); xbase->PutLong( buf, MemoHeader.NextBlock ); if(( fseek( mfp, 0L, SEEK_SET )) != 0 ) xb_error(XB_SEEK_ERROR); if(( fwrite( &buf, 4, 1, mfp )) != 1 ) xb_error(XB_WRITE_ERROR); return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param StartBlock \param BlocksNeeded \param DataLen \param Buf */ xbShort xbDbf::PutMemoData( const xbLong StartBlock, const xbLong BlocksNeeded, const xbLong DataLen, const char *Buf ) { xbShort i, rc, Qctr, Tctr, wlen; xbLong CurBlock; char *tp; const char *sp; wlen = DataLen + 2; CurBlock = StartBlock; tp = (char *) mbb; sp = Buf; Qctr = 0; /* total length processed */ if( IsType3Dbt() ) Tctr = 0; else /* dBASE IV */ { tp += 8; Tctr = 8; } for( i = 0; i < BlocksNeeded; i++ ) { while( Tctr < MemoHeader.BlockSize && Qctr < wlen ) { if( Qctr >= DataLen ) *tp++ = 0x1a; /* end of data marker */ else *tp++ = *sp++; Tctr++; Qctr++; } if( i == 0 && IsType4Dbt() ) { mfield1 = -1; MStartPos = 8; MFieldLen = DataLen + MStartPos; if(( rc = WriteMemoBlock( CurBlock++, 0 )) != XB_NO_ERROR ) return rc; } else { if(( rc = WriteMemoBlock( CurBlock++, 1 )) != XB_NO_ERROR ) return rc; } Tctr = 0; tp = (char *) mbb; } return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param FieldNo \param DataLen \param Buf \param LockOpt */ xbShort xbDbf::UpdateMemoData( const xbShort FieldNo, const xbLong DataLen, const char * Buf, const xbShort LockOpt ) { xbShort rc; xbLong TotalLen; xbLong BlocksNeeded, BlocksAvailable; #ifdef XB_LOCKING_ON if( LockOpt != -1 ) if(( rc = LockMemoFile( LockOpt, F_WRLCK )) != XB_NO_ERROR ) return XB_LOCK_FAILED; #endif if( DataLen ){ TotalLen = DataLen + 2; // add 2 eod 0x1a chars if( IsType4Dbt()) TotalLen += 8; // leading fields for dbase iv } else TotalLen = 0; if( DataLen == 0L ) /* handle delete */ { if( MemoFieldExists( FieldNo ) ) { if(( rc = DeleteMemoField( FieldNo )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON LockMemoFile( F_SETLK, F_UNLCK ); #endif return rc; } } } else if((IsType3Dbt() || GetMemoFieldLen(FieldNo)==0L)) { if(( rc = AddMemoData( FieldNo, DataLen, Buf )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON LockMemoFile( F_SETLK, F_UNLCK ); #endif return rc; } } else /* version IV type files, reuse unused space */ { if( TotalLen % MemoHeader.BlockSize ) BlocksNeeded = TotalLen / MemoHeader.BlockSize + 1; else BlocksNeeded = TotalLen / MemoHeader.BlockSize; if(( rc = ReadMemoBlock( GetLongField( FieldNo ), 4 )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON LockMemoFile( F_SETLK, F_UNLCK ); #endif return rc; } if( (MFieldLen+2) % MemoHeader.BlockSize ) BlocksAvailable = (MFieldLen+2) / MemoHeader.BlockSize + 1; else BlocksAvailable = (MFieldLen+2) / MemoHeader.BlockSize; if( BlocksNeeded == BlocksAvailable ) { if(( rc = PutMemoData( GetLongField( FieldNo ), BlocksNeeded, DataLen, Buf )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON LockMemoFile( F_SETLK, F_UNLCK ); #endif return rc; } } else { if(( rc = DeleteMemoField( FieldNo )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON LockMemoFile( F_SETLK, F_UNLCK ); #endif return rc; } if(( rc = AddMemoData( FieldNo, DataLen, Buf )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON LockMemoFile( F_SETLK, F_UNLCK ); #endif return rc; } } } #ifdef XB_LOCKING_ON if( LockOpt != -1 ) if(( rc = LockMemoFile( F_SETLK, F_UNLCK )) != XB_NO_ERROR ) xb_error(XB_LOCK_FAILED); #endif return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param FieldNo */ xbShort xbDbf::MemoFieldExists( const xbShort FieldNo ) const { if( GetLongField( FieldNo ) == 0L ) return 0; else return 1; } /***********************************************************************/ //! Short description /*! */ #ifdef XBASE_DEBUG void xbDbf::DumpMemoHeader( void ) const { xbShort i; cout << "\n*********************************"; cout << "\nMemo header data..."; cout << "\nNext Block " << MemoHeader.NextBlock; if( IsType4Dbt() ) { cout << "\nFilename "; for( i = 0; i < 8; i++ ) cout << MemoHeader.FileName[i]; } cout << "\nBlocksize " << MemoHeader.BlockSize; return; } /***********************************************************************/ //! Short description /*! */ xbShort xbDbf::DumpMemoFreeChain( void ) { xbShort rc; xbLong CurBlock, LastDataBlock; if(( rc = GetDbtHeader(1)) != XB_NO_ERROR ) return rc; LastDataBlock = CalcLastDataBlock(); CurBlock = MemoHeader.NextBlock; cout << "\nTotal blocks in file = " << LastDataBlock; cout << "\nHead Next Block = " << CurBlock; while( CurBlock < LastDataBlock ) { if(( rc = ReadMemoBlock( CurBlock, 2 )) != XB_NO_ERROR ) return rc; cout << "\n**********************************"; cout << "\nThis Block = " << CurBlock; cout << "\nNext Block = " << NextFreeBlock; cout << "\nNo Of Blocks = " << FreeBlockCnt << "\n"; CurBlock = NextFreeBlock; } return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! */ void xbDbf::DumpMemoBlock( void ) const { xbShort i; char *p; p = (char *) mbb; if( IsType3Dbt() ) { for( i = 0; i < 512; i++ ) cout << *p++; } else { cout << "\nField1 => " << mfield1; cout << "\nStart Pos => " << MStartPos; cout << "\nField Len => " << MFieldLen; cout << "\nBlock data => "; p += 8; for( i = 8; i < MemoHeader.BlockSize; i++ ) cout << *p++; } return; } #endif /* XBASE_DEBUG */ /***********************************************************************/ #endif /* MEMO_FIELD */ xbase-2.0.0/xbase/ndx.cpp0000644000000000000000000022565107255772705010674 /* $Id: ndx.cpp,v 1.10 2001/03/21 00:28:53 dbryson Exp $ Xbase project source code NDX indexing routines for X-Base Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.3 11/30/97 - Moved GetLong and GetShort to DBF class V 1.5 1/2/98 - Added Dbase IV memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.4b 6/2/98 - Big Endian fix in PutLeafNode - JAM - Fix in Reindex - PS - Fix in Findkey( Tkey, DbfRec ) 9/29/98 - Fix in CreateIndex to calculate KeyLen & size Paul Koufalis pkoufalis@cogicom.com - sequence duplicate keys in dbf# order V 1.8 11/30/98 - Version 1.8 upgrade V 1.9 4/12/99 - Added fix to AddKey routine for dup keys - Modified CreateIndex logic - KeySize field */ #ifdef __GNUG__ #pragma implementation "ndx.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #include #ifdef XB_INDEX_NDX #ifdef HAVE_IO_H #include #endif #include #include #include #include /*! \file ndx.cpp */ #define USE_BSEARCH /***********************************************************************/ //! Short description /*! */ xbShort xbNdx::CloneNodeChain() { xbNdxNodeLink * TempNodeS; xbNdxNodeLink * TempNodeT; xbNdxNodeLink * TempNodeT2; if( CloneChain ) ReleaseNodeMemory( CloneChain ); CloneChain = NULL; if( !NodeChain ) return XB_NO_ERROR; TempNodeS = NodeChain; TempNodeT2 = NULL; while( TempNodeS ) { if(( TempNodeT = GetNodeMemory()) == NULL ) { xb_memory_error; } memcpy( TempNodeT, TempNodeS, sizeof( struct xbNdxNodeLink )); TempNodeT->NextNode = NULL; TempNodeT->PrevNode = TempNodeT2; if( !CloneChain ) { TempNodeT2 = TempNodeT; CloneChain = TempNodeT; } else { TempNodeT2->NextNode = TempNodeT; TempNodeT2 = TempNodeT2->NextNode; } TempNodeS = TempNodeS->NextNode; } return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! */ xbShort xbNdx::UncloneNodeChain() { if( NodeChain ) ReleaseNodeMemory( NodeChain ); NodeChain = CloneChain; CloneChain = NULL; CurNode = NodeChain; while( CurNode->NextNode ) CurNode = CurNode->NextNode; return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! */ /* This routine dumps the node chain to stdout */ #ifdef XBASE_DEBUG void xbNdx::DumpNodeChain() { xbNdxNodeLink *n; cout << "\n*************************\n"; cout << "xbNodeLinkCtr = " << xbNodeLinkCtr; cout << "\nReused = " << ReusedxbNodeLinks << "\n"; n = NodeChain; while(n) { cout << "xbNodeLink Chain" << n->NodeNo << "\n"; n = n->NextNode; } n = FreeNodeChain; while(n) { cout << "FreexbNodeLink Chain" << n->NodeNo << "\n"; n = n->NextNode; } n = DeleteChain; while(n) { cout << "DeleteLink Chain" << n->NodeNo << "\n"; n = n->NextNode; } } #endif /***********************************************************************/ //! Short description /*! \param n */ /* This routine returns a chain of one or more index nodes back to the */ /* free node chain */ void xbNdx::ReleaseNodeMemory( xbNdxNodeLink * n ) { xbNdxNodeLink * temp; if( !FreeNodeChain ) FreeNodeChain = n; else /* put this list at the end */ { temp = FreeNodeChain; while( temp->NextNode ) temp = temp->NextNode; temp->NextNode = n; } return; } /***********************************************************************/ //! Short description /*! */ /* This routine returns a node from the free chain if available, */ /* otherwise it allocates new memory for the requested node */ xbNdxNodeLink * xbNdx::GetNodeMemory( void ) { xbNdxNodeLink * temp; if( FreeNodeChain ) { temp = FreeNodeChain; FreeNodeChain = temp->NextNode; ReusedxbNodeLinks++; } else { temp = (xbNdxNodeLink *) malloc( sizeof( xbNdxNodeLink )); xbNodeLinkCtr++; } memset( temp, 0x00, sizeof( xbNdxNodeLink )); return temp; } /***********************************************************************/ //! Short description /*! */ #ifdef XBASE_DEBUG void xbNdx::DumpHdrNode() { cout << "\nStart node = " << HeadNode.StartNode; cout << "\nTotal nodes = " << HeadNode.TotalNodes; cout << "\nNo of keys = " << HeadNode.NoOfKeys; cout << "\nKey Length = " << HeadNode.KeyLen; cout << "\nKeys Per Node = " << HeadNode.KeysPerNode; cout << "\nKey type = " << HeadNode.KeyType; cout << "\nKey size = " << HeadNode.KeySize; cout << "\nUnknown 2 = " << HeadNode.Unknown2; cout << "\nUnique = " << HeadNode.Unique; cout << "\nKeyExpression = " << HeadNode.KeyExpression; #ifdef XB_VAR_NODESIZE cout << "\nNodeSize = " << NodeSize; #endif // XB_VAR_NODESIZE cout << "\n"; #if 0 FILE * log; if(( log = fopen( "xbase.log", "a+t" )) == NULL ) return; fprintf( log, "\n-------------------" ); fprintf( log, "\nStart node =%ld ", HeadNode.StartNode ); fprintf( log, "\nTotal nodes =%ld ", HeadNode.TotalNodes ); fprintf( log, "\nNo of keys =%ld ", HeadNode.NoOfKeys ); fprintf( log, "\nKey Length =%d ", HeadNode.KeyLen ); fprintf( log, "\nKeys Per Node =%d ", HeadNode.KeysPerNode ); fprintf( log, "\nKey type =%d ", HeadNode.KeyType ); fprintf( log, "\nKey size =%ld ", HeadNode.KeySize ); fprintf( log, "\nUnknown 2 =%d ", HeadNode.Unknown2 ); fprintf( log, "\nUnique =%d ", HeadNode.Unique ); fprintf( log, "\nKeyExpression =%s \n", HeadNode.KeyExpression ); fclose( log ); #endif } #endif /***********************************************************************/ //! Short description /*! \param pdbf */ xbNdx::xbNdx(xbDbf *pdbf) : xbIndex(pdbf) { #ifndef XB_VAR_NODESIZE memset( Node, 0x00, XB_NDX_NODE_SIZE ); #else memset( Node, 0x00, XB_MAX_NDX_NODE_SIZE ); #endif memset( &HeadNode, 0x00, sizeof( xbNdxHeadNode )); NodeChain = NULL; CloneChain = NULL; FreeNodeChain = NULL; DeleteChain = NULL; CurNode = NULL; xbNodeLinkCtr = 0L; ReusedxbNodeLinks = 0L; #ifndef XB_VAR_NODESIZE NodeSize = XB_NDX_NODE_SIZE; #else NodeSize = XB_DEFAULT_NDX_NODE_SIZE; #endif // XB_VAR_NODESIZE } /***********************************************************************/ //! Short description /*! \param FileName */ xbShort xbNdx::OpenIndex( const char * FileName ) { int NameLen, rc; NameLen = strlen( FileName ) + 1; if(( rc = dbf->NameSuffixMissing( 2, FileName )) > 0 ) if(( rc = dbf->NameSuffixMissing( 4, FileName )) > 0 ) NameLen += 4; IndexName = FileName; if( rc == 1 ) IndexName += ".ndx"; else if ( rc == 2 ) IndexName += ".NDX"; /* open the file */ if(( indexfp = fopen( IndexName, "r+b" )) == NULL ) xb_open_error(IndexName); #ifdef XB_LOCKING_ON /* ** Must turn off buffering when multiple programs may be accessing ** index files. */ setbuf( indexfp, NULL ); #endif #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif IndexStatus = 1; if(( rc = GetHeadNode()) != 0) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif fclose( indexfp ); return rc; } /* parse the expression */ if(( rc = dbf->xbase->BuildExpressionTree( HeadNode.KeyExpression, strlen( HeadNode.KeyExpression ), dbf )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } ExpressionTree = dbf->xbase->GetTree(); dbf->xbase->SetTreeToNull(); //dbf->xbase->DumpExpressionTree(ExpressionTree); KeyBuf = (char *) malloc( HeadNode.KeyLen + 1 ); KeyBuf2 = (char *) malloc( HeadNode.KeyLen + 1); memset( KeyBuf, 0x00, HeadNode.KeyLen + 1 ); memset( KeyBuf2, 0x00, HeadNode.KeyLen + 1 ); rc = dbf->AddIndexToIxList( index, IndexName ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /***********************************************************************/ //! Short description /*! */ xbShort xbNdx::CloseIndex( void ) { if( KeyBuf ) { free ( KeyBuf ); KeyBuf = NULL; } if( KeyBuf2 ) { free ( KeyBuf2 ); KeyBuf2 = NULL; } dbf->RemoveIndexFromIxList( index ); fclose( indexfp ); IndexStatus = 0; return 0; } /***********************************************************************/ //! Short description /*! */ xbShort xbNdx::GetHeadNode( void ) { char *p, *q; xbShort i; if( !IndexStatus ) xb_error(XB_NOT_OPEN); if( fseek( indexfp, 0, SEEK_SET )) xb_io_error(XB_SEEK_ERROR, IndexName); if(( fread( Node, XB_NDX_NODE_SIZE, 1, indexfp )) != 1 ) xb_io_error(XB_READ_ERROR, IndexName); /* load the head node structure */ p = Node; HeadNode.StartNode = dbf->xbase->GetLong ( p ); p+=4; HeadNode.TotalNodes = dbf->xbase->GetLong ( p ); p+=4; HeadNode.NoOfKeys = dbf->xbase->GetLong ( p ); p+=4; HeadNode.KeyLen = dbf->xbase->GetShort( p ); p+=2; HeadNode.KeysPerNode = dbf->xbase->GetShort( p ); p+=2; HeadNode.KeyType = dbf->xbase->GetShort( p ); p+=2; HeadNode.KeySize = dbf->xbase->GetLong ( p ); p+=4; HeadNode.Unknown2 = *p++; HeadNode.Unique = *p++; #ifdef XB_VAR_NODESIZE // // Automagically determine the node size. Note the (2 * sizeof(xbLong)) // is taken directly from CreateIndex(). I don't understand it exactly, // but this is the value used to calculate the number of keys per node. // DTB. // NodeSize = (2 * sizeof(xbLong)) + HeadNode.KeySize * HeadNode.KeysPerNode; //printf("NodeSize = %d\n", NodeSize); if(NodeSize % XB_NDX_NODE_MULTIPLE) NodeSize = ((NodeSize + XB_NDX_NODE_MULTIPLE) / XB_NDX_NODE_MULTIPLE) * XB_NDX_NODE_MULTIPLE; //printf("NodeSize = %d\n", NodeSize); #endif q = HeadNode.KeyExpression; for( i = XB_NDX_NODE_BASESIZE; i < XB_NDX_NODE_SIZE && *p; i++ ) *q++ = *p++; return 0; } /***********************************************************************/ //! Short description /*! \param NodeNo \param SetNodeChain */ /* This routine reads a leaf node from disk */ /* */ /* If SetNodeChain 2, then the node is not appended to the node chain */ /* but the CurNode pointer points to the node read */ /* If SetNodeChain 1, then the node is appended to the node chain */ /* If SetNodeChain 0, then record is only read to Node memory */ xbShort xbNdx::GetLeafNode( xbLong NodeNo, xbShort SetNodeChain ) { xbNdxNodeLink *n; if( !IndexStatus ) xb_error(XB_NOT_OPEN); if( fseek( indexfp, NodeNo * XB_NDX_NODE_SIZE, SEEK_SET )) xb_io_error(XB_SEEK_ERROR, IndexName); if(( fread( Node, XB_NDX_NODE_SIZE, 1, indexfp )) != 1 ) xb_io_error(XB_READ_ERROR, IndexName); if( !SetNodeChain ) return 0; if(( n = GetNodeMemory()) == NULL ) xb_memory_error; n->NodeNo = NodeNo; n->CurKeyNo = 0L; n->NextNode = NULL; n->Leaf.NoOfKeysThisNode = dbf->xbase->GetLong( Node ); memcpy( n->Leaf.KeyRecs, Node+4, XB_NDX_NODE_SIZE - 4 ); /* put the node in the chain */ if( SetNodeChain == 1 ) { if( NodeChain == NULL ) /* first one ? */ { NodeChain = n; CurNode = n; CurNode->PrevNode = NULL; } else { n->PrevNode = CurNode; CurNode->NextNode = n; CurNode = n; } } else CurNode = n; return 0; } /***********************************************************************/ //! Short description /*! \param n */ #ifdef XBASE_DEBUG void xbNdx::DumpNodeRec( xbLong n ) { char *p; xbLong NoOfKeys, LeftBranch, RecNo; xbShort i,j; FILE * log; if(( log = fopen( "xbase.log", "a+t" )) == NULL ) return; GetLeafNode( n, 0 ); NoOfKeys = dbf->xbase->GetLong( Node ); p = Node + 4; /* go past no of keys */ fprintf( log, "\n--------------------------------------------------------" ); fprintf( log, "\nNode # %ld", n ); fprintf( log, "\nNumber of keys = %ld", NoOfKeys ); fprintf( log, "\n Key Left Rec Key" ); fprintf( log, "\nNumber Branch Number Data" ); for( i = 0; i < GetKeysPerNode() /*NoOfKeys*/; i++ ) { LeftBranch = dbf->xbase->GetLong( p ); p+=4; RecNo = dbf->xbase->GetLong( p ); p+=4; fprintf( log, "\n %d %ld %ld ", i, LeftBranch, RecNo ); if( !HeadNode.KeyType ) for( j = 0; j < HeadNode.KeyLen; j++ ) fputc( *p++, log ); else { fprintf( log, "??????" /*, dbf->xbase->GetDouble( p )*/ ); p += 8; } } fclose( log ); } #endif /***********************************************************************/ #ifndef XB_INLINE_GETDBFNO xbLong xbNdx::GetDbfNo( xbShort RecNo, xbNdxNodeLink * n ) { xbNdxLeafNode *temp; char *p; if( !n ) return 0L; temp = &n->Leaf; if( RecNo < 0 || RecNo > ( temp->NoOfKeysThisNode - 1 )) return 0L; p = temp->KeyRecs + 4; p += RecNo * ( 8 + HeadNode.KeyLen ); return( dbf->xbase->GetLong( p )); } #endif /***********************************************************************/ //! Short description /*! \param RecNo \param n */ xbLong xbNdx::GetLeftNodeNo( xbShort RecNo, xbNdxNodeLink * n ) { xbNdxLeafNode *temp; char *p; if( !n ) return 0L; temp = &n->Leaf; if( RecNo < 0 || RecNo > temp->NoOfKeysThisNode ) return 0L; p = temp->KeyRecs; p += RecNo * ( 8 + HeadNode.KeyLen ); return( dbf->xbase->GetLong( p )); } /***********************************************************************/ //! Short description /*! \param RecNo \param n */ char * xbNdx::GetKeyData( xbShort RecNo, xbNdxNodeLink * n ) { xbNdxLeafNode *temp; char *p; if( !n ) return 0L; temp = &n->Leaf; if( RecNo < 0 || RecNo > ( temp->NoOfKeysThisNode - 1 )) return 0L; p = temp->KeyRecs + 8; p += RecNo * ( 8 + HeadNode.KeyLen ); return( p ); } /***********************************************************************/ //! Short description /*! */ xbLong xbNdx::GetTotalNodes( void ) { if( &HeadNode ) return HeadNode.TotalNodes; else return 0L; } /***********************************************************************/ //! Short description /*! */ xbUShort xbNdx::GetKeysPerNode( void ) { if( &HeadNode ) return HeadNode.KeysPerNode; else return 0L; } /***********************************************************************/ //! Short description /*! \param RetrieveSw */ xbShort xbNdx::GetFirstKey( xbShort RetrieveSw ) { /* This routine returns 0 on success and sets CurDbfRec to the record */ /* corresponding to the first index pointer */ xbLong TempNodeNo; xbShort rc; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif /* initialize the node chain */ if( NodeChain ) { ReleaseNodeMemory( NodeChain ); NodeChain = NULL; } if(( rc = GetHeadNode()) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* get a node and add it to the link */ if(( rc = GetLeafNode( HeadNode.StartNode, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* traverse down the left side of the tree */ while( GetLeftNodeNo( 0, CurNode )) { TempNodeNo = GetLeftNodeNo( 0, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } CurNode->CurKeyNo = 0; } CurDbfRec = GetDbfNo( 0, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param RetrieveSw */ xbShort xbNdx::GetNextKey( xbShort RetrieveSw ) { /* This routine returns 0 on success and sets CurDbfRec to the record */ /* corresponding to the next index pointer */ xbNdxNodeLink * TempxbNodeLink; xbLong TempNodeNo; xbShort rc = 0; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif if( !IndexStatus ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; xb_error(XB_NOT_OPEN); } if( !CurNode ) { rc = GetFirstKey( RetrieveSw ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* more keys on this node ? */ if(( CurNode->Leaf.NoOfKeysThisNode-1) > CurNode->CurKeyNo ) { CurNode->CurKeyNo++; CurDbfRec = GetDbfNo( CurNode->CurKeyNo, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /* if head node we are at eof */ if( CurNode->NodeNo == HeadNode.StartNode ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif xb_eof_error; } /* this logic assumes that interior nodes have n+1 left node no's where */ /* n is the number of keys in the node */ /* pop up one node to the interior node level & free the leaf node */ TempxbNodeLink = CurNode; CurNode = CurNode->PrevNode; CurNode->NextNode = NULL; ReleaseNodeMemory( TempxbNodeLink ); /* while no more right keys && not head node, pop up one node */ while(( CurNode->CurKeyNo >= CurNode->Leaf.NoOfKeysThisNode ) && ( CurNode->NodeNo != HeadNode.StartNode )) { TempxbNodeLink = CurNode; CurNode = CurNode->PrevNode; CurNode->NextNode = NULL; ReleaseNodeMemory( TempxbNodeLink ); } /* if head node && right most key, return end-of-file */ if(( HeadNode.StartNode == CurNode->NodeNo ) && ( CurNode->CurKeyNo >= CurNode->Leaf.NoOfKeysThisNode )) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif xb_eof_error; } /* move one to the right */ CurNode->CurKeyNo++; TempNodeNo = GetLeftNodeNo( CurNode->CurKeyNo, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* traverse down the left side of the tree */ while( GetLeftNodeNo( 0, CurNode )) { TempNodeNo = GetLeftNodeNo( 0, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { CurDbfRec = 0L; return rc; } CurNode->CurKeyNo = 0; } CurDbfRec = GetDbfNo( 0, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param NodeNo \param RetrieveSw */ xbShort xbNdx::GetLastKey( xbLong NodeNo, xbShort RetrieveSw ) { /* This routine returns 0 on success and sets CurDbfRec to the record */ /* corresponding to the last index pointer */ /* If NodeNo = 0, start at head node, otherwise start at NodeNo */ xbLong TempNodeNo; xbShort rc; if( NodeNo < 0 || NodeNo > HeadNode.TotalNodes ) xb_error(XB_INVALID_NODE_NO); /* initialize the node chain */ if( NodeChain ) { ReleaseNodeMemory( NodeChain ); NodeChain = NULL; } if( NodeNo == 0L ) if(( rc = GetHeadNode()) != 0 ) { CurDbfRec = 0L; return rc; } #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif /* get a node and add it to the link */ if( NodeNo == 0L ) { if(( rc = GetLeafNode( HeadNode.StartNode, 1 )) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } } else { if(( rc = GetLeafNode( NodeNo, 1 )) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } } CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; /* traverse down the right side of the tree */ while( GetLeftNodeNo( CurNode->Leaf.NoOfKeysThisNode, CurNode )) { TempNodeNo = GetLeftNodeNo( CurNode->Leaf.NoOfKeysThisNode, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; } CurNode->CurKeyNo--; /* leaf node has one fewer ix recs */ CurDbfRec = GetDbfNo( CurNode->Leaf.NoOfKeysThisNode-1, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param RetrieveSw */ xbShort xbNdx::GetPrevKey( xbShort RetrieveSw ) { /* This routine returns 0 on success and sets CurDbfRec to the record */ /* corresponding to the previous index pointer */ xbNdxNodeLink * TempxbNodeLink; xbLong TempNodeNo; xbShort rc = 0; if( !IndexStatus ) { CurDbfRec = 0L; xb_error(XB_NOT_OPEN); } if( !CurNode ) { CurDbfRec = 0L; return GetFirstKey( RetrieveSw ); } #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif /* more keys on this node ? */ if( CurNode->CurKeyNo > 0 ) { CurNode->CurKeyNo--; CurDbfRec = GetDbfNo( CurNode->CurKeyNo, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /* this logic assumes that interior nodes have n+1 left node no's where */ /* n is the number of keys in the node */ /* pop up one node to the interior node level & free the leaf node */ if( !CurNode->PrevNode ) { /* michael - make sure prev node exists */ #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif xb_eof_error; } TempxbNodeLink = CurNode; CurNode = CurNode->PrevNode; CurNode->NextNode = NULL; ReleaseNodeMemory( TempxbNodeLink ); /* while no more left keys && not head node, pop up one node */ while(( CurNode->CurKeyNo == 0 ) && ( CurNode->NodeNo != HeadNode.StartNode )) { TempxbNodeLink = CurNode; CurNode = CurNode->PrevNode; CurNode->NextNode = NULL; ReleaseNodeMemory( TempxbNodeLink ); } /* if head node && left most key, return end-of-file */ if(( HeadNode.StartNode == CurNode->NodeNo ) && ( CurNode->CurKeyNo == 0 )) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif xb_eof_error; } /* move one to the left */ CurNode->CurKeyNo--; TempNodeNo = GetLeftNodeNo( CurNode->CurKeyNo, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } if( GetLeftNodeNo( 0, CurNode )) /* if interior node */ CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; else /* leaf node */ CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode - 1; /* traverse down the right side of the tree */ while( GetLeftNodeNo( 0, CurNode )) /* while interior node */ { TempNodeNo = GetLeftNodeNo( CurNode->Leaf.NoOfKeysThisNode, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { CurDbfRec = 0L; return rc; } if( GetLeftNodeNo( 0, CurNode )) /* if interior node */ CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; else /* leaf node */ CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode - 1; } CurDbfRec = GetDbfNo( CurNode->Leaf.NoOfKeysThisNode - 1, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } #ifndef XB_INLINE_COMPAREKEY /***********************************************************************/ //! Short description /*! \param Key1 \param Key2 \param Klen */ xbShort xbNdx::CompareKey( const char * Key1, const char * Key2, xbShort Klen ) { /* if key1 = key2 --> return 0 */ /* if key1 > key2 --> return 1 */ /* if key1 < key2 --> return 2 */ const char *k1, *k2; xbShort i; xbDouble d1, d2; int c; if(!( Key1 && Key2 )) return -1; if( Klen > HeadNode.KeyLen ) Klen = HeadNode.KeyLen; if( HeadNode.KeyType == 0 ) { #if 0 k1 = Key1; k2 = Key2; for( i = 0; i < Klen; i++ ) { if( *k1 > *k2 ) return 1; if( *k1 < *k2 ) return 2; k1++; k2++; } return 0; #else //printf("comparing '%s' to '%s'\n", Key1, Key2); c = memcmp(Key1, Key2, Klen); if(c < 0) return 2; else if(c > 0) return 1; return 0; #endif } else /* key is numeric */ { d1 = dbf->xbase->GetDouble( Key1 ); d2 = dbf->xbase->GetDouble( Key2 ); if( d1 == d2 ) return 0; else if( d1 > d2 ) return 1; else return 2; } } #endif /**************************************************************************/ //! Short description /*! \param key \param klen \param node \param comp */ /* ** This is a pretty basic binary search with two exceptions: 1) it will ** find the first of duplicate key values and 2) will return the index ** and the value of the last comparision even if it doesn't find a ** match. */ xbShort xbNdx::BSearchNode(const char *key, xbShort klen, const xbNdxNodeLink *node, xbShort *comp) { xbShort c = 1, p = -1, start = 0, end = node->Leaf.NoOfKeysThisNode - 1; if(start > end) { *comp = 2; return 0; } do { p = (start + end) / 2; c = CompareKey(key, GetKeyData(p, (xbNdxNodeLink *)node), klen); switch(c) { case 1 : /* greater than */ start = p + 1; break; case 2 : /* less than */ end = p - 1; break; } } while(start <= end && c); if(c == 1) while(p < node->Leaf.NoOfKeysThisNode && (c = CompareKey(key, GetKeyData(p, (xbNdxNodeLink *)node), klen)) == 1) p++; *comp = c; if(!c) while(p > 0 && !CompareKey(key, GetKeyData(p - 1, (xbNdxNodeLink *)node), klen)) p--; return p; } /***********************************************************************/ //! Short description /*! \param Tkey \param Klen */ xbLong xbNdx::GetLeafFromInteriorNode( const char * Tkey, xbShort Klen ) { /* This function scans an interior node for a key and returns the */ /* correct interior leaf node no */ xbShort p, c; /* if Tkey > any keys in node, return right most key */ p = CurNode->Leaf.NoOfKeysThisNode - 1; if( CompareKey( Tkey, GetKeyData( p, CurNode ), Klen ) == 1 ) { CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; return GetLeftNodeNo( CurNode->Leaf.NoOfKeysThisNode, CurNode ); } #ifndef USE_BSEARCH /* otherwise, start at the beginning and scan up */ p = 0; while( p < CurNode->Leaf.NoOfKeysThisNode && ( CompareKey( Tkey, GetKeyData( p, CurNode ), Klen ) == 1 )) p++; #else p = BSearchNode(Tkey, Klen, CurNode, &c); // if(c == 1) // p++; #endif CurNode->CurKeyNo = p; return GetLeftNodeNo( p, CurNode ); } /***********************************************************************/ //! Short description /*! \param d */ xbShort xbNdx::KeyExists( xbDouble d ) { char buf[9]; memset( buf, 0x00, 9 ); dbf->xbase->PutDouble( buf, d ); return FindKey( buf, 8, 0 ); } /***********************************************************************/ //! Short description /*! \param d */ xbShort xbNdx::FindKey( xbDouble d ) { char buf[9]; memset( buf, 0x00, 9 ); dbf->xbase->PutDouble( buf, d ); return FindKey( buf, 8, 1 ); } /***********************************************************************/ //! Short description /*! \param Key */ xbShort xbNdx::FindKey( const char * Key ) { return FindKey( Key, strlen( Key ), 1 ); } /***********************************************************************/ //! Short description /*! \param Tkey \param DbfRec */ xbShort xbNdx::FindKey( const char * Tkey, xbLong DbfRec ) { /* find a key with a specifc DBF record number */ xbShort rc; xbLong CurDbfRecNo; xbLong CurNdxDbfNo; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif /* if we are already on the correct key, return XB_FOUND */ if( CurNode ) { CurDbfRecNo = dbf->GetCurRecNo(); CurNdxDbfNo = GetDbfNo( CurNode->CurKeyNo, CurNode ); if( CurDbfRecNo == CurNdxDbfNo && (strncmp(Tkey, GetKeyData( CurNode->CurKeyNo, CurNode ), HeadNode.KeyLen ) == 0 )) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_FOUND; } } rc = FindKey( Tkey, HeadNode.KeyLen, 0 ); while( rc == 0 || rc == XB_FOUND ) { if( strncmp( Tkey, GetKeyData( CurNode->CurKeyNo, CurNode ), HeadNode.KeyLen ) == 0 ) { if( DbfRec == GetDbfNo( CurNode->CurKeyNo, CurNode )) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_FOUND; } else rc = GetNextKey( 0 ); } else { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_NOT_FOUND; } } #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_NOT_FOUND; } /***********************************************************************/ //! Short description /*! */ xbShort xbNdx::FindKey( void ) { /* if no paramaters given, use KeyBuf */ return( FindKey( KeyBuf, HeadNode.KeyLen, 0 )); } /***********************************************************************/ //! Short description /*! \param Tkey \param Klen \param RetrieveSw */ xbShort xbNdx::FindKey( const char * Tkey, xbShort Klen, xbShort RetrieveSw ) { /* This routine sets the current key to the found key */ /* if RetrieveSw is true, the method positions the dbf record */ xbShort rc,i; xbLong TempNodeNo; if( NodeChain ) { ReleaseNodeMemory( NodeChain ); NodeChain = NULL; } #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif if(( rc = GetHeadNode()) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* load first node */ if(( rc = GetLeafNode( HeadNode.StartNode, 1 )) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* traverse down the tree until it hits a leaf */ while( GetLeftNodeNo( 0, CurNode )) /* while interior node */ { TempNodeNo = GetLeafFromInteriorNode( Tkey, Klen ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } } /* leaf level */ #ifndef USE_BSEARCH for( i = 0; i < CurNode->Leaf.NoOfKeysThisNode; i++ ) { rc = CompareKey( Tkey, GetKeyData( i, CurNode ), Klen ); if( rc == 0 ) { CurNode->CurKeyNo = i; CurDbfRec = GetDbfNo( i, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if (RetrieveSw) dbf->GetRecord(CurDbfRec); return XB_FOUND; } else if( rc == 2 ) { CurNode->CurKeyNo = i; CurDbfRec = GetDbfNo( i, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if (RetrieveSw) dbf->GetRecord(CurDbfRec); return XB_NOT_FOUND; } } #else i = BSearchNode(Tkey, Klen, CurNode, &rc); switch(rc) { case 0 : /* found! */ CurNode->CurKeyNo = i; CurDbfRec = GetDbfNo( i, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if (RetrieveSw) dbf->GetRecord(CurDbfRec); return XB_FOUND; case 1 : /* less than */ // if(i < CurNode->Leaf.NoOfKeysThisNode) break; // i++; case 2 : /* greater than */ CurNode->CurKeyNo = i; CurDbfRec = GetDbfNo( i, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if (RetrieveSw) dbf->GetRecord(CurDbfRec); return XB_NOT_FOUND; } #endif CurNode->CurKeyNo = i; if(i >= CurNode->Leaf.NoOfKeysThisNode) { CurDbfRec = 0; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_EOF; } CurDbfRec = GetDbfNo( i, CurNode ); if ((RetrieveSw) && (CurDbfRec > 0)) dbf->GetRecord( CurDbfRec ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_NOT_FOUND; } /***********************************************************************/ //! Short description /*! */ xbShort xbNdx::CalcKeyLen( void ) { xbShort rc; xbExpNode * TempNode; char FieldName[11]; char Type; TempNode = dbf->xbase->GetFirstTreeNode( ExpressionTree ); if( !TempNode ) return 0; if( TempNode->Type == 'd' ) return -8; if( TempNode->Type == 'D' ) { memset( FieldName, 0x00, 11 ); memcpy( FieldName, TempNode->NodeText, TempNode->Len ); Type = dbf->GetFieldType( dbf->GetFieldNo( FieldName )); if( Type == 'N' || Type == 'F' ) return -8; } if(( rc = dbf->xbase->ProcessExpression( ExpressionTree )) != XB_NO_ERROR ) return 0; // dbf->xbase->DumpExpressionTree(ExpressionTree); TempNode = (xbExpNode *) dbf->xbase->Pop(); if( !TempNode ) return 0; rc = TempNode->DataLen; if( !TempNode->InTree ) delete TempNode; // dbf->xbase->FreeExpNode( TempNode ); //printf("CalcKeyLen returning %d\n", rc); return rc; } /***********************************************************************/ //! Short description /*! \param IxName \param Exp \param Unique \param Overlay */ xbShort xbNdx::CreateIndex(const char * IxName, const char * Exp, xbShort Unique, xbShort Overlay ) { xbShort i, NameLen, KeyLen, rc; IndexStatus = XB_CLOSED; if( strlen( Exp ) > 488 ) xb_error(XB_INVALID_KEY_EXPRESSION); if( dbf->GetDbfStatus() == 0 ) xb_error(XB_NOT_OPEN); /* Get the index file name and store it in the class */ NameLen = strlen( IxName ) + 1; if(( rc = dbf->NameSuffixMissing( 2, IxName )) > 0 ) NameLen +=4; IndexName = IxName; if( rc == 1 ) IndexName += ".ndx"; else if( rc == 2 ) IndexName += ".NDX"; /* check if the file already exists */ if (((indexfp = fopen( IndexName, "r" )) != NULL ) && !Overlay ) { fclose( indexfp ); xb_io_error(XB_FILE_EXISTS, IndexName); } if (indexfp) fclose(indexfp); if(( indexfp = fopen( IndexName, "w+b" )) == NULL ) xb_open_error(IndexName); #ifdef XB_LOCKING_ON /* ** Must turn off buffering when multiple programs may be accessing ** index files. */ setbuf( indexfp, NULL ); #endif #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_WRLCK)) != 0) return rc; #endif /* parse the expression */ if(( rc = dbf->xbase->BuildExpressionTree( Exp, strlen( Exp ), dbf )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } ExpressionTree = dbf->xbase->GetTree(); dbf->xbase->SetTreeToNull(); /* build the header record */ memset( &HeadNode, 0x00, sizeof( xbNdxHeadNode )); HeadNode.StartNode = 1L; HeadNode.TotalNodes = 2L; HeadNode.NoOfKeys = 1L; KeyLen = CalcKeyLen(); if( KeyLen == 0 || KeyLen > 100 ) /* 100 byte key length limit */ xb_error(XB_INVALID_KEY) else if( KeyLen == -8 ) { HeadNode.KeyType = 1; /* numeric key */ HeadNode.KeyLen = 8; } else { HeadNode.KeyType = 0; /* character key */ HeadNode.KeyLen = KeyLen; } // HeadNode.KeysPerNode = (xbUShort) ( XB_NDX_NODE_SIZE - (2*sizeof( xbLong ))) / // (HeadNode.KeyLen + 8 ); // HeadNode.KeySize = HeadNode.KeyLen + 8; // while(( HeadNode.KeySize % 4 ) != 0 ) HeadNode.KeySize++; /* multiple of 4*/ /* above code replaced with following by Paul Koufalis pkoufalis@cogicom.com */ // while(( HeadNode.KeyLen % 4 ) != 0 ) HeadNode.KeyLen++; /* multiple of 4*/ // HeadNode.KeySize = HeadNode.KeyLen + 8; /* above two lines commented out by gary 4/14/99 and replaced w/ following For compatibilyt with other Xbase tools KeyLen is the length of the key data KeySize = KeyLen+8, rounded up until divisible by 4 */ HeadNode.KeySize = HeadNode.KeyLen + 8; while(( HeadNode.KeySize % 4 ) != 0 ) HeadNode.KeySize++; /* multiple of 4*/ HeadNode.KeysPerNode = (xbUShort) (XB_NDX_NODE_SIZE - (2*sizeof( xbLong ))) / HeadNode.KeySize; HeadNode.Unique = Unique; strncpy( HeadNode.KeyExpression, Exp, 488 ); KeyBuf = (char *) malloc( HeadNode.KeyLen + 1 ); KeyBuf2 = (char *) malloc( HeadNode.KeyLen + 1 ); memset( KeyBuf, 0x00, HeadNode.KeyLen + 1 ); memset( KeyBuf2, 0x00, HeadNode.KeyLen + 1 ); if(( rc = PutHeadNode( &HeadNode, indexfp, 0 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* write node #1 all 0x00 */ for( i = 0; i < XB_NDX_NODE_SIZE; i++ ) { if ((fwrite("\x00", 1, 1, indexfp)) != 1) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif fclose( indexfp ); xb_io_error(XB_WRITE_ERROR, IndexName); } } IndexStatus = XB_OPEN; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return dbf->AddIndexToIxList( index, IndexName ); } /***********************************************************************/ //! Short description /*! \param RecNo \param n \param NodeNo */ xbShort xbNdx::PutLeftNodeNo( xbShort RecNo, xbNdxNodeLink *n, xbLong NodeNo ) { /* This routine sets n node's leftnode number */ xbNdxLeafNode *temp; char *p; if( !n ) xb_error(XB_INVALID_NODELINK); temp = &n->Leaf; if( RecNo < 0 || RecNo > HeadNode.KeysPerNode) xb_error(XB_INVALID_KEY); p = temp->KeyRecs; p+= RecNo * ( 8 + HeadNode.KeyLen ); dbf->xbase->PutLong( p, NodeNo ); return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param RecNo \param n \param DbfNo */ xbShort xbNdx::PutDbfNo( xbShort RecNo, xbNdxNodeLink *n, xbLong DbfNo ) { /* This routine sets n node's dbf number */ xbNdxLeafNode *temp; char *p; if( !n ) xb_error(XB_INVALID_NODELINK); temp = &n->Leaf; if( RecNo < 0 || RecNo > (HeadNode.KeysPerNode-1)) xb_error(XB_INVALID_KEY); p = temp->KeyRecs + 4; p+= RecNo * ( 8 + HeadNode.KeyLen ); dbf->xbase->PutLong( p, DbfNo ); return XB_NO_ERROR; } /************************************************************************/ //! Short description /*! \param l \param n */ xbShort xbNdx::PutLeafNode( xbLong l, xbNdxNodeLink *n ) { if ((fseek(indexfp, l * XB_NDX_NODE_SIZE , SEEK_SET)) != 0) { fclose( indexfp ); xb_io_error(XB_SEEK_ERROR, IndexName); } dbf->xbase->PutLong( Node, n->Leaf.NoOfKeysThisNode ); if(( fwrite( Node, 4, 1, indexfp )) != 1 ) { fclose( indexfp ); xb_io_error(XB_WRITE_ERROR, IndexName); } if(( fwrite( &n->Leaf.KeyRecs, XB_NDX_NODE_SIZE-4, 1, indexfp )) != 1 ) { fclose( indexfp ); xb_io_error(XB_WRITE_ERROR, IndexName); } return 0; } /************************************************************************/ //! Short description /*! \param Head \param f \param UpdateOnly */ xbShort xbNdx::PutHeadNode( xbNdxHeadNode * Head, FILE * f, xbShort UpdateOnly ) { char buf[4]; if(( fseek( f, 0L, SEEK_SET )) != 0 ) { fclose( f ); xb_io_error(XB_SEEK_ERROR, IndexName); } memset( buf, 0x00, 4 ); dbf->xbase->PutLong( buf, Head->StartNode ); if(( fwrite( &buf, 4, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } memset( buf, 0x00, 4 ); dbf->xbase->PutLong( buf, Head->TotalNodes ); if(( fwrite( &buf, 4, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } memset( buf, 0x00, 4 ); dbf->xbase->PutLong( buf, Head->NoOfKeys ); if(( fwrite( &buf, 4, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } if( UpdateOnly ) return XB_NO_ERROR; memset( buf, 0x00, 2 ); dbf->xbase->PutLong( buf, Head->KeyLen ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } memset( buf, 0x00, 2 ); dbf->xbase->PutLong( buf, Head->KeysPerNode ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } memset( buf, 0x00, 2 ); dbf->xbase->PutLong( buf, Head->KeyType ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } memset( buf, 0x00, 4 ); dbf->xbase->PutLong( buf, Head->KeySize ); if(( fwrite( &buf, 4, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } // if(( fwrite( &Head->Unknown2, 490, 1, f )) != 1 ) if(( fwrite( &Head->Unknown2, XB_NDX_NODE_SIZE - 22, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } return 0; } /************************************************************************/ //! Short description /*! \param RecNo \param n */ xbShort xbNdx::PutKeyData( xbShort RecNo, xbNdxNodeLink *n ) { /* This routine copies the KeyBuf data into xbNdxNodeLink n */ xbNdxLeafNode *temp; char *p; xbShort i; if( !n ) xb_error(XB_INVALID_NODELINK); temp = &n->Leaf; if( RecNo < 0 || RecNo > (HeadNode.KeysPerNode-1)) xb_error(XB_INVALID_KEY); p = temp->KeyRecs + 8; p+= RecNo * ( 8 + HeadNode.KeyLen ); for( i = 0; i < HeadNode.KeyLen; i++ ) { *p = KeyBuf[i]; p++; } return XB_NO_ERROR; } /************************************************************************/ //! Short description /*! \param n \param pos \param d \param l \param w */ xbShort xbNdx::PutKeyInNode( xbNdxNodeLink * n, xbShort pos, xbLong d, xbLong l, xbShort w ) { xbShort i; /* check the node */ if (!n) xb_error(XB_INVALID_NODELINK); if(pos < 0 || pos > HeadNode.KeysPerNode) xb_error(XB_INVALID_RECORD); if(n->Leaf.NoOfKeysThisNode >= HeadNode.KeysPerNode) xb_error(XB_NODE_FULL); /* if key movement, save the original key */ if( pos < n->Leaf.NoOfKeysThisNode ) memcpy( KeyBuf2, KeyBuf, HeadNode.KeyLen + 1); /* if interior node, handle the right most left node no */ if( GetLeftNodeNo( 0, n )) PutLeftNodeNo( n->Leaf.NoOfKeysThisNode+1, n, GetLeftNodeNo( n->Leaf.NoOfKeysThisNode, n )); for( i = n->Leaf.NoOfKeysThisNode; i > pos; i-- ) { memcpy( KeyBuf, GetKeyData(i-1,n), HeadNode.KeyLen ); PutKeyData( i, n ); PutDbfNo( i, n, GetDbfNo(i-1,n)); PutLeftNodeNo(i, n, GetLeftNodeNo(i-1,n)); } /* put new key in node */ if( pos < n->Leaf.NoOfKeysThisNode ) memcpy( KeyBuf, KeyBuf2, HeadNode.KeyLen + 1); PutKeyData( pos, n ); PutDbfNo( pos, n, d ); PutLeftNodeNo( pos, n, l ); n->Leaf.NoOfKeysThisNode++; if( w ) return PutLeafNode( n->NodeNo, n ); else return 0; } /************************************************************************/ //! Short description /*! \param n1 \param n2 \param pos \param d */ xbShort xbNdx::SplitLeafNode( xbNdxNodeLink *n1, xbNdxNodeLink *n2, xbShort pos, xbLong d ) { xbShort i,j,rc; if( !n1 || !n2 ) xb_error(XB_INVALID_NODELINK); if( pos < 0 || pos > HeadNode.KeysPerNode ) xb_error(XB_INVALID_NODELINK); if( pos < HeadNode.KeysPerNode ) /* if it belongs in node */ { /* save the original key */ memcpy( KeyBuf2, KeyBuf, HeadNode.KeyLen + 1); PutKeyData( HeadNode.KeysPerNode, n2 ); for( j = 0,i = pos; i < n1->Leaf.NoOfKeysThisNode; j++,i++ ) { memcpy( KeyBuf, GetKeyData( i, n1 ), HeadNode.KeyLen ); PutKeyData ( j, n2 ); PutDbfNo ( j, n2, GetDbfNo ( i, n1 )); n2->Leaf.NoOfKeysThisNode++; } /* restore original key */ memcpy( KeyBuf, KeyBuf2, HeadNode.KeyLen + 1); /* update original leaf */ PutKeyData( pos, n1 ); PutDbfNo ( pos, n1, d ); n1->Leaf.NoOfKeysThisNode = pos+1; } else /* put the key in a new node because it doesn't fit in the CurNode*/ { PutKeyData ( 0, n2 ); PutDbfNo ( 0, n2, d ); n2->Leaf.NoOfKeysThisNode++; } if(( rc = PutLeafNode( n1->NodeNo, n1 )) != 0 ) return rc; if(( rc = PutLeafNode( n2->NodeNo, n2 )) != 0 ) return rc; return 0; } /************************************************************************/ //! Short description /*! \param n1 \param n2 \param t */ xbShort xbNdx::SplitINode( xbNdxNodeLink *n1, xbNdxNodeLink *n2, xbLong t ) /* parent, tempnode, tempnodeno */ { xbShort i,j,rc; xbNdxNodeLink * SaveNodeChain; xbNdxNodeLink * SaveCurNode; /* if not at the end of the node shift everthing to the right */ if( n1->CurKeyNo+1 < HeadNode.KeysPerNode ) /* this clause appears to work */ { if( CurNode->NodeNo == HeadNode.StartNode ) cout << "\nHead node "; for( j = 0,i = n1->CurKeyNo+1; i < n1->Leaf.NoOfKeysThisNode; i++,j++ ) { memcpy( KeyBuf, GetKeyData( i, n1 ), HeadNode.KeyLen ); PutKeyData( j, n2 ); PutLeftNodeNo( j, n2, GetLeftNodeNo( i, n1 )); } PutLeftNodeNo( j, n2, GetLeftNodeNo( i, n1 )); n2->Leaf.NoOfKeysThisNode = n1->Leaf.NoOfKeysThisNode - n1->CurKeyNo - 1; n1->Leaf.NoOfKeysThisNode = n1->Leaf.NoOfKeysThisNode - n2->Leaf.NoOfKeysThisNode; /* attach the new leaf to the original parent */ SaveNodeChain = NodeChain; NodeChain = NULL; SaveCurNode = CurNode; GetLastKey( CurNode->NodeNo, 0 ); memcpy( KeyBuf, GetKeyData( CurNode->CurKeyNo, CurNode ),HeadNode.KeyLen); ReleaseNodeMemory( NodeChain ); NodeChain = SaveNodeChain; CurNode = SaveCurNode; PutKeyData( n1->CurKeyNo, n1 ); PutLeftNodeNo( n1->CurKeyNo + 1, n1, t ); } else if( n1->CurKeyNo + 1 == HeadNode.KeysPerNode ) { SaveNodeChain = NodeChain; NodeChain = NULL; SaveCurNode = CurNode; GetLastKey( t, 0 ); memcpy( KeyBuf,GetKeyData(CurNode->CurKeyNo,CurNode), HeadNode.KeyLen ); PutKeyData( 0, n2 ); PutLeftNodeNo( 0, n2, t ); PutLeftNodeNo( 1, n2, GetLeftNodeNo( n1->Leaf.NoOfKeysThisNode, n1 )); ReleaseNodeMemory( NodeChain ); NodeChain = SaveNodeChain; CurNode = SaveCurNode; n2->Leaf.NoOfKeysThisNode = 1; n1->Leaf.NoOfKeysThisNode--; } else /* pos = HeadNode.KeysPerNode */ { SaveNodeChain = NodeChain; NodeChain = NULL; SaveCurNode = CurNode; GetLastKey( CurNode->NodeNo, 0 ); memcpy( KeyBuf, GetKeyData( CurNode->CurKeyNo, CurNode ), HeadNode.KeyLen ); ReleaseNodeMemory( NodeChain ); NodeChain = SaveNodeChain; CurNode = SaveCurNode; PutKeyData( 0, n2 ); PutLeftNodeNo( 0, n2, CurNode->NodeNo ); PutLeftNodeNo( 1, n2, t ); n2->Leaf.NoOfKeysThisNode = 1; n1->Leaf.NoOfKeysThisNode--; } n2->NodeNo = HeadNode.TotalNodes++; if((rc = PutLeafNode( n1->NodeNo,n1 )) != 0) return rc; if((rc = PutLeafNode( n2->NodeNo,n2 )) != 0) return rc; return 0; } /************************************************************************/ //! Short description /*! \param RecBufSw \param KeyBufSw */ xbShort xbNdx::CreateKey( xbShort RecBufSw, xbShort KeyBufSw ) { /* RecBufSw 0 Use RecBuf */ /* 1 Use RecBuf2 */ /* KeyBufSw 0 Use KeyBuf */ /* 1 Use KeyBuf2 */ xbShort rc; xbExpNode * TempNode; if(( rc = dbf->xbase->ProcessExpression( ExpressionTree, RecBufSw )) != XB_NO_ERROR ) return rc; TempNode = (xbExpNode *) dbf->xbase->Pop(); if( !TempNode ) xb_error(XB_INVALID_KEY); if( KeyBufSw ) { if( HeadNode.KeyType == 1 ) /* numeric key */ dbf->xbase->PutDouble( KeyBuf2, TempNode->DoubResult ); else /* character key */ { memset( KeyBuf2, 0x00, HeadNode.KeyLen + 1 ); memcpy( KeyBuf2, TempNode->StringResult, TempNode->DataLen ); } } else { if( HeadNode.KeyType == 1 ) /* numeric key */ dbf->xbase->PutDouble( KeyBuf, TempNode->DoubResult ); else /* character key */ { memset( KeyBuf, 0x00, HeadNode.KeyLen + 1 ); memcpy( KeyBuf, TempNode->StringResult.c_str(), TempNode->DataLen ); } } // if( !TempNode->InTree ) dbf->xbase->FreeExpNode( TempNode ); if( !TempNode->InTree ) delete TempNode; return 0; } /************************************************************************/ //! Short description /*! \param key */ xbShort xbNdx::GetCurrentKey(char *key) { CreateKey(0, 0); if(HeadNode.KeyType == 1) memcpy(key, KeyBuf, 8); else memcpy(key, KeyBuf, HeadNode.KeyLen + 1); return 0; } /************************************************************************/ //! Short description /*! \param DbfRec */ xbShort xbNdx::AddKey( xbLong DbfRec ) { /* This routine assumes KeyBuf contains the contents of the index to key */ char *p; xbShort i,rc; xbNdxNodeLink * TempNode; xbNdxNodeLink * Tparent; xbLong TempNodeNo = 0L; /* new, unattached leaf node no */ xbNdxNodeLink * SaveNodeChain; xbNdxNodeLink * SaveCurNode; /* find node key belongs in */ rc = FindKey( KeyBuf, HeadNode.KeyLen, 0 ); if( rc == XB_FOUND && HeadNode.Unique ) xb_error(XB_KEY_NOT_UNIQUE); if( CurNode->Leaf.NoOfKeysThisNode > 0 && rc == XB_FOUND ) { rc = 0; while( rc == 0 ) { if(( p = GetKeyData( CurNode->CurKeyNo, CurNode )) == NULL ) rc = -1; else { rc = CompareKey( KeyBuf, p, HeadNode.KeyLen ); if( rc == 0 && DbfRec >= GetDbfNo( CurNode->CurKeyNo, CurNode )) { #ifdef HAVE_EXCEPTIONS try { #endif if((rc = GetNextKey(0)) == XB_EOF) { if((rc = GetLastKey(0, 0)) != XB_NO_ERROR) return rc; CurNode->CurKeyNo++; } #ifdef HAVE_EXCEPTIONS } catch (xbEoFException &) { GetLastKey(0, 0); CurNode->CurKeyNo++; } #endif } else rc = -1; } } } /* update header node */ HeadNode.NoOfKeys++; /************************************************/ /* section A - if room in node, add key to node */ /************************************************/ if( CurNode->Leaf.NoOfKeysThisNode < HeadNode.KeysPerNode ) { if(( rc = PutKeyInNode( CurNode,CurNode->CurKeyNo,DbfRec,0L,1)) != 0) { return rc; } if(( rc = PutHeadNode( &HeadNode, indexfp, 1 )) != 0) { return rc; } return XB_NO_ERROR; } /***********************************************************************/ /* section B - split leaf node if full and put key in correct position */ /***********************************************************************/ TempNode = GetNodeMemory(); TempNode->NodeNo = HeadNode.TotalNodes++; rc = SplitLeafNode( CurNode, TempNode, CurNode->CurKeyNo, DbfRec ); if( rc ) { return rc; } TempNodeNo = TempNode->NodeNo; ReleaseNodeMemory( TempNode ); /*****************************************************/ /* section C go up tree splitting nodes as necessary */ /*****************************************************/ Tparent = CurNode->PrevNode; while( Tparent && Tparent->Leaf.NoOfKeysThisNode >= HeadNode.KeysPerNode ) { TempNode = GetNodeMemory(); if( !TempNode ) { xb_memory_error; } rc = SplitINode( Tparent, TempNode, TempNodeNo ); if( rc ) return rc; TempNodeNo = TempNode->NodeNo; ReleaseNodeMemory( TempNode ); ReleaseNodeMemory( CurNode ); CurNode = Tparent; CurNode->NextNode = NULL; Tparent = CurNode->PrevNode; } /************************************************************/ /* Section D if CurNode is split root, create new root */ /************************************************************/ /* at this point CurNode = The node that was just split TempNodeNo = The new node split off from CurNode */ if(CurNode->NodeNo == HeadNode.StartNode ) { TempNode = GetNodeMemory(); if( !TempNode ) { xb_memory_error; } SaveNodeChain = NodeChain; NodeChain = NULL; SaveCurNode = CurNode; GetLastKey( CurNode->NodeNo, 0 ); memcpy( KeyBuf, GetKeyData( CurNode->CurKeyNo,CurNode ),HeadNode.KeyLen ); ReleaseNodeMemory( NodeChain ); NodeChain = SaveNodeChain; CurNode = SaveCurNode; PutKeyData( 0, TempNode ); PutLeftNodeNo( 0, TempNode, CurNode->NodeNo ); PutLeftNodeNo( 1, TempNode, TempNodeNo ); TempNode->NodeNo = HeadNode.TotalNodes++; TempNode->Leaf.NoOfKeysThisNode++; HeadNode.StartNode = TempNode->NodeNo; rc = PutLeafNode( TempNode->NodeNo, TempNode ); if( rc ) return rc; rc = PutHeadNode( &HeadNode, indexfp, 1 ); if( rc ) return rc; ReleaseNodeMemory( TempNode ); return XB_NO_ERROR; } /**********************************/ /* Section E make room in parent */ /**********************************/ for( i = Tparent->Leaf.NoOfKeysThisNode; i > Tparent->CurKeyNo; i-- ) { memcpy( KeyBuf, GetKeyData( i-1, Tparent ), HeadNode.KeyLen ); PutKeyData( i, Tparent ); PutLeftNodeNo( i+1, Tparent, GetLeftNodeNo( i, Tparent )); } /* put key in parent */ SaveNodeChain = NodeChain; NodeChain = NULL; SaveCurNode = CurNode; GetLastKey( CurNode->NodeNo, 0 ); memcpy( KeyBuf,GetKeyData( CurNode->CurKeyNo, CurNode ), HeadNode.KeyLen ); ReleaseNodeMemory( NodeChain ); NodeChain = SaveNodeChain; CurNode = SaveCurNode; PutKeyData( i, Tparent ); PutLeftNodeNo( i+1, Tparent, TempNodeNo ); Tparent->Leaf.NoOfKeysThisNode++; rc = PutLeafNode( Tparent->NodeNo, Tparent ); if( rc ) return rc; rc = PutHeadNode( &HeadNode, indexfp, 1 ); if( rc ) return rc; return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param pos \param n */ xbShort xbNdx::RemoveKeyFromNode( xbShort pos, xbNdxNodeLink *n ) { xbShort i; /* check the node */ if( !n ) xb_error(XB_INVALID_NODELINK); if( pos < 0 || pos > HeadNode.KeysPerNode ) xb_error(XB_INVALID_KEY); for( i = pos; i < n->Leaf.NoOfKeysThisNode-1; i++ ) { memcpy( KeyBuf, GetKeyData( i+1, n), HeadNode.KeyLen ); PutKeyData( i, n ); PutDbfNo( i, n, GetDbfNo( i+1, n )); PutLeftNodeNo( i, n, GetLeftNodeNo( i+1, n )); } PutLeftNodeNo( i, n, GetLeftNodeNo( i+1, n )); n->Leaf.NoOfKeysThisNode--; /* if last key was deleted, decrement CurKeyNo */ if( n->CurKeyNo > n->Leaf.NoOfKeysThisNode ) n->CurKeyNo--; return PutLeafNode( n->NodeNo, n ); } /***********************************************************************/ //! Short description /*! \param n */ xbShort xbNdx::UpdateParentKey( xbNdxNodeLink * n ) { /* this routine goes backwards thru the node chain looking for a parent node to update */ xbNdxNodeLink * TempNode; if( !n ) xb_error(XB_INVALID_NODELINK); if( !GetDbfNo( 0, n )) xb_error(XB_NOT_LEAFNODE); TempNode = n->PrevNode; while( TempNode ) { if( TempNode->CurKeyNo < TempNode->Leaf.NoOfKeysThisNode ) { memcpy(KeyBuf,GetKeyData(n->Leaf.NoOfKeysThisNode-1,n),HeadNode.KeyLen); PutKeyData( TempNode->CurKeyNo, TempNode ); return PutLeafNode( TempNode->NodeNo, TempNode ); } TempNode = TempNode->PrevNode; } return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param n */ /* This routine queues up a list of nodes which have been emptied */ void xbNdx::UpdateDeleteList( xbNdxNodeLink *n ) { n->NextNode = DeleteChain; DeleteChain = n; } /***********************************************************************/ //! Short description /*! */ /* Delete nodes from the node list - for now we leave the empty nodes */ /* dangling in the file. Eventually we will remove nodes from the file */ void xbNdx::ProcessDeleteList( void ) { if( DeleteChain ) { ReleaseNodeMemory( DeleteChain ); DeleteChain = NULL; } } /***********************************************************************/ //! Short description /*! */ xbShort xbNdx::KeyWasChanged( void ) { CreateKey( 0, 0 ); /* use KeyBuf, RecBuf */ CreateKey( 1, 1 ); /* use KeyBuf2, RecBuf2 */ if( CompareKey( KeyBuf, KeyBuf2, HeadNode.KeyLen ) != 0 ) return 1; else return 0; } /***********************************************************************/ //! Short description /*! \param n */ xbNdxNodeLink * xbNdx::LeftSiblingHasSpace( xbNdxNodeLink * n ) { xbNdxNodeLink * TempNode; xbNdxNodeLink * SaveCurNode; /* returns a Nodelink to xbNdxNodeLink n's left sibling if it has space */ /* if left most node in parent return NULL */ if( n->PrevNode->CurKeyNo == 0 ) return NULL; SaveCurNode = CurNode; GetLeafNode( GetLeftNodeNo( n->PrevNode->CurKeyNo-1, n->PrevNode ), 2 ); if( CurNode->Leaf.NoOfKeysThisNode < HeadNode.KeysPerNode ) { TempNode = CurNode; CurNode = SaveCurNode; TempNode->PrevNode = n->PrevNode; return TempNode; } else /* node is already full */ { ReleaseNodeMemory( CurNode ); CurNode = SaveCurNode; return NULL; } } /***********************************************************************/ //! Short description /*! \param n */ xbNdxNodeLink * xbNdx::RightSiblingHasSpace( xbNdxNodeLink * n ) { /* returns a Nodelink to xbNdxNodeLink n's right sibling if it has space */ xbNdxNodeLink * TempNode; xbNdxNodeLink * SaveCurNode; /* if left most node in parent return NULL */ if( n->PrevNode->CurKeyNo >= n->PrevNode->Leaf.NoOfKeysThisNode ) return NULL; SaveCurNode = CurNode; /* point curnode to right sib*/ GetLeafNode( GetLeftNodeNo( n->PrevNode->CurKeyNo+1, n->PrevNode ), 2 ); if( CurNode->Leaf.NoOfKeysThisNode < HeadNode.KeysPerNode ) { TempNode = CurNode; CurNode = SaveCurNode; TempNode->PrevNode = n->PrevNode; return TempNode; } else /* node is already full */ { ReleaseNodeMemory( CurNode ); CurNode = SaveCurNode; return NULL; } } /*************************************************************************/ //! Short description /*! \param n \param Right */ xbShort xbNdx::MoveToRightNode( xbNdxNodeLink * n, xbNdxNodeLink * Right ) { xbShort j; xbNdxNodeLink * TempNode; xbNdxNodeLink * SaveCurNode; xbNdxNodeLink * SaveNodeChain; if( n->CurKeyNo == 0 ) { j = 1; SaveNodeChain = NodeChain; SaveCurNode = CurNode; NodeChain = NULL; GetLastKey( n->NodeNo, 0 ); memcpy( KeyBuf, GetKeyData( CurNode->CurKeyNo, CurNode),HeadNode.KeyLen); ReleaseNodeMemory( NodeChain ); NodeChain = SaveNodeChain; CurNode = SaveCurNode; } else { j = 0; memcpy( KeyBuf, GetKeyData( j, n ), HeadNode.KeyLen); } PutKeyInNode( Right, 0, 0L, GetLeftNodeNo( j, n ), 1 ); ReleaseNodeMemory( Right ); TempNode = n; CurNode = n->PrevNode; n = n->PrevNode; n->NextNode = NULL; UpdateDeleteList( TempNode ); DeleteSibling( n ); return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param n \param Left */ xbShort xbNdx::MoveToLeftNode( xbNdxNodeLink * n, xbNdxNodeLink * Left ) { xbShort j, rc; xbNdxNodeLink * SaveNodeChain; xbNdxNodeLink * TempNode; if( n->CurKeyNo == 0 ) j = 1; else j = 0; /* save the original node chain */ SaveNodeChain = NodeChain; NodeChain = NULL; /* determine new right most key for left node */ GetLastKey( Left->NodeNo, 0 ); memcpy( KeyBuf, GetKeyData( CurNode->CurKeyNo, CurNode ), HeadNode.KeyLen); ReleaseNodeMemory( NodeChain ); NodeChain = NULL; /* for next GetLastKey */ PutKeyData( Left->Leaf.NoOfKeysThisNode, Left); PutLeftNodeNo( Left->Leaf.NoOfKeysThisNode+1, Left, GetLeftNodeNo( j,n )); Left->Leaf.NoOfKeysThisNode++; Left->CurKeyNo = Left->Leaf.NoOfKeysThisNode; if(( rc = PutLeafNode( Left->NodeNo, Left )) != 0 ) return rc; n->PrevNode->NextNode = NULL; UpdateDeleteList( n ); /* get the new right most key for left to update parents */ GetLastKey( Left->NodeNo, 0 ); /* assemble the chain */ TempNode = Left->PrevNode; TempNode->CurKeyNo--; NodeChain->PrevNode = Left->PrevNode; UpdateParentKey( CurNode ); ReleaseNodeMemory( NodeChain ); ReleaseNodeMemory( Left ); CurNode = TempNode; NodeChain = SaveNodeChain; TempNode->CurKeyNo++; DeleteSibling( TempNode ); return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param n */ xbShort xbNdx::DeleteSibling( xbNdxNodeLink * n ) { xbNdxNodeLink * Left; xbNdxNodeLink * Right; xbNdxNodeLink * SaveCurNode; xbNdxNodeLink * SaveNodeChain; xbNdxNodeLink * TempNode; xbShort rc; /* this routine deletes sibling CurRecNo out of xbNodeLink n */ if( n->Leaf.NoOfKeysThisNode > 1 ) { RemoveKeyFromNode( n->CurKeyNo, n ); if( n->CurKeyNo == n->Leaf.NoOfKeysThisNode ) { SaveNodeChain = NodeChain; SaveCurNode = CurNode; NodeChain = NULL; GetLastKey( n->NodeNo, 0 ); /* assemble the node chain */ TempNode = NodeChain->NextNode; NodeChain->NextNode = NULL; ReleaseNodeMemory( NodeChain ); TempNode->PrevNode = n; UpdateParentKey( CurNode ); /* take it back apart */ ReleaseNodeMemory( TempNode ); NodeChain = SaveNodeChain; CurNode = SaveCurNode; } } else if( n->NodeNo == HeadNode.StartNode ) { /* get here if root node and only one child remains */ /* make remaining node the new root */ if( n->CurKeyNo == 0 ) HeadNode.StartNode = GetLeftNodeNo( 1, n ); else HeadNode.StartNode = GetLeftNodeNo( 0, n ); UpdateDeleteList( n ); NodeChain = NULL; CurNode = NULL; } else if (( Left = LeftSiblingHasSpace( n )) != NULL ) { return MoveToLeftNode( n, Left ); } else if (( Right = RightSiblingHasSpace( n )) != NULL ) { return MoveToRightNode( n, Right ); } /* else if left sibling exists */ else if( n->PrevNode->CurKeyNo > 0 ) { /* move right branch from left sibling to this node */ SaveCurNode = CurNode; SaveNodeChain = NodeChain; NodeChain = NULL; GetLeafNode( GetLeftNodeNo( n->PrevNode->CurKeyNo-1, n->PrevNode ), 2 ); Left = CurNode; Left->PrevNode = SaveCurNode->PrevNode; GetLastKey( Left->NodeNo, 0 ); strncpy( KeyBuf, GetKeyData( CurNode->CurKeyNo,CurNode),HeadNode.KeyLen ); if( n->CurKeyNo == 1 ) PutLeftNodeNo( 1, n, GetLeftNodeNo( 0, n )); PutKeyData( 0, n ); PutLeftNodeNo( 0, n, GetLeftNodeNo( Left->Leaf.NoOfKeysThisNode, Left )); if(( rc = PutLeafNode( n->NodeNo, n )) != XB_NO_ERROR ) return rc; SaveCurNode = n->PrevNode; SaveCurNode->NextNode = NULL; ReleaseNodeMemory( n ); Left->Leaf.NoOfKeysThisNode--; if(( rc = PutLeafNode( Left->NodeNo, Left )) != XB_NO_ERROR ) return rc; /* rebuild left side of tree */ GetLastKey( Left->NodeNo, 0 ); NodeChain->PrevNode = SaveCurNode; SaveCurNode->CurKeyNo--; UpdateParentKey( CurNode ); ReleaseNodeMemory( NodeChain ); ReleaseNodeMemory( Left ); CurNode = SaveCurNode; NodeChain = SaveNodeChain; } /* right sibling must exist */ else if( n->PrevNode->CurKeyNo <= n->PrevNode->Leaf.NoOfKeysThisNode ) { /* move left branch from left sibling to this node */ SaveCurNode = CurNode; SaveNodeChain = NodeChain; NodeChain = NULL; /* move the left node number one to the left if necessary */ if( n->CurKeyNo == 0 ) { PutLeftNodeNo( 0, n, GetLeftNodeNo( 1, n )); GetLastKey( GetLeftNodeNo( 0, n ), 0 ); memcpy(KeyBuf,GetKeyData(CurNode->CurKeyNo,CurNode),HeadNode.KeyLen); PutKeyData( 0, n ); ReleaseNodeMemory( NodeChain ); NodeChain = NULL; } GetLeafNode( GetLeftNodeNo( n->PrevNode->CurKeyNo+1, n->PrevNode ), 2 ); /* put leftmost node number from right node in this node */ PutLeftNodeNo( 1, n, GetLeftNodeNo( 0, CurNode )); if(( rc = PutLeafNode( n->NodeNo, n )) != XB_NO_ERROR ) return rc; /* remove the key from the right node */ RemoveKeyFromNode( 0, CurNode ); if(( rc = PutLeafNode( CurNode->NodeNo, CurNode )) != XB_NO_ERROR ) return rc; ReleaseNodeMemory( CurNode ); /* update new parent key value */ GetLastKey( n->NodeNo, 0 ); NodeChain->PrevNode = n->PrevNode; UpdateParentKey( CurNode ); ReleaseNodeMemory( NodeChain ); NodeChain = SaveNodeChain; CurNode = SaveCurNode; } else { /* this should never be true-but could be if 100 byte limit is ignored*/ cout << "Fatal index error\n"; exit(0); } return XB_NO_ERROR; } /***********************************************************************/ //! Short description /*! \param DbfRec */ xbShort xbNdx::DeleteKey( xbLong DbfRec ) { /* this routine assumes the key to be deleted is in KeyBuf */ xbNdxNodeLink * TempNode; xbShort rc; #if 0 // Not sure why this check is here, but it prevents numeric keys // from being deleted (and thus index updates will also fail). // I have removed it for now. Derry Bryson if( HeadNode.KeyType != 0x00 ) xb_error(XB_INVALID_KEY_TYPE); #endif if(( rc = FindKey( KeyBuf, DbfRec )) != XB_FOUND ) return rc; /* found the record to delete at this point */ HeadNode.NoOfKeys--; /* delete the key from the node */ if(( rc = RemoveKeyFromNode( CurNode->CurKeyNo, CurNode )) != 0 ) return rc; /* if root node, we are done */ if( !( CurNode->NodeNo == HeadNode.StartNode )) { /* if leaf node now empty */ if( CurNode->Leaf.NoOfKeysThisNode == 0 ) { TempNode = CurNode->PrevNode; TempNode->NextNode = NULL; UpdateDeleteList( CurNode ); CurNode = TempNode; DeleteSibling( CurNode ); ProcessDeleteList(); } /* if last key of leaf updated, update key in parent node */ /* this logic updates the correct parent key */ else if( CurNode->CurKeyNo == CurNode->Leaf.NoOfKeysThisNode ) { UpdateParentKey( CurNode ); } } if(CurNode) CurDbfRec = GetDbfNo( CurNode->CurKeyNo, CurNode ); else CurDbfRec = 0; if(( rc = PutHeadNode( &HeadNode, indexfp, 1 )) != 0 ) return rc; return XB_NO_ERROR; } /************************************************************************/ //! Short description /*! \param option */ #ifdef XBASE_DEBUG xbShort xbNdx::CheckIndexIntegrity( const xbShort option ) { /* if option = 1, print out some stats */ xbShort rc; xbLong ctr = 1L; rc = dbf->GetRecord( ctr ); while( ctr < dbf->NoOfRecords() ) { ctr++; if( option ) cout << "\nChecking Record " << ctr; if(!dbf->RecordDeleted()) { CreateKey( 0, 0 ); rc = FindKey( KeyBuf, dbf->GetCurRecNo()); if( rc != XB_FOUND ) { if( option ) { cout << "\nRecord number " << dbf->GetCurRecNo() << " Not Found\n"; cout << "Key = " << KeyBuf << "\n"; } return rc; } } if(( rc = dbf->GetRecord( ctr )) != XB_NO_ERROR ) return rc; } if( option ){ cout << "\nTotal records checked = " << ctr << "\n"; cout << "Exiting with rc = " << rc << "\n"; } return XB_NO_ERROR; } #endif /***********************************************************************/ //! Short description /*! \param statusFunc */ xbShort xbNdx::ReIndex(void (*statusFunc)(xbLong itemNum, xbLong numItems)) { /* this method assumes the index has been locked in exclusive mode */ xbLong l; xbShort rc = XB_NO_ERROR, i, NameLen, saveAutoLock; xbNdxHeadNode TempHead; FILE *t; xbString TempName; memcpy( &TempHead, &HeadNode, sizeof( struct xbNdxHeadNode )); TempHead.NoOfKeys = 1L; TempHead.TotalNodes = 2L; TempHead.StartNode = 1L; if(( rc = dbf->xbase->DirectoryExistsInName( IndexName )) > 0 ) NameLen = rc + 13; else NameLen = 13; if (rc) { TempName.assign(IndexName, 0, rc); TempName += "TEMPFILE.NDX"; } else TempName = "TEMPFILE.NDX"; if(( t = fopen( TempName, "w+b" )) == NULL ) xb_open_error(TempName); if(( rc = PutHeadNode( &TempHead, t, 0 )) != 0 ) { fclose( t ); remove(TempName); return rc; } for( i = 0; i < XB_NDX_NODE_SIZE; i++ ) { if(( fwrite( "\x00", 1, 1, t )) != 1 ) { fclose( t ); remove(TempName); xb_io_error(XB_WRITE_ERROR, TempName); } } if( fclose( indexfp ) != 0 ) xb_io_error(XB_CLOSE_ERROR, IndexName); if( fclose( t ) != 0 ) xb_io_error(XB_CLOSE_ERROR, TempName); if( remove( IndexName ) != 0 ) xb_io_error(XB_CLOSE_ERROR, IndexName); if( rename(TempName, IndexName ) != 0 ) xb_io_error(XB_WRITE_ERROR, IndexName); if(( indexfp = fopen( IndexName, "r+b" )) == NULL ) xb_open_error(IndexName); saveAutoLock = dbf->GetAutoLock(); dbf->AutoLockOff(); for( l = 1; l <= dbf->PhysicalNoOfRecords(); l++ ) { if(statusFunc && (l == 1 || !(l % 100) || l == dbf->PhysicalNoOfRecords())) statusFunc(l, dbf->PhysicalNoOfRecords()); if(( rc = dbf->GetRecord(l)) != XB_NO_ERROR ) goto Outtahere; if(!dbf->GetRealDelete() || !dbf->RecordDeleted()) { /* Create the key */ CreateKey( 0, 0 ); /* add key to index */ if(( rc = AddKey( l )) != XB_NO_ERROR ) goto Outtahere; } } Outtahere: if(saveAutoLock) dbf->AutoLockOn(); return rc; } //! Short description /*! \param size */ void xbNdx::SetNodeSize(xbShort size) { #ifdef XB_VAR_NODESIZE if(size >= XB_DEFAULT_NDX_NODE_SIZE) { if(size % XB_NDX_NODE_MULTIPLE) NodeSize = ((size + XB_NDX_NODE_MULTIPLE) / XB_NDX_NODE_MULTIPLE) * XB_NDX_NODE_MULTIPLE; else NodeSize = size; } else NodeSize = XB_DEFAULT_NDX_NODE_SIZE; #endif } //! Short description /*! \param buf \param len */ void xbNdx::GetExpression(char *buf, int len) { memcpy(buf, HeadNode.KeyExpression, len < XB_NDX_NODE_SIZE ? len : XB_NDX_NODE_SIZE - XB_NDX_NODE_BASESIZE); } #endif /* XB_INDEX_NDX */ xbase-2.0.0/xbase/stack.cpp0000644000000000000000000001216707203043261011161 /* $Id: stack.cpp,v 1.5 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains logic for handling basic stack functions. Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Added expression support */ #ifdef __GNUG__ #pragma implementation "xstack.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #include #include #include #include /*! \file stack.cpp */ /*************************************************************************/ //! Short description. /*! */ xbStack::xbStack( void ) { First = NULL; Last = NULL; Free = NULL; StackDepth = 0;; } /*************************************************************************/ //! Short description. /*! */ void xbStack::InitStack( void ) { if( !First || !Last ) return; if( Free ) { Last->Next = Free; Free->Previous = Last; } Free = First; First = NULL; Last = NULL; StackDepth = 0; return; } /*************************************************************************/ //! Short description. /*! */ xbStackElement * xbStack::GetStackElement( void ) { xbStackElement * Temp; /* check the free chain for an empty Stack element, if not found, allocate one from memory */ if( Free ) { Temp = Free; Free = Free->Next; } else if((( Temp = (xbStackElement *) malloc( sizeof( xbStackElement )))==NULL)) return NULL; memset( Temp, 0x00, sizeof( xbStackElement )); return Temp; } /*************************************************************************/ //! Short description. /*! \param e */ void xbStack::FreeStackElement( xbStackElement * e ) { e->Previous = NULL; e->Next = Free; if( Free ) Free->Previous = e; Free = e; } /*************************************************************************/ //! Short description. /*! \param p */ xbShort xbStack::Push( void * p ) { xbStackElement * Temp; if(( Temp = GetStackElement()) == NULL ) return 102; Temp->UserPtr = p; if( !First ) { First = Temp; Last = Temp; StackDepth = 1; } else { Last->Next = Temp; Temp->Previous = Last; Last = Temp; StackDepth++; } return 0; } /*************************************************************************/ //! Short description. /*! */ void * xbStack::Pop( void ) { void * p; xbStackElement * Save; if( StackDepth == 0 ) return NULL; else { p = Last->UserPtr; if( StackDepth == 1 ) { FreeStackElement( First ); First = NULL; Last = NULL; } else /* number of items in Stack must be > 1 */ { Last->Previous->Next = NULL; Save = Last; Last = Last->Previous; FreeStackElement( Save ); } StackDepth--; return p; } } /*************************************************************************/ //! Short description. /*! */ #ifdef XBASE_DEBUG void xbStack::DumpStack( void ) { xbStackElement * e; if( StackDepth == 0 ) { cout << "\nStack is empty..."; return; } cout << "\nThere are " << StackDepth << " entries."; cout << "\nFirst = " << First << " Last = " << Last; e = First; while( e ) { cout << "\n*****************************"; cout << "\nThis = " << e; cout << "\nNext = " << e->Next; cout << "\nPrevious = " << e->Previous; cout << "\nUser Pointer = " << e->UserPtr; e = e->Next; } cout << "\nFree list follows..."; e = Free; while( e ) { cout << "\n*****************************"; cout << "\nThis = " << e; cout << "\nNext = " << e->Next; cout << "\nPrevious = " << e->Previous; cout << "\nUser Pointer = " << e->UserPtr; e = e->Next; } return; } #endif /*************************************************************************/ xbase-2.0.0/xbase/xbase.cpp0000644000000000000000000004343307203043261011156 /* $Id: xbase.cpp,v 1.8 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains logic for the basic Xbase class. Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.1 5/25/98 - Big Endian support */ #ifdef __GNUG__ #pragma implementation "xbase.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #include #include #include /*! \file xbase.cpp */ /*************************************************************************/ //! Constructor. /*! */ xbXBase::xbXBase( void ) { xbShort e = 1; EndianType = *(char *) &e; if( EndianType ) EndianType = 'L'; else EndianType = 'B'; DbfList = NULL; FreeDbfList = NULL; } /*************************************************************************/ //! Get pointer to named dbf. /*! Looks up an open DBF file by Name. \param Name \returns A pointer to the xbDbf class instance if found or NULL if not found. */ xbDbf *xbXBase::GetDbfPtr(const char *Name) { xbDbList *t; t = DbfList; xbShort len = strlen(Name); /* check for -> embedded in the name */ for( xbShort i = 0; i < (len-1); i++ ) if( Name[i] == '-' && Name[i+1] == '>' ) len = i-1; while (t) { if (strncmp(Name, t->DbfName, len) == 0 ) return t->dbf; t = t->NextDbf; } return NULL; } /*************************************************************************/ //! Destructor. /*! */ xbXBase::~xbXBase() { xbDbList *i = FreeDbfList; while (i) { xbDbList *t = i->NextDbf; if (i->DbfName) { free(i->DbfName); } free(i); i = t; } } /*************************************************************************/ //! Add dbf to dbf list. /*! Adds an xbDbf class instance to the list of dbf's. \param d the xbDbf instance to be added \param DatabaseName name of the database \returns One of the following return codes: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
XB_NO_MEMORYOut of memory
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No Error \\ \hline XB\_NO\_MEMORY & Out of memory \\ \hline \end{tabular} \endlatexonly */ xbShort xbXBase::AddDbfToDbfList(xbDbf *d, const char *DatabaseName) { xbDbList *i, *s, *t; if(!FreeDbfList) { if((i = (xbDbList *)malloc(sizeof(xbDbList))) == NULL) { xb_memory_error; } } else { i = FreeDbfList; FreeDbfList = i->NextDbf; } memset(i, 0x00, sizeof(xbDbList)); i->DbfName = strdup(DatabaseName); i->dbf = d; s = NULL; t = DbfList; while(t && strcmp(t->DbfName, DatabaseName) < 0) { s = t; t = t->NextDbf; } i->NextDbf = t; if (s == NULL) DbfList = i; else s->NextDbf = i; return 0; } /***********************************************************************/ //! Remove dbf from dbf list. /*! Removes the specified xbDbf class instance from the list of dbf's. \param d xbDbf to be removed \returns One of the following return codes: \htmlonly

Return CodeDescription
XB_NO_ERRORNo error
\endhtmlonly \latexonly \\ \\ \begin{tabular}{|l|l|} \hline \textbf{Return Code} & \textbf{Description} \\ \hline \hline XB\_NO\_ERROR & No Error \\ \hline \end{tabular} \endlatexonly */ xbShort xbXBase::RemoveDbfFromDbfList(xbDbf *d) { xbDbList *i, *s; i = DbfList; s = NULL; while (i) { if(i->dbf == d) { /* remove it from current chain */ if(s) s->NextDbf = i->NextDbf; else DbfList = i->NextDbf; /* add i to the current free chain */ i->NextDbf = FreeDbfList; FreeDbfList = i; free(FreeDbfList->DbfName); FreeDbfList->DbfName = NULL; FreeDbfList->NextDbf = NULL; break; } else { s = i; i = i->NextDbf; } } return XB_NO_ERROR; } // FIXME: byte reverse methods are awful, compared to bitwise shifts -- willy /************************************************************************/ //! Get a portable short value. /*! Converts a short (16 bit integer) value stored at p from a portable format to the machine format. \param p pointer to memory containing the portable short value \returns the short value. */ /* This routine returns a short value from a 2 byte character stream */ xbShort xbXBase::GetShort(const char *p) { xbShort s, i; const char *sp; char *tp; s = 0; tp = (char *) &s; sp = p; if( EndianType == 'L' ) for( i = 0; i < 2; i++ ) *tp++ = *sp++; else { sp++; for( i = 0; i < 2; i++ ) *tp++ = *sp--; } return s; } //! Get a portable long value. /*! Converts a long (32 bit integer) value stored at p from a portable format to the machine format. \param p pointer to memory containing the portable long value \returns the long value. */ /* This routine returns a long value from a 4 byte character stream */ xbLong xbXBase::GetLong( const char *p ) { xbLong l; const char *sp; char *tp; xbShort i; tp = (char *) &l; sp = p; if( EndianType == 'L' ) for( i = 0; i < 4; i++ ) *tp++ = *sp++; else { sp+=3; for( i = 0; i < 4; i++ ) *tp++ = *sp--; } return l; } //! Get a portable unsigned long value. /*! Converts an unsigned long (32 bit integer) value stored at p from a portable format to the machine format. \param p pointer to memory containing the portable unsigned long value \returns the unsigned long value. */ /* This routine returns a long value from a 4 byte character stream */ xbULong xbXBase::GetULong( const char *p ) { xbULong l; char *tp; xbShort i; tp = (char *) &l; if( EndianType == 'L' ) for( i = 0; i < 4; i++ ) *tp++ = *p++; else{ p+=3; for( i = 0; i < 4; i++ ) *tp++ = *p--; } return l; } //! Get a portable double value. /*! Converts a double (64 bit floating point) value stored at p from a portable format to the machine format. \param p pointer to memory containing the portable double value \returns the double value. */ /* This routine returns a double value from an 8 byte character stream */ xbDouble xbXBase::GetDouble( const char *p ) { xbDouble d; const char *sp; char *tp; xbShort i; tp = (char *) &d; sp = p; if( EndianType == 'L' ) for( i = 0; i < 8; i++ ) *tp++ = *sp++; else { sp+=7; for( i = 0; i < 8; i++ ) *tp++ = *sp--; } return d; } //! Put a portable short value. /*! Converts a short (16 bit integer) value from machine format to a portable format and stores the converted value in the memory referenced by c. \param c pointer to memory to hold converted value \param s value to be converted */ /* This routine puts a short value to a 2 byte character stream */ void xbXBase::PutShort( char * c, const xbShort s ) { const char *sp; char *tp; xbShort i; tp = c; sp = (const char *) &s; if( EndianType == 'L' ) { for( i = 0; i < 2; i++ ) *tp++ = *sp++; } else /* big endian */ { sp++; for( i = 0; i < 2; i++ ) *tp++ = *sp--; } return; } //! Put a portable long value. /*! Converts a long (32 bit integer) value from machine format to a portable format and stores the converted value in the memory referenced by c. \param c pointer to memory to hold converted value \param s value to be converted */ /* This routine puts a long value to a 4 byte character stream */ void xbXBase::PutLong( char * c, const xbLong l ) { const char *sp; char *tp; xbShort i; tp = c; sp = (const char *) &l; if( EndianType == 'L' ) for( i = 0; i < 4; i++ ) *tp++ = *sp++; else { sp+=3; for( i = 0; i < 4; i++ ) *tp++ = *sp--; } return; } //! Put a portable unsigned short value. /*! Converts an unsigned long (16 bit integer) value from machine format to a portable format and stores the converted value in the memory referenced by c. \param c pointer to memory to hold converted value \param s value to be converted */ /* This routine puts a short value to a 2 byte character stream */ void xbXBase::PutUShort( char * c, const xbUShort s ) { const char *sp; char *tp; xbShort i; tp = c; sp = (const char *) &s; if( EndianType == 'L' ) for( i = 0; i < 2; i++ ) *tp++ = *sp++; else { sp++; for( i = 0; i < 2; i++ ) *tp++ = *sp--; } return; } //! Put a portable unsigned long value. /*! Converts an unsigned long (32 bit integer) value from machine format to a portable format and stores the converted value in the memory referenced by c. \param c pointer to memory to hold converted value \param s value to be converted */ /* This routine puts a long value to a 4 byte character stream */ void xbXBase::PutULong( char * c, const xbULong l ) { const char *sp; char *tp; xbShort i; tp = c; sp = (const char *) &l; if( EndianType == 'L' ) for( i = 0; i < 4; i++ ) *tp++ = *sp++; else { sp+=3; for( i = 0; i < 4; i++ ) *tp++ = *sp--; } return; } //! Put a portable double value. /*! Converts a double (64 floating point) value from machine format to a portable format and stores the converted value in the memory referenced by c. \param c pointer to memory to hold converted value \param s value to be converted */ /* This routine puts a double value to an 8 byte character stream */ void xbXBase::PutDouble( char * c, const xbDouble d ) { const char *sp; char *tp; xbShort i; tp = c; sp = (const char *) &d; if( EndianType == 'L' ) for( i = 0; i < 8; i++ ) *tp++ = *sp++; else { sp+=7; for( i = 0; i < 8; i++ ) *tp++ = *sp--; } return; } /************************************************************************/ //! Get offset of last PATH_SEPARATOR in Name. /*! Scans the specified Name for the last occurance of PATH_SEPARATOR. \param Name string to be scanned. \returns offset of last occurance of PATH_SEPARATOR */ xbShort xbXBase::DirectoryExistsInName( const char * Name ) { /* returns the offset in the string of the last directory slash */ xbShort Count, Mark; char Delim; const char *p; Delim = PATH_SEPARATOR; Count = Mark = 0; p = Name; while( *p ) { Count++; if( *p++ == Delim ) Mark = Count; } return Mark; } /************************************************************************/ //! Display description of error code. /*! Displays a text description of an XBase error code. \param ErrorNo error to be displayed */ void xbXBase::DisplayError( const xbShort ErrorNo ) const { #if 0 // replaced following code to remove duplicate strings (9/27/2000 DTB) switch( ErrorNo ) { case 0: cout << "No Error" << endl; break; case -100: cout << "End Of File" << endl; break; // case -101: cout << "Beginning Of File" << endl; break; case -102: cout << "No Memory" << endl; break; case -103: cout << "File Already Exists" << endl; break; case -104: cout << "Database or Index Open Error" << endl; break; case -105: cout << "Error writing to disk drive" << endl; break; case -106: cout << "Unknown Field Type" << endl; break; case -107: cout << "Database already open" << endl; break; case -108: cout << "Not an Xbase type database" << endl; break; case -109: cout << "Invalid Record Number" << endl; break; case -110: cout << "Invalid Option" << endl; break; case -111: cout << "Database not open" << endl; break; case -112: cout << "Disk Drive Seek Error" << endl; break; case -113: cout << "Disk Drive Read Error" << endl; break; case -114: cout << "Search Key Not Found" << endl; break; case -115: cout << "Search Key Found" << endl; break; case -116: cout << "Invalid Key" << endl; break; case -117: cout << "Invalid Node Link" << endl; break; case -118: cout << "Key Not Unique" << endl; break; case -119: cout << "Invalid Key Expression" << endl; break; // case -120: cout << "DBF File Not Open" << endl; break; case -121: cout << "Invalid Key Type" << endl; break; case -122: cout << "Invalid Node No" << endl; break; case -123: cout << "Node Full" << endl; break; case -124: cout << "Invalid Field Number" << endl; break; case -125: cout << "Invalid Data" << endl; break; case -126: cout << "Not a leaf node" << endl; break; case -127: cout << "Lock Failed" << endl; break; case -128: cout << "Close Error" << endl; break; case -129: cout << "Invalid Schema" << endl; break; case -130: cout << "Invalid Name" << endl; break; case -131: cout << "Invalid Block Size" << endl; break; case -132: cout << "Invalid Block Number" << endl; break; case -133: cout << "Not a Memo field" << endl; break; case -134: cout << "No Memo Data" << endl; break; case -135: cout << "Expression syntax error" << endl; break; case -136: cout << "Parse Error" << endl; break; case -137: cout << "No Data" << endl; break; // case -138: cout << "Unknown Token Type" << endl; break; case -140: cout << "Invalid Field" << endl; break; case -141: cout << "Insufficient Parms" << endl; break; case -142: cout << "Invalid Function" << endl; break; case -143: cout << "Invalid Field Length" << endl; break; case -144: cout << "Harvest Node Error" << endl; break; case -145: cout << "Invalid Date" << endl; break; default: cout << "Unknown error code" << endl; break; } #else cout << GetErrorMessage(ErrorNo) << endl; #endif } /************************************************************************/ //! Get description of error code. /*! Returns a pointer to string containing a text description of an error code. \param ErrorNo error number of description to be returned */ const char* xbXBase::GetErrorMessage( const xbShort ErrorNo ) { switch( ErrorNo ) { case 0: return "No Error"; case -100: return "End Of File"; case -101: return "Beginning Of File"; case -102: return "No Memory"; case -103: return "File Already Exists"; case -104: return "Database or Index Open Error"; case -105: return "Error writing to disk drive"; case -106: return "Unknown Field Type"; case -107: return "Database already open"; case -108: return "Not an Xbase type database"; case -109: return "Invalid Record Number"; case -110: return "Invalid Option"; case -111: return "Database not open"; case -112: return "Disk Drive Seek Error"; case -113: return "Disk Drive Read Error"; case -114: return "Search Key Not Found"; case -115: return "Search Key Found"; case -116: return "Invalid Key"; case -117: return "Invalid Node Link"; case -118: return "Key Not Unique"; case -119: return "Invalid Key Expression"; case -120: return "DBF File Not Open"; case -121: return "Invalid Key Type"; case -122: return "Invalid Node No"; case -123: return "Node Full"; case -124: return "Invalid Field Number"; case -125: return "Invalid Data"; case -126: return "Not a leaf node"; case -127: return "Lock Failed"; case -128: return "Close Error"; case -129: return "Invalid Schema"; case -130: return "Invalid Name"; case -131: return "Invalid Block Size"; case -132: return "Invalid Block Number"; case -133: return "Not a Memo field"; case -134: return "No Memo Data"; case -135: return "Expression syntax error"; case -136: return "Parse Error"; case -137: return "No Data"; case -138: return "Unknown Token Type"; case -140: return "Invalid Field"; case -141: return "Insufficient Parms"; case -142: return "Invalid Function"; case -143: return "Invalid Field Length"; default: return "Unknown error code"; } } xbase-2.0.0/xbase/xdate.cpp0000644000000000000000000005374707203043261011172 /* $Id: xdate.cpp,v 1.7 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code These functions are used for processing dates. All functions assume a standard date format of CCYYMMDD for Century,Year,Month and Day Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.2 11/30/97 - Updated leap-year processing logic V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.1 5/25/98 - Enhancements/bug fixes from eljorgo@fontun.com V 1.8.0.a 1/27/99 - Added default date format processing V 1.9 6/29/99 - CPP ified, minor bug fixes */ #ifdef __GNUG__ #pragma implementation "xdate.h" #endif #include #include #include #include #include #ifdef __WIN32__ #include #else #include #endif #include #include #include /*! \file xdate.cpp */ int xbDate::DaysInMonths[2][13]; int xbDate::AggregatedDaysInMonths[2][13]; const xbString *xbDate::Days[7]; const xbString *xbDate::Months[12]; #define EPOCH_MIN 100 #define EPOCH_MAX 3000 #define DAYS_AD(year) ((year) *365L + (year) / 4 - (year) / 100 + (year) / 400) /***************************************************************/ //! Short description. /*! \param Date8 */ xbDate::xbDate( const xbString & Date8 ) { if( DateIsValid( Date8 )) cDate8 = Date8; else Sysdate(); SetDateTables(); } /***************************************************************/ //! Short description. /*! \param Date8 */ xbDate::xbDate( const char * Date8 ) { if( DateIsValid( Date8 )) cDate8 = Date8; else Sysdate(); /* if invalid date, set class to sysdate */ SetDateTables(); } /***************************************************************/ //! Short description. /*! */ xbDate::xbDate() { Sysdate(); SetDateTables(); } /***************************************************************/ //! Short description. /*! */ void xbDate::SetDateTables() { if( AggregatedDaysInMonths[1][12] != 366 ){ /* first time called ? */ AggregatedDaysInMonths[0][0] = 0; AggregatedDaysInMonths[0][1] = 31; AggregatedDaysInMonths[0][2] = 59; AggregatedDaysInMonths[0][3] = 90; AggregatedDaysInMonths[0][4] = 120; AggregatedDaysInMonths[0][5] = 151; AggregatedDaysInMonths[0][6] = 181; AggregatedDaysInMonths[0][7] = 212; AggregatedDaysInMonths[0][8] = 243; AggregatedDaysInMonths[0][9] = 273; AggregatedDaysInMonths[0][10] = 304; AggregatedDaysInMonths[0][11] = 334; AggregatedDaysInMonths[0][12] = 365; AggregatedDaysInMonths[1][0] = 0; AggregatedDaysInMonths[1][1] = 31; AggregatedDaysInMonths[1][2] = 60; AggregatedDaysInMonths[1][3] = 91; AggregatedDaysInMonths[1][4] = 121; AggregatedDaysInMonths[1][5] = 152; AggregatedDaysInMonths[1][6] = 182; AggregatedDaysInMonths[1][7] = 213; AggregatedDaysInMonths[1][8] = 244; AggregatedDaysInMonths[1][9] = 274; AggregatedDaysInMonths[1][10] = 305; AggregatedDaysInMonths[1][11] = 335; AggregatedDaysInMonths[1][12] = 366; DaysInMonths[0][0] = 0; DaysInMonths[0][1] = 31; DaysInMonths[0][2] = 28; DaysInMonths[0][3] = 31; DaysInMonths[0][4] = 30; DaysInMonths[0][5] = 31; DaysInMonths[0][6] = 30; DaysInMonths[0][7] = 31; DaysInMonths[0][8] = 31; DaysInMonths[0][9] = 30; DaysInMonths[0][10] = 31; DaysInMonths[0][11] = 30; DaysInMonths[0][12] = 31; DaysInMonths[1][0] = 0; DaysInMonths[1][1] = 31; DaysInMonths[1][2] = 29; DaysInMonths[1][3] = 31; DaysInMonths[1][4] = 30; DaysInMonths[1][5] = 31; DaysInMonths[1][6] = 30; DaysInMonths[1][7] = 31; DaysInMonths[1][8] = 31; DaysInMonths[1][9] = 30; DaysInMonths[1][10] = 31; DaysInMonths[1][11] = 30; DaysInMonths[1][12] = 31; /* per Rene de Zwart The following assignments of Days[] and Months[] should be accessable by getting the locale and with it all the language dependencies like months days and abbreviations, printing the date should lookup the locale. However, I didn't know how to do this and didn't (yet) find any documentation on how to do this... This should work for unices, ms dos/win, os390 (is this unix?) and VAX. those are the platforms that xbase is being used on. If you know how, please let me know how - or make the changes to this code and send it to me.. Gary - gkunkelstartech.keller.tx.us */ #ifdef XB_CASTELLANO Days[0] = new const xbString( "Domingo" ); Days[1] = new const xbString( "Lunes" ); Days[2] = new const xbString( "Martes" ); Days[3] = new const xbString( "Miercoles" ); Days[4] = new const xbString( "Jueves" ); Days[5] = new const xbString( "Viernes" ); Days[6] = new const xbStirng( "Sabado" ); Months[0] = new const xbString( "Enero" ); Months[1] = new const xbString( "Febrero" ); Months[2] = new const xbString( "Marzo" ); Months[3] = new const xbString( "Abril" ); Months[4] = new const xbString( "Mayo" ); Months[5] = new const xbString( "Junio" ); Months[6] = new const xbString( "Julio" ); Months[7] = new const xbString( "Agosto" ); Months[8] = new const xbString( "Septiembre" ); Months[9] = new const xbString( "Octubre" ); Months[10] = new const xbString( "Noviembre" ); Months[11] = new const xbString( "Diciembre" ); #else Days[0] = new const xbString( "Sunday" ); Days[1] = new const xbString( "Monday" ); Days[2] = new const xbString( "Tuesday" ); Days[3] = new const xbString( "Wednesday" ); Days[4] = new const xbString( "Thursday" ); Days[5] = new const xbString( "Friday" ); Days[6] = new const xbString( "Saturday" ); Months[0] = new const xbString( "January" ); Months[1] = new const xbString( "February" ); Months[2] = new const xbString( "March" ); Months[3] = new const xbString( "April" ); Months[4] = new const xbString( "May" ); Months[5] = new const xbString( "June" ); Months[6] = new const xbString( "July" ); Months[7] = new const xbString( "August" ); Months[8] = new const xbString( "September" ); Months[9] = new const xbString( "October" ); Months[10] = new const xbString( "November" ); Months[11] = new const xbString( "December" ); #endif } } /***************************************************************/ //! Short description. /*! \param Date8 */ /* this function returns century and year from a CCYYMMDD date */ int xbDate::YearOf( const char * Date8 ) const { char year[5]; year[0] = Date8[0]; year[1] = Date8[1]; year[2] = Date8[2]; year[3] = Date8[3]; year[4] = 0x00; return( atoi( year )); } /***************************************************************/ //! Short description. /*! \param Date8 */ /* this function returns the month from a CCYYMMDD date */ int xbDate::MonthOf( const char * Date8 ) const { char month[3]; month[0] = Date8[4]; month[1] = Date8[5]; month[2] = 0x00; return( atoi( month )); } /***************************************************************/ //! Short description. /*! \param Date8 */ /* this function returns TRUE if a CCYYMMDD date is a leap year*/ int xbDate::IsLeapYear( const char * Date8 ) const { int year; year = YearOf( Date8 ); if(( year % 4 == 0 && year % 100 != 0 ) || year % 400 == 0 ) return 1; else return 0; } /***************************************************************/ //! Short description. /*! \param Format \param Date8 */ /* this function returns the "day of" from a CCYYMMDD date */ /* format = XB_FMT_WEEK Number of day in WEEK 0-6 ( Sun - Sat ) format = XB_FMT_MONTH Number of day in MONTH 1-31 format = XB_FMT_YEAR Number of day in YEAR 1-366 */ int xbDate::DayOf( int Format, const char * Date8 ) const { char day[3]; int iday, imonth, iyear, iday2; /* check for valid format switch */ if( Format!=XB_FMT_WEEK && Format!=XB_FMT_MONTH && Format!=XB_FMT_YEAR ) return XB_INVALID_OPTION; if( Format == XB_FMT_WEEK ) { iday = DayOf( XB_FMT_MONTH, Date8 ); imonth = MonthOf( Date8 ); iyear = YearOf ( Date8 ); /* The following formula uses Zeller's Congruence to determine the day of the week */ if( imonth > 2 ) /* init to February */ imonth -= 2; else { imonth += 10; iyear--; } iday2 = ((13 * imonth - 1) / 5) +iday + ( iyear % 100 ) + (( iyear % 100 ) / 4) + ((iyear /100 ) / 4 ) - 2 * ( iyear / 100 ) + 77 ; return( iday2 - 7 * ( iday2 / 7 )); } else if( Format == XB_FMT_MONTH ) { day[0] = Date8[6]; day[1] = Date8[7]; day[2] = 0x00; return( atoi( day )); } else return( AggregatedDaysInMonths[IsLeapYear(Date8)][MonthOf(Date8)-1]+ DayOf(XB_FMT_MONTH, Date8)); } /**********************************************************************/ //! Short description. /*! */ /* this method sets the class date & returns a pointer to system date */ xbString& xbDate::Sysdate() { char dt[9]; time_t timer; struct tm *tblock; timer = time( NULL ); tblock = localtime( &timer ); tblock->tm_year += 1900; tblock->tm_mon++; sprintf( dt,"%4d%02d%02d",tblock->tm_year,tblock->tm_mon,tblock->tm_mday ); dt[8] = 0x00; cDate8 = dt; return cDate8; } /***************************************************************/ //! Short description. /*! \param Date8 */ /* this function checks a date for validity - returns 1 if OK */ int xbDate::DateIsValid( const char * Date8 ) const { int year, month, day; if(!isdigit( Date8[0] ) || !isdigit( Date8[1] ) || !isdigit( Date8[2] ) || !isdigit( Date8[3] ) || !isdigit( Date8[4] ) || !isdigit( Date8[5] ) || !isdigit( Date8[6] ) || !isdigit( Date8[7] ) ) return 0; year = YearOf ( Date8 ); month = MonthOf( Date8 ); day = DayOf ( XB_FMT_MONTH, Date8 ); /* check the basics */ if( year == 0 || month < 1 || month > 12 || day < 1 || day > 31 ) return 0; /* April, June, September and November have 30 days */ if(( month==4 || month==6 || month==9 || month==11 )&& day > 30 ) return 0; /* check for February with leap year */ if( month == 2 ) if( IsLeapYear( Date8 )) { if( day > 29 ) return 0; } else { if( day > 28 ) return 0; } return 1; } /***************************************************************/ //! Short description. /*! \param Date8 */ int xbDate::SetDate( const char * Date8 ) { if( DateIsValid( Date8 )) { cDate8 = Date8; return 1; } return 0; } /***************************************************************/ //! Short description. /*! \param Date8 */ /* this returns the number of days since 1/1/1900 */ long xbDate::JulianDays( const char * Date8 ) const { int year = YearOf( Date8 ); if(( year < EPOCH_MIN ) || (year >= EPOCH_MAX)) return XB_INVALID_DATE; /* long days = DAYS_AD(year) - DAYS_AD(EPOCH_MIN); */ long days = 0; for (long y = EPOCH_MIN; y < year; y++ ) days += 365 + ( ( ( y%4==0 && y%100!=0 ) || y%400==0 ) ? 1 : 0 ); days += (long) DayOf( XB_FMT_YEAR, Date8 ) -1; return days; } /***************************************************************/ //! Short description. /*! \param days */ /* this function does the opposite of the JulianDays function */ /* it converts a julian based date into a Date8 format */ xbString& xbDate::JulToDate8( long days ) { char Date8[9]; int year, leap, month; year = EPOCH_MIN; leap = 0; /* EPOCH_MIN of 100 is not a leap year */ /* this while loop calculates the year of the date by incrementing the years counter as it decrements the days counter */ while( days > ( 364+leap )) { days -= 365+leap; year++; if(( year % 4 == 0 && year % 100 != 0 ) || year % 400 == 0 ) leap = 1; else leap = 0; } /* for( i = 12, month = 0; i >= 1 && month == 0; i-- ) { if( leap && days >= (long) AggregatedDaysInMonths[1][i] ) { month = i; days -= AggregatedDaysInMonths[1][i]-1; } else if( !leap && days >= (long) AggregatedDaysInMonths[0][i] ) { month = i; days -= AggregatedDaysInMonths[0][i]-1; } } sprintf( Date8, "%4d%02d%02ld", year, month, days ); */ /* this for loop calculates the month and day of the date by comparing the number of days remaining to one of the tables */ for( month = 12; month >= 1; month-- ) if( days >= (long)AggregatedDaysInMonths[leap][month] ) { days -= AggregatedDaysInMonths[leap][month]; break; } sprintf( Date8, "%4d%02d%02ld", year, month+1, days+1 ); Date8[8] = 0x00; cDate8 = Date8; return cDate8; } /***************************************************************/ //! Short description. /*! \param Date8 */ /* this routine returns a pointer to the day of the week(Sun-Sat)*/ xbString& xbDate::CharDayOf( const char * Date8 ) { fDate = strdup( *Days[DayOf(XB_FMT_WEEK, Date8)]); return fDate; } /***************************************************************/ //! Short description. /*! \param Date8 */ /* this routine returns a pointer to the month */ xbString& xbDate::CharMonthOf( const char * Date8 ) { fDate = strdup( *Months[MonthOf( Date8 )-1]); return( fDate ); } /***************************************************************/ //! Short description. /*! \param Format \param Date8 */ /* This function formats a date and returns a pointer to a */ /* static buffer containing the date */ xbString& xbDate::FormatDate( const char * Format, const char * Date8 ) { const char *FmtPtr; /* format pointer */ char *BufPtr; /* buffer pointer */ char type; char cbuf[10]; int type_ctr, i; char buf[50]; xbString s; memset( buf, 0x00, 50 ); if( strstr( Format, "YYDDD" )) { buf[0] = Date8[2]; buf[1] = Date8[3]; sprintf( buf+2, "%03d", DayOf( XB_FMT_YEAR, Date8 )); } else { BufPtr = buf; FmtPtr = Format; memset( cbuf, 0x00, 10 ); while( *FmtPtr ) { if( *FmtPtr != 'D' && *FmtPtr != 'M' && *FmtPtr != 'Y' ) { *BufPtr = *FmtPtr; BufPtr++; FmtPtr++; } else { type = *FmtPtr; type_ctr = 0; while( *FmtPtr == type ) { type_ctr++; FmtPtr++; } switch( type ) { case 'D': if( type_ctr == 1 ) { sprintf( cbuf, "%d", DayOf( XB_FMT_MONTH, Date8 )); strcat( buf, cbuf ); BufPtr += strlen( cbuf ); } else if( type_ctr == 2 ) { cbuf[0] = Date8[6]; cbuf[1] = Date8[7]; cbuf[2] = 0x00; strcat( buf, cbuf ); BufPtr += 2; } else { s = CharDayOf( Date8 ); if( type_ctr == 3 ) { strncat( buf, s.getData(), 3 ); BufPtr += 3; } else { strcpy( cbuf, CharDayOf( Date8 )); for( i = 0; i < 9; i++ ) if( cbuf[i] == 0x20 ) cbuf[i] = 0x00; strcat( buf, cbuf ); BufPtr += strlen( cbuf ); } } break; case 'M': if( type_ctr == 1 ) { sprintf( cbuf, "%d", MonthOf( Date8 )); strcat( buf, cbuf ); BufPtr += strlen( cbuf ); } else if( type_ctr == 2 ) { cbuf[0] = Date8[4]; cbuf[1] = Date8[5]; cbuf[2] = 0x00; strcat( buf, cbuf ); BufPtr += 2; } else { s = CharMonthOf( Date8 ); if( type_ctr == 3 ) { strncat( buf, s.getData(), 3 ); BufPtr += 3; } else { strcpy( cbuf, CharMonthOf( Date8 )); for( i = 0; i < 9; i++ ) if( cbuf[i] == 0x20 ) cbuf[i] = 0x00; strcat( buf, cbuf ); BufPtr += strlen( cbuf ); } } break; case 'Y': if( type_ctr == 2 ) { cbuf[0] = Date8[2]; cbuf[1] = Date8[3]; cbuf[2] = 0x00; strcat( buf, cbuf ); BufPtr += 2; } else if( type_ctr == 4 ) { cbuf[0] = Date8[0]; cbuf[1] = Date8[1]; cbuf[2] = Date8[2]; cbuf[3] = Date8[3]; cbuf[4] = 0x00; strcat( buf, cbuf ); BufPtr += 4; } break; default: break; } } } } fDate = buf; return fDate; } /***************************************************************/ //! Short description. /*! \param Date8 */ /* this routine returns the Date8 format of the last day of the month for the given input Date8 */ xbString & xbDate::LastDayOfMonth( const char * Date8 ) { char tmp[9]; sprintf( tmp, "%4.4d%2.2d%2.2d", YearOf( Date8 ), MonthOf( Date8 ), DaysInMonths[IsLeapYear(Date8)][MonthOf(Date8)]); cDate8 = tmp; return cDate8; } /**********************************************************************/ //! Short description. /*! */ xbString &xbDate::operator+=( int count ) { JulToDate8( JulianDays() + count ); return cDate8; } /**********************************************************************/ //! Short description. /*! */ xbString &xbDate::operator-=( int count ) { JulToDate8( JulianDays() - count ); return cDate8; } /**********************************************************************/ //! Short description. /*! */ xbString &xbDate::operator++( int ) { *this+=1; return cDate8; } /**********************************************************************/ //! Short description. /*! */ xbString &xbDate::operator--( int ) { *this-=1; return cDate8; } /**********************************************************************/ //! Short description. /*! */ xbString &xbDate::operator+( int count ) { xbDate d( GetDate() ); d+=count; fDate = d.GetDate(); return fDate; } /**********************************************************************/ //! Short description. /*! */ xbString &xbDate::operator-( int count ) { xbDate d( GetDate() ); d-=count; fDate = d.GetDate(); return fDate; } /**********************************************************************/ //! Short description. /*! */ long xbDate::operator-( const xbDate & d ) const { return JulianDays() - d.JulianDays(); } /**********************************************************************/ //! Short description. /*! */ int xbDate::operator==( const xbDate & d ) const { if( JulianDays() == d.JulianDays() ) return 1; else return 0; } /**********************************************************************/ //! Short description. /*! */ int xbDate::operator!=( const xbDate & d ) const { if( JulianDays() != d.JulianDays() ) return 1; else return 0; } /**********************************************************************/ //! Short description. /*! */ int xbDate::operator<( const xbDate & d ) const { if( JulianDays() < d.JulianDays() ) return 1; else return 0; } /**********************************************************************/ //! Short description. /*! */ int xbDate::operator>( const xbDate & d ) const { if( JulianDays() > d.JulianDays() ) return 1; else return 0; } /**********************************************************************/ //! Short description. /*! */ int xbDate::operator<=( const xbDate & d ) const { if( JulianDays() <= d.JulianDays() ) return 1; else return 0; } /**********************************************************************/ //! Short description. /*! */ int xbDate::operator>=( const xbDate & d ) const { if( JulianDays() >= d.JulianDays() ) return 1; else return 0; } /**********************************************************************/ xbase-2.0.0/xbase/xbexcept.cpp0000644000000000000000000001413607211550574011705 /* $Id: xbexcept.cpp,v 1.7 2000/11/30 22:15:24 dbryson Exp $ Xbase project source code This file contains exceptions for error reporting Copyright (C) 1998 Denis Pershin (dyp@inetlab.com) 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net */ #ifdef __GNUG__ #pragma implementation "xbexcept.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #include #include #include #include /*! \file xbexcept.cpp */ //! Short description. /*! \param err */ const char *xbStrError(xbShort err) { switch (err) { case XB_NO_ERROR: return "No error"; case XB_EOF: return "Xbase EoF"; case XB_BOF: return "XBase BoF"; case XB_NO_MEMORY: return "Out of memory"; case XB_FILE_EXISTS: return "File already exists"; case XB_OPEN_ERROR: return "Error opening file"; case XB_WRITE_ERROR: return "Error write to file"; case XB_UNKNOWN_FIELD_TYPE: return "Unknown field type"; case XB_ALREADY_OPEN: return "File already opened"; case XB_NOT_XBASE: return "File is not XBase"; case XB_INVALID_RECORD: return "Invalid record"; case XB_INVALID_OPTION: return "Invalid option"; case XB_NOT_OPEN: return "File not opened"; case XB_SEEK_ERROR: return "Seek error"; case XB_READ_ERROR: return "Read error"; case XB_NOT_FOUND: return "Not found"; case XB_FOUND: return "Found"; case XB_INVALID_KEY: return "Invalid key"; case XB_INVALID_NODELINK: return "Invalid nodelink"; case XB_KEY_NOT_UNIQUE: return "Key not unique"; case XB_INVALID_KEY_EXPRESSION: return "Invalid key expression"; case XB_DBF_FILE_NOT_OPEN: return "DBF file not open"; case XB_INVALID_KEY_TYPE: return "Invalid key type"; case XB_INVALID_NODE_NO: return "Invalid node no"; case XB_NODE_FULL: return "Node full"; case XB_INVALID_FIELDNO: return "Invalid field no"; case XB_INVALID_DATA: return "Invalid data"; case XB_NOT_LEAFNODE: return "Not leafnode"; case XB_LOCK_FAILED: return "Lock failed"; case XB_CLOSE_ERROR: return "Close error"; case XB_INVALID_SCHEMA: return "Invalid schema"; case XB_INVALID_NAME: return "Invlaid name"; case XB_INVALID_BLOCK_SIZE: return "Invalid block size"; case XB_INVALID_BLOCK_NO: return "Invalid block no"; case XB_NOT_MEMO_FIELD: return "Not memo field"; case XB_NO_MEMO_DATA: return "No memo data"; case XB_EXP_SYNTAX_ERROR: return "Expression syntax error"; case XB_PARSE_ERROR: return "Parse error"; case XB_NO_DATA: return "No data"; case XB_UNKNOWN_TOKEN_TYPE: return "Unknown token type"; case XB_INVALID_FIELD: return "Invalid field"; case XB_INSUFFICIENT_PARMS: return "Insufficient parameters"; case XB_INVALID_FUNCTION: return "Invalid function"; case XB_INVALID_FIELD_LEN: return "Invalid field len"; default: return "Unknown exception"; } } #ifdef HAVE_EXCEPTIONS #include #include //! Short description. /*! \param err */ xbException::xbException (int err) { this->err = err; } //! Short description. /*! */ xbException::~xbException () XB_THROW { } //! Short description. /*! */ const char* xbException::what() const XB_THROW { return "xbException"; }; //! Short description. /*! */ int xbException::getErr() { return err; }; //! Short description. /*! */ const char *xbException::error() { return xbStrError(err); } //! Short description. /*! \param err */ xbIOException::xbIOException (int err) : xbException(err) { m_errno = errno; name = NULL; } //! Short description. /*! \param err \param n */ xbIOException::xbIOException (int err, const char *n) : xbException(err) { name = n; m_errno = errno; } //! Short description. /*! */ xbIOException::~xbIOException () XB_THROW { } //! Short description. /*! */ const char* xbIOException::what() const XB_THROW { return "xbIOException"; }; //! Short description. /*! */ const char *xbIOException::_errno() const { return (strerror(m_errno)); } //! Short description. /*! */ xbOpenException::xbOpenException () : xbIOException(XB_OPEN_ERROR) { } //! Short description. /*! \param n */ xbOpenException::xbOpenException (const char *n) : xbIOException(XB_OPEN_ERROR, n) { } //! Short description. /*! */ xbOpenException::~xbOpenException () XB_THROW { } //! Short description. /*! */ const char* xbOpenException::what() const XB_THROW { return "xbOpenException"; }; //! Short description. /*! */ xbEoFException::xbEoFException () : xbIOException(XB_EOF) { } //! Short description. /*! */ xbEoFException::~xbEoFException () XB_THROW { } //! Short description. /*! */ const char* xbEoFException::what() const XB_THROW { return "xbEoFException"; }; //! Short description. /*! */ xbOutOfMemoryException::xbOutOfMemoryException () : xbException(XB_NO_MEMORY) { } //! Short description. /*! */ xbOutOfMemoryException::~xbOutOfMemoryException () XB_THROW { } //! Short description. /*! */ const char* xbOutOfMemoryException::what() const XB_THROW { return "xbOutOfMemoryException"; }; #endif xbase-2.0.0/xbase/xbstring.cpp0000644000000000000000000003260007244527426011725 /* Xbase project source code This file contains the xbString object methods Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.9.2 9/14/99 - misc user supplied updates */ #ifdef __GNUG__ #pragma implementation "xbstring.h" #endif #include #ifdef __WIN32__ #include #else #include #endif #include #include #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDARG_H #include #endif #ifdef HAVE_CTYPE_H #include #endif #include #include //#define free(x) /*! \file xbstring.cpp */ const char * xbString::NullString = ""; //! Short description. /*! */ xbString::xbString() { ctor(NULL); } //! Short description. /*! \param size */ xbString::xbString(size_t size) { data = (char *)calloc(1, size); this->size = size; } //! Short description. /*! \param c */ xbString::xbString(char c) { ctor(NULL); *this = c; } //! Short description. /*! \param s */ xbString::xbString(const char *s) { ctor(s); } //! Short description. /*! \param s */ xbString::xbString(const xbString &s) { ctor((const char *)s); } //! Short description. /*! \param s \param maxlen */ xbString::xbString(const char *s, size_t maxlen) { #if 0 size_t len = strlen(s); if(len < maxlen) maxlen = len; #endif size = maxlen + 1; data = (char *)calloc(1, size); strncpy(data, s, maxlen); data[maxlen] = 0; } //! Short description. /*! */ xbString::~xbString() { if (data != NULL) free(data); } //! Short description. /*! \param s */ void xbString::ctor(const char *s) { if (s == NULL) { data = NULL; size = 0; return; } size = strlen(s) + 1; data = (char *)calloc(1, size); strcpy(data, s); } //! Short description. /*! \param s \param maxlen */ void xbString::ctor(const char *s, size_t maxlen) { if (s == NULL) { data = NULL; size =0; return; } #if 0 size_t len = strlen(s); if (len < maxlen) maxlen = len; #endif size = maxlen + 1; data = (char *)calloc(1, size); strncpy(data, s, maxlen); data[maxlen] = 0; } //! Short description. /*! */ xbString &xbString::operator=(char c) { if (data != NULL) free(data); data = (char *)calloc(1, 2); data[0] = c; data[1] = 0; size = 2; return (*this); } //! Short description. /*! */ xbString &xbString::operator=(const xbString &s) { if (data != NULL) free(data); const char *sd = s; if (sd == NULL) { data = NULL; size = 0; return (*this); } data = (char *)calloc(1, strlen(s) + 1); strcpy(data, s); size = strlen(data)+1; return (*this); } //! Short description. /*! */ xbString &xbString::operator=(const char *s) { if (data != NULL) free(data); if (s == NULL) { data = NULL; size = 0; return (*this); } data = (char *)calloc(1, strlen(s) + 1); strcpy(data, s); size = strlen(data) + 1; return (*this); } //! Short description. /*! \param size */ void xbString::resize(size_t size) { data = (char *)realloc(data, size); if (size>0) data[size-1] = 0; this->size = size; } //! Short description. /*! */ bool xbString::isNull() const { return (data == NULL); } //! Short description. /*! */ bool xbString::isEmpty() const { if (data == NULL) return true; if (data[0] == 0) return true; return false; } //! Short description. /*! */ size_t xbString::len() const { return (data ? strlen(data) : 0); } //! Short description. /*! */ size_t xbString::length() const { return len(); } //! Short description. /*! */ xbString xbString::copy() const { return (*this); } //! Short description. /*! \param format */ xbString &xbString::sprintf(const char *format, ...) { va_list ap; va_start(ap, format); if (size < 256) resize(256); // make string big enough #ifdef HAVE_VSNPRINTF if (vsnprintf(data, size, format, ap) == -1) data[size-1] = 0; #else # if HAVE_VSPRINTF vsprintf(data, format, ap); # else # if # error "You have neither vsprintf nor vsnprintf!!!" # endif # endif #endif resize(strlen(data)+1); // truncate va_end(ap); return (*this); } //! Short description. /*! */ xbString::operator const char *() const { // return data; return (data != NULL) ? data : NullString; } //! Short description. /*! */ xbString &xbString::operator-=(const char *s) { if( s == NULL ) return (*this); int len = strlen(s); int oldlen = this->len(); data = (char *)realloc(data, oldlen+len+1); if( oldlen == 0 ) data[0] = 0; // looking for an occurence of space in the first string char *lftspc = strchr(data,' '); if( lftspc==NULL ) { // left string has no spaces strcat(data,s); } else { // left string has one or more spaces int numspc = strlen(lftspc); strcpy(lftspc,s); while( numspc-- > 0 ) strcat(lftspc," "); } size += len; return (*this); } //! Short description. /*! */ xbString &xbString::operator+=(const char *s) { if (s == NULL) return (*this); int len = strlen(s); int oldlen = this->len(); data = (char *)realloc(data, oldlen+len+1); if (oldlen == 0) data[0] = 0; strcat(data, s); size += len; return (*this); } //! Short description. /*! */ xbString &xbString::operator+=(char c) { int len = 1; int oldlen = this->len(); data = (char *)realloc(data, oldlen+len+1); data[oldlen] = c; data[oldlen+1] = 0; size++; return (*this); } //! Short description. /*! */ const char *xbString::getData() const { return data ? data : NullString; } //! Short description. /*! */ const char *xbString::c_str() const { return data ? data : NullString; } //! Short description. /*! */ void xbString::toLowerCase() { int len = this->len(); for (int i=0;i ( const xbString &s2 ) const { if( data == NULL || data[0] == 0 ) { if( s2.data == NULL || s2.data[0] == 0 ) return false; // NULL > NULL return false; // NULL > !NULL } else { if( s2.data == NULL || s2.data[0] == 0 ) return true; // !NULL > NULL return strcmp(data,s2.data) > 0; //!NULL > !NULL } } //! Short description. /*! */ bool xbString::operator<=( const xbString &s2 ) const { if( data == NULL || data[0] == 0 ) { if( s2.data == NULL || s2.data[0] == 0 ) return true; // NULL <= NULL return true; // NULL <= !NULL } else { if( s2.data == NULL || s2.data[0] == 0 ) return false; // !NULL <= NULL return strcmp(data,s2.data) <= 0; //!NULL <= !NULL } } //! Short description. /*! */ bool xbString::operator>=( const xbString &s2 ) const { if( data == NULL || data[0] == 0 ) { if( s2.data == NULL || s2.data[0] == 0 ) return true; // NULL >= NULL return false; // NULL >= !NULL } else { if( s2.data == NULL || s2.data[0] == 0 ) return true; // !NULL >= NULL return strcmp(data,s2.data) >= 0; //!NULL >= !NULL } } //! Short description. /*! */ XBDLLEXPORT ostream& operator << ( ostream& os, const xbString& xbs ) { return os << xbs.data; } //! Short description. /*! */ xbString operator-(const xbString &s1, const xbString &s2) { xbString tmp(s1.getData()); tmp -= s2; return tmp; } //! Short description. /*! */ xbString operator+(const xbString &s1, const xbString &s2) { xbString tmp(s1.getData()); tmp += s2; return tmp; } //! Short description. /*! */ xbString operator+(const xbString &s1, const char *s2) { xbString tmp(s1.getData()); tmp += s2; return tmp; } //! Short description. /*! */ xbString operator+(const char *s1, const xbString &s2) { xbString tmp(s1); tmp += s2; return tmp; } //! Short description. /*! */ xbString operator+(const xbString &s1, char c2) { xbString tmp(s1.getData()); tmp += c2; return tmp; } //! Short description. /*! */ xbString operator+(char c1, const xbString &s2) { xbString tmp(c1); tmp += s2; return tmp; } //! Short description. /*! \param pos \param c */ void xbString::putAt(size_t pos, char c) { if (pos>len()) return; data[pos] = c; } //! Short description. /*! \param str \param pos \param n */ xbString& xbString::assign(const xbString& str, size_t pos, int n) { if(data) { free(data); data = 0; } if(str.len() <= pos) { size = 0; return (*this); } if(str.len() < pos + n) { n = str.len() - pos; } const char *d = str; if (n == -1) { // data = (char *)malloc(str.len()-pos+1); ms win/nt bug fix data = (char *)calloc(str.len()-pos+1, sizeof( char )); strcpy(data, d+pos); size = str.len()-pos+1; } else { // data = (char *)malloc(n); ms win/nt bug fix data = (char *)calloc(n + 1, sizeof(char)); strncpy(data, d + pos, n); data[n] = '\0'; size = n + 1; } return (*this); } //! Short description. /*! \param str \param pos \param n */ xbString& xbString::assign(char* str, int n) { if(data) { free(data); data = 0; } data = (char *)calloc(n + 1, sizeof(char)); strncpy(data, str, n); data[n] = 0; size = n + 1; return (*this); } //! Short description. /*! */ void xbString::trim() { int l = len()-1; for (;;) { if (data[l] != ' ') break; data[l] = 0; if (l == 0) break; l--; } } //! Short description. /*! \param pos \param n */ xbString &xbString::remove(size_t pos, int n) { if (data == NULL) return (*this); if (data[0] == 0) return (*this); size_t l = len(); if (pos>l) return (*this); if (n == 0) return (*this); if (n > int(l-pos)) n = l-pos; if (n<0) n = l-pos; memcpy(data+pos, data+pos+n, l-pos-n+1); return (*this); } //! Short description. /*! \param pos \param n */ xbString xbString::mid(size_t pos, int n) const { if (data == NULL) return (*this); if (data[0] == 0) return (*this); size_t l = len(); if (pos>l) return (*this); if (n == 0) return (*this); if (n > int(l-pos)) n = l-pos; if (n<0) n = l-pos; xbString s; s.data = (char *)malloc(n+1); strncpy(s.data, data+pos, n); s.data[n] = 0; return s; } xbase-2.0.0/xbase/index.cpp0000644000000000000000000000346707203043261011166 /* $Id: index.cpp,v 1.5 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains the implementation of the xbIndex class. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net */ #ifdef __GNUG__ #pragma implementation "index.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #include #include /*! \file index.cpp */ #ifdef XB_INDEX_ANY //! Constructor /*! \param pdbf */ xbIndex::xbIndex(xbDbf * pdbf) { index = this; dbf = pdbf; ExpressionTree = NULL; indexfp = NULL; IndexStatus = 0; CurDbfRec = 0L; KeyBuf = NULL; KeyBuf2 = NULL; #ifdef XB_LOCKING_ON CurLockCount = 0; CurLockType = -1; #endif // XB_LOCKING_ON } #endif // XB_INDEX_ANY xbase-2.0.0/xbase/ntx.cpp0000644000000000000000000026156307203043261010673 /* $Id: ntx.cpp,v 1.6 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code NTX (Clipper) indexing routines for X-Base Copyright (C) 1999 SynXis Corp., Bob Cotton email - bob@synxis.com 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software */ #ifdef __GNUG__ #pragma implementation "ntx.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #ifdef XB_INDEX_NTX #ifdef HAVE_IO_H #include #endif #include #include #include #include #include /* FIXME? Why is there? Nothing bad happens if it isn't. -- willy */ #ifdef HAVE_UNISTD_H #include #endif #include /*! \file ntx.cpp */ /***********************************************************************/ //! Short description. /*! */ xbShort xbNtx::CloneNodeChain( void ) { xbNodeLink * TempNodeS; xbNodeLink * TempNodeT; xbNodeLink * TempNodeT2; xbUShort *sp; if( CloneChain ) ReleaseNodeMemory( CloneChain ); CloneChain = NULL; if( !NodeChain ) return XB_NO_ERROR; TempNodeS = NodeChain; TempNodeT2 = NULL; while( TempNodeS ) { if(( TempNodeT = GetNodeMemory()) == NULL ) #ifdef HAVE_EXCEPTIONS throw xbOutOfMemoryException(); #else return XB_NO_MEMORY; #endif sp = TempNodeT->offsets; memcpy( TempNodeT, TempNodeS, sizeof( struct xbNodeLink )); TempNodeT->offsets = sp; TempNodeT->NextNode = NULL; TempNodeT->PrevNode = TempNodeT2; if( !CloneChain ) { TempNodeT2 = TempNodeT; CloneChain = TempNodeT; } else { TempNodeT2->NextNode = TempNodeT; TempNodeT2 = TempNodeT2->NextNode; } TempNodeS = TempNodeS->NextNode; } return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! */ xbShort xbNtx::UncloneNodeChain( void ) { if( NodeChain ) ReleaseNodeMemory( NodeChain ); NodeChain = CloneChain; CloneChain = NULL; CurNode = NodeChain; while( CurNode->NextNode ) CurNode = CurNode->NextNode; return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! */ /* This routine dumps the node chain to stdout */ #ifdef XBASE_DEBUG void xbNtx::DumpNodeChain( void ) { xbNodeLink *n; cout << "\n*************************\n"; cout << "NodeLinkCtr = " << NodeLinkCtr; cout << "\nReused = " << ReusedNodeLinks << "\n"; n = NodeChain; while(n) { cout << "xbNodeLink Chain" << n->NodeNo << "\n"; n = n->NextNode; } n = FreeNodeChain; while(n) { cout << "FreeNodeLink Chain" << n->NodeNo << "\n"; n = n->NextNode; } n = DeleteChain; while(n) { cout << "DeleteLink Chain" << n->NodeNo << "\n"; n = n->NextNode; } } #endif /***********************************************************************/ //! Short description. /*! \param n */ /* This routine returns a chain of one or more index nodes back to the */ /* free node chain */ void xbNtx::ReleaseNodeMemory( xbNodeLink * n ) { xbNodeLink * temp; if( !FreeNodeChain ) FreeNodeChain = n; else /* put this list at the end */ { temp = FreeNodeChain; while( temp->NextNode ) temp = temp->NextNode; temp->NextNode = n; } return; } /***********************************************************************/ //! Short description. /*! */ /* This routine returns a node from the free chain if available, */ /* otherwise it allocates new memory for the requested node */ xbNodeLink * xbNtx::GetNodeMemory( void ) { xbNodeLink * temp; if( FreeNodeChain ) { temp = FreeNodeChain; temp->offsets = FreeNodeChain->offsets; FreeNodeChain = temp->NextNode; ReusedNodeLinks++; memset( temp->Leaf.KeyRecs, 0x00, XB_NTX_NODE_SIZE ); temp->Leaf.NoOfKeysThisNode = 0; temp->PrevNode = 0x00; temp->NextNode = 0x00; temp->CurKeyNo = 0L; temp->NodeNo = 0L; for (int i = 0; i < HeadNode.KeysPerNode + 1; i++) { temp->offsets[i] = 2 + ((HeadNode.KeysPerNode + 1) * 2) + (HeadNode.KeySize * i); } } else { temp = (xbNodeLink *) malloc( sizeof( xbNodeLink )); if(temp==NULL) return NULL; memset( temp, 0x00, sizeof( xbNodeLink )); temp->offsets = (xbUShort *)malloc( (HeadNode.KeysPerNode + 1) * sizeof(xbUShort)); if (temp->offsets==NULL) { free(temp); return NULL; }; NodeLinkCtr++; } return temp; } /***********************************************************************/ //! Short description. /*! */ #ifdef XBASE_DEBUG void xbNtx::DumpHdrNode( void ) { cout << "\nSignature = " << HeadNode.Signature; cout << "\nVersion = " << HeadNode.Version; cout << "\nStartPahe = " << HeadNode.StartNode; cout << "\nUnusedOffset = " << HeadNode.UnusedOffset; cout << "\nKeySize = " << HeadNode.KeySize; cout << "\nKeyLen = " << HeadNode.KeyLen; cout << "\nDecimalCount = " << HeadNode.DecimalCount; cout << "\nKeysPerNode = " << HeadNode.KeysPerNode; cout << "\nHalfKeysPerPage = " << HeadNode.HalfKeysPerNode; cout << "\nKeyExpression = " << HeadNode.KeyExpression; cout << "\nUnique = " << HeadNode.Unique; cout << "\n"; } #endif /***********************************************************************/ //! Short description. /*! \param pdbf */ xbNtx::xbNtx( xbDbf * pdbf ) : xbIndex (pdbf) { memset( Node, 0x00, XB_NTX_NODE_SIZE ); memset( &HeadNode, 0x00, sizeof( NtxHeadNode )); NodeChain = NULL; CloneChain = NULL; FreeNodeChain = NULL; DeleteChain = NULL; CurNode = NULL; NodeLinkCtr = 0L; ReusedNodeLinks = 0L; } /***********************************************************************/ //! Short description. /*! */ xbShort xbNtx::AllocKeyBufs(void) { KeyBuf = (char *) malloc( HeadNode.KeyLen + 1 ); if(KeyBuf==NULL) { return XB_NO_MEMORY; }; KeyBuf2 = (char *) malloc( HeadNode.KeyLen + 1); if(KeyBuf2==NULL) { free(KeyBuf); return XB_NO_MEMORY; }; memset( KeyBuf, 0x00, HeadNode.KeyLen + 1 ); memset( KeyBuf2, 0x00, HeadNode.KeyLen + 1 ); return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! \param FileName */ xbShort xbNtx::OpenIndex( const char * FileName ) { int NameLen, rc; NameLen = strlen( FileName ) + 1; if (( rc = dbf->NameSuffixMissing( 4, FileName )) > 0) NameLen += 4; IndexName = FileName; if( rc == 1 ) IndexName += ".ntx"; else if ( rc == 2 ) IndexName += ".NTX"; /* open the file */ if(( indexfp = fopen( IndexName, "r+b" )) == NULL ){ xb_open_error(IndexName); } #ifdef XB_LOCKING_ON /* ** Must turn off buffering when multiple programs may be accessing ** index files. */ setbuf( indexfp, NULL ); #endif #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif IndexStatus = 1; if(( rc = GetHeadNode()) != 0) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif fclose( indexfp ); return rc; } /* parse the expression */ if(( rc = dbf->xbase->BuildExpressionTree( HeadNode.KeyExpression, strlen( HeadNode.KeyExpression ), dbf )) != XB_NO_ERROR ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif fclose( indexfp ); return rc; } ExpressionTree = dbf->xbase->GetTree(); dbf->xbase->SetTreeToNull(); rc=AllocKeyBufs(); if(rc) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif fclose(indexfp); return rc; } #ifdef XBASE_DEBUG // CheckIndexIntegrity( 0 ); #endif #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return dbf->AddIndexToIxList( index, IndexName ); } /***********************************************************************/ //! Short description. /*! */ xbShort xbNtx::CloseIndex( void ) { if( KeyBuf ) { free ( KeyBuf ); KeyBuf = NULL; } if( KeyBuf2 ) { free ( KeyBuf2 ); KeyBuf2 = NULL; } dbf->RemoveIndexFromIxList( index ); fclose( indexfp ); IndexStatus = 0; return 0; } /***********************************************************************/ //! Short description. /*! */ xbShort xbNtx::GetHeadNode( void ) { char *p; if( !IndexStatus ) xb_error(XB_NOT_OPEN); if( fseek( indexfp, 0, SEEK_SET )) xb_io_error(XB_SEEK_ERROR, IndexName); if(( fread( Node, XB_NTX_NODE_SIZE, 1, indexfp )) != 1 ) xb_io_error(XB_READ_ERROR, IndexName); /* load the head node structure */ p = Node; HeadNode.Signature = dbf->xbase->GetShort( p ); p += sizeof(xbUShort); HeadNode.Version = dbf->xbase->GetShort( p ); p += sizeof(xbUShort); HeadNode.StartNode = dbf->xbase->GetULong( p ); p += sizeof(xbULong); HeadNode.UnusedOffset = dbf->xbase->GetULong( p ); p += sizeof(xbULong); HeadNode.KeySize = dbf->xbase->GetShort( p ); p += sizeof(xbUShort); HeadNode.KeyLen = dbf->xbase->GetShort( p ); p += sizeof(xbUShort); HeadNode.DecimalCount = dbf->xbase->GetShort( p ); p += sizeof(xbUShort); HeadNode.KeysPerNode = dbf->xbase->GetShort( p ); p += sizeof(xbUShort); HeadNode.HalfKeysPerNode = dbf->xbase->GetShort( p ); p += sizeof(xbUShort); strncpy(HeadNode.KeyExpression, p, 256); p+= 256; HeadNode.Unique = *p++; p = HeadNode.KeyExpression; while (*p) { *p = toupper(*p); p++; } return 0; } /***********************************************************************/ //! Short description. /*! \param NodeNo \param SetNodeChain */ /* This routine reads a leaf node from disk */ /* */ /* If SetNodeChain 2, then the node is not appended to the node chain */ /* but the CurNode pointer points to the node read */ /* If SetNodeChain 1, then the node is appended to the node chain */ /* If SetNodeChain 0, then record is only read to Node memory */ xbShort xbNtx::GetLeafNode( xbLong NodeNo, xbShort SetNodeChain ) { xbNodeLink *n; char *p; if( !IndexStatus ) xb_error(XB_NOT_OPEN); if( fseek( indexfp, NodeNo, SEEK_SET )) xb_io_error(XB_SEEK_ERROR, IndexName); if(( fread( Node, XB_NTX_NODE_SIZE, 1, indexfp )) != 1 ) xb_io_error(XB_READ_ERROR, IndexName); if( !SetNodeChain ) return 0; if(( n = GetNodeMemory()) == NULL ) xb_memory_error; n->NodeNo = NodeNo; n->CurKeyNo = 0L; n->NextNode = NULL; // The offsets at the head of each leaf are not necessarly in order. p = Node + 2; for (int i = 0; i < HeadNode.KeysPerNode + 1; i++) { n->offsets[i] = dbf->xbase->GetShort( p ); p += 2; } // Do the edian translation correctly n->Leaf.NoOfKeysThisNode = dbf->xbase->GetShort( Node ); memcpy( n->Leaf.KeyRecs, Node, XB_NTX_NODE_SIZE); /* put the node in the chain */ if( SetNodeChain == 1 ) { if( NodeChain == NULL ) /* first one ? */ { NodeChain = n; CurNode = n; CurNode->PrevNode = NULL; } else { n->PrevNode = CurNode; CurNode->NextNode = n; CurNode = n; } } else CurNode = n; return 0; } /***********************************************************************/ //! Short description. /*! \param n */ #ifdef XBASE_DEBUG void xbNtx::DumpNodeRec( xbLong n ) { char *p; xbShort NoOfKeys; xbLong LeftBranch, RecNo; xbShort i,j; GetLeafNode( n, 0 ); NoOfKeys = dbf->xbase->GetShort( Node ); p = Node + 4; /* go past no of keys */ cout << "\n--------------------------------------------------------"; cout << "\nNode # " << n << " Number of keys = " << NoOfKeys << "\n"; cout << "\n Key Left Rec Key"; cout << "\nNumber Branch Number Data"; for( i = 0; i < GetKeysPerNode()+1 /*NoOfKeys*/; i++ ) { LeftBranch = dbf->xbase->GetLong( p ); p+=4; RecNo = dbf->xbase->GetLong( p ); p+=4; cout << "\n" << i << " " << LeftBranch << " " << RecNo << " "; for( j = 0; j < HeadNode.KeyLen; j++ ) cout << *p++; } } #endif /***********************************************************************/ //! Short description. /*! \param RecNo \param n */ xbLong xbNtx::GetDbfNo( xbShort RecNo, xbNodeLink * n ) { NtxLeafNode *temp; char *p; xbUShort itemOffset; if( !n ) return 0L; temp = &n->Leaf; p = temp->KeyRecs; if( RecNo < 0 || RecNo > ( temp->NoOfKeysThisNode )) return 0L; itemOffset = GetItemOffset(RecNo, n, 0); // ItemOffset is from the beginning of the record. p += itemOffset; p += 4; return( dbf->xbase->GetLong( p )); } /***********************************************************************/ //! Short description. /*! \param RecNo \param n */ xbLong xbNtx::GetLeftNodeNo( xbShort RecNo, xbNodeLink * n ) { NtxLeafNode *temp; char *p; xbUShort itemOffset; if( !n ) return 0L; temp = &n->Leaf; p = temp->KeyRecs; if( RecNo < 0 || RecNo > temp->NoOfKeysThisNode ) return 0L; itemOffset = GetItemOffset(RecNo, n, 0); // ItemOffset is from the beginning of the record. p += itemOffset; return( dbf->xbase->GetULong( p )); } /***********************************************************************/ //! Short description. /*! \param RecNo \param n */ char * xbNtx::GetKeyData( xbShort RecNo, xbNodeLink * n ) { NtxLeafNode *temp; char *p; xbUShort itemOffset; if( !n ) return 0L; temp = &n->Leaf; p = temp->KeyRecs; if( RecNo < 0 || RecNo > ( temp->NoOfKeysThisNode )) return 0L; itemOffset = GetItemOffset(RecNo, n, 0); // ItemOffset is from the beginning of the record. p += itemOffset + 8; return( p ); } /***********************************************************************/ //! Short description. /*! \param RecNo \param n \param */ xbUShort xbNtx::GetItemOffset(xbShort RecNo, xbNodeLink *n, xbShort) { if (RecNo > (this->HeadNode.KeysPerNode + 1)) { cout << "RecNo = " << RecNo << endl; cout << "this->HeadNode.KeysPerNode = " << this->HeadNode.KeysPerNode << endl; cout << "********************* BUG ***********************" << endl; // ;-) exit(1); } return n->offsets[RecNo]; } //! Short description. /*! \param pos \param n */ xbUShort xbNtx::InsertKeyOffset(xbShort pos, xbNodeLink *n) { xbUShort temp; // save the new offset temp = n->offsets[n->Leaf.NoOfKeysThisNode + 1]; for( int i = n->Leaf.NoOfKeysThisNode + 1; i > pos; i-- ) { n->offsets[i] = n->offsets[i-1]; } n->offsets[pos] = temp; return n->offsets[pos]; } //! Short description. /*! \param pos \param n */ xbUShort xbNtx::DeleteKeyOffset(xbShort pos, xbNodeLink *n) { xbUShort temp; xbShort i; // save the old offset temp = n->offsets[pos]; for( i = pos; i < n->Leaf.NoOfKeysThisNode; i++ ) { n->offsets[i] = n->offsets[i+1]; } n->offsets[i] = temp; return n->offsets[i]; } /***********************************************************************/ //! Short description. /*! */ xbLong xbNtx::GetTotalNodes( void ) { // if( &HeadNode ) // return HeadNode.TotalNodes; // else return 0L; } /***********************************************************************/ //! Short description. /*! */ xbUShort xbNtx::GetKeysPerNode( void ) { if( &HeadNode ) return HeadNode.KeysPerNode; else return 0L; } /***********************************************************************/ //! Short description. /*! \param RetrieveSw */ xbShort xbNtx::GetFirstKey( xbShort RetrieveSw ) { /* This routine returns 0 on success and sets CurDbfRec to the record */ /* corresponding to the first index pointer */ xbLong TempNodeNo; xbShort rc; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif /* initialize the node chain */ if( NodeChain ) { ReleaseNodeMemory( NodeChain ); NodeChain = NULL; } if(( rc = GetHeadNode()) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* get a node and add it to the link */ if(( rc = GetLeafNode( HeadNode.StartNode, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* traverse down the left side of the tree */ while( GetLeftNodeNo( 0, CurNode )) { TempNodeNo = GetLeftNodeNo( 0, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } CurNode->CurKeyNo = 0; } CurDbfRec = GetDbfNo( 0, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! \param RetrieveSw */ xbShort xbNtx::GetNextKey( xbShort RetrieveSw ) { /* This routine returns 0 on success and sets CurDbfRec to the record */ /* corresponding to the next index pointer */ xbNodeLink * TempNodeLink; xbLong TempNodeNo; xbShort rc; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif if( !IndexStatus ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; xb_error(XB_NOT_OPEN); } if( !CurNode ) { rc = GetFirstKey( RetrieveSw ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* more keys on this node ? */ if(( CurNode->Leaf.NoOfKeysThisNode -1 ) > CurNode->CurKeyNo ) { CurNode->CurKeyNo++; CurDbfRec = GetDbfNo( CurNode->CurKeyNo, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /* if head node we are at eof */ if( CurNode->NodeNo == HeadNode.StartNode ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif #ifdef HAVE_EXCEPTIONS throw xbEoFException(); #else return XB_EOF; #endif } /* this logic assumes that interior nodes have n+1 left node no's where */ /* n is the number of keys in the node */ /* pop up one node to the interior node level & free the leaf node */ TempNodeLink = CurNode; CurNode = CurNode->PrevNode; CurNode->NextNode = NULL; ReleaseNodeMemory( TempNodeLink ); /* while no more right keys && not head node, pop up one node */ while(( CurNode->CurKeyNo >= CurNode->Leaf.NoOfKeysThisNode ) && ( CurNode->NodeNo != HeadNode.StartNode )) { TempNodeLink = CurNode; CurNode = CurNode->PrevNode; CurNode->NextNode = NULL; ReleaseNodeMemory( TempNodeLink ); } /* if head node && right most key, return end-of-file */ if(( HeadNode.StartNode == CurNode->NodeNo ) && ( CurNode->CurKeyNo >= CurNode->Leaf.NoOfKeysThisNode )) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif #ifdef HAVE_EXCEPTIONS throw xbEoFException(); #else return XB_EOF; #endif } /* move one to the right */ CurNode->CurKeyNo++; TempNodeNo = GetLeftNodeNo( CurNode->CurKeyNo, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* traverse down the left side of the tree */ while( GetLeftNodeNo( 0, CurNode )) { TempNodeNo = GetLeftNodeNo( 0, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } CurNode->CurKeyNo = 0; } CurDbfRec = GetDbfNo( 0, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! \param NodeNo \param RetrieveSw */ xbShort xbNtx::GetLastKey( xbLong NodeNo, xbShort RetrieveSw ) { /* This routine returns 0 on success and sets CurDbfRec to the record */ /* corresponding to the last index pointer */ /* If NodeNo = 0, start at head node, otherwise start at NodeNo */ xbLong TempNodeNo; xbShort rc; // TODO // NTX files keep no TotalNode count. // if( NodeNo < 0 || NodeNo > HeadNode.TotalNodes ) // return XB_INVALID_NODE_NO; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif /* initialize the node chain */ if( NodeChain ) { ReleaseNodeMemory( NodeChain ); NodeChain = NULL; } if( NodeNo == 0L ) if(( rc = GetHeadNode()) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } /* get a node and add it to the link */ if( NodeNo == 0L ) { if(( rc = GetLeafNode( HeadNode.StartNode, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } } else { if(( rc = GetLeafNode( NodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } } CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; /* traverse down the right side of the tree */ while( GetLeftNodeNo( CurNode->Leaf.NoOfKeysThisNode, CurNode )) { TempNodeNo = GetLeftNodeNo( CurNode->Leaf.NoOfKeysThisNode, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; } CurNode->CurKeyNo--; /* leaf node has one fewer ix recs */ CurDbfRec = GetDbfNo( CurNode->Leaf.NoOfKeysThisNode-1, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! \param RetrieveSw */ xbShort xbNtx::GetPrevKey( xbShort RetrieveSw ) { /* This routine returns 0 on success and sets CurDbfRec to the record */ /* corresponding to the previous index pointer */ xbNodeLink * TempNodeLink; xbLong TempNodeNo; xbShort rc; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif if( !IndexStatus ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; xb_error(XB_NOT_OPEN); } if( !CurNode ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return GetFirstKey( RetrieveSw ); } /* more keys on this node ? */ if( CurNode->CurKeyNo > 0 ) { CurNode->CurKeyNo--; CurDbfRec = GetDbfNo( CurNode->CurKeyNo, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /* this logic assumes that interior nodes have n+1 left node no's where */ /* n is the number of keys in the node */ /* pop up one node to the interior node level & free the leaf node */ if( !CurNode->PrevNode ) /* michael - make sure prev node exists */ { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif #ifdef HAVE_EXCEPTIONS throw xbEoFException(); #else return XB_EOF; #endif } TempNodeLink = CurNode; CurNode = CurNode->PrevNode; CurNode->NextNode = NULL; ReleaseNodeMemory( TempNodeLink ); /* while no more left keys && not head node, pop up one node */ while(( CurNode->CurKeyNo == 0 ) && ( CurNode->NodeNo != HeadNode.StartNode )) { TempNodeLink = CurNode; CurNode = CurNode->PrevNode; CurNode->NextNode = NULL; ReleaseNodeMemory( TempNodeLink ); } /* if head node && left most key, return end-of-file */ if(( HeadNode.StartNode == CurNode->NodeNo ) && ( CurNode->CurKeyNo == 0 )) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif #ifdef HAVE_EXCEPTIONS throw xbEoFException(); #else return XB_EOF; #endif } /* move one to the left */ CurNode->CurKeyNo--; TempNodeNo = GetLeftNodeNo( CurNode->CurKeyNo, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } if( GetLeftNodeNo( 0, CurNode )) /* if interior node */ CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; else /* leaf node */ CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode -1; /* traverse down the right side of the tree */ while( GetLeftNodeNo( 0, CurNode )) /* while interior node */ { TempNodeNo = GetLeftNodeNo( CurNode->Leaf.NoOfKeysThisNode, CurNode ); if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } if( GetLeftNodeNo( 0, CurNode )) /* if interior node */ CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; else /* leaf node */ CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode -1; } CurDbfRec = GetDbfNo( CurNode->Leaf.NoOfKeysThisNode -1, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) return dbf->GetRecord( CurDbfRec ); else return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! \param Key1 \param Key2 \param Klen */ xbShort xbNtx::CompareKey( const char * Key1, const char * Key2, xbShort Klen ) { /* if key1 = key2 --> return 0 */ /* if key1 > key2 --> return 1 */ /* if key1 < key2 --> return 2 */ const char *k1, *k2; xbShort i; if( Klen > HeadNode.KeyLen ) Klen = HeadNode.KeyLen; k1 = Key1; k2 = Key2; for( i = 0; i < Klen; i++ ) { if( *k1 > *k2 ) return 1; if( *k1 < *k2 ) return 2; k1++; k2++; } return 0; } /***********************************************************************/ //! Short description. /*! \param Key1 \param Key2 */ xbShort xbNtx::CompareKey( const char * Key1, const char * Key2) { /* if key1 = key2 --> return 0 */ /* if key1 > key2 --> return 1 */ /* if key1 < key2 --> return 2 */ int rc; rc = strcmp(Key1, Key2); if (rc < 0) return 2; else if (rc > 0) return 1; else return 0; } /***********************************************************************/ //! Short description. /*! \param Tkey \param */ xbULong xbNtx::GetLeafFromInteriorNode( const char * Tkey, xbShort ) { /* This function scans an interior node for a key and returns the */ /* correct interior leaf node no */ xbShort rc, p; /* if Tkey > any keys in node, return right most key */ p = CurNode->Leaf.NoOfKeysThisNode -1 ; if( CompareKey( Tkey, GetKeyData( p, CurNode )) == 1 ) { CurNode->CurKeyNo = CurNode->Leaf.NoOfKeysThisNode; return GetLeftNodeNo( CurNode->Leaf.NoOfKeysThisNode, CurNode ); } /* otherwise, start at the beginning and scan up */ p = 0; while( p < CurNode->Leaf.NoOfKeysThisNode) { rc = CompareKey( Tkey, GetKeyData( p, CurNode ) ); if (rc == 2) break; else if (rc == 0) { CurNode->CurKeyNo = p; CurDbfRec = GetDbfNo( p, CurNode ); return 0; } p++; } CurNode->CurKeyNo = p; return GetLeftNodeNo( p, CurNode ); } /***********************************************************************/ //! Short description. /*! \param d */ xbShort xbNtx::KeyExists( xbDouble d ) { char buf[9]; memset( buf, 0x00, 9 ); dbf->xbase->PutDouble( buf, d ); return FindKey( buf, 8, 0 ); } /***********************************************************************/ //! Short description. /*! \param d */ xbShort xbNtx::FindKey( xbDouble d ) { char buf[9]; memset( buf, 0x00, 9 ); dbf->xbase->PutDouble( buf, d ); return FindKey( buf, 8, 1 ); } /***********************************************************************/ //! Short description. /*! \param Key */ xbShort xbNtx::FindKey( const char * Key ) { return FindKey( Key, strlen( Key ), 1 ); } /***********************************************************************/ //! Short description. /*! \param Tkey \param DbfRec */ xbShort xbNtx::FindKey( const char * Tkey, xbLong DbfRec ) { /* find a key with a specifc xbDbf record number */ xbShort rc; xbLong CurDbfRecNo; xbLong CurNtxDbfNo; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif /* if we are already on the correct key, return XB_FOUND */ if( CurNode ) { CurDbfRecNo = dbf->GetCurRecNo(); CurNtxDbfNo = GetDbfNo( CurNode->CurKeyNo, CurNode ); if( CurDbfRecNo == CurNtxDbfNo ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_FOUND; } } rc = FindKey( Tkey, HeadNode.KeyLen, 0 ); while( rc == 0 || rc == XB_FOUND ) { if( strncmp( Tkey, GetKeyData( CurNode->CurKeyNo, CurNode ), HeadNode.KeyLen ) == 0 ) { if( DbfRec == GetDbfNo( CurNode->CurKeyNo, CurNode )) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_FOUND; } else rc = GetNextKey( 0 ); } else { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_NOT_FOUND; } } #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_NOT_FOUND; } /***********************************************************************/ //! Short description. /*! */ xbShort xbNtx::FindKey( void ) { /* if no paramaters given, use KeyBuf */ return( FindKey( KeyBuf, HeadNode.KeyLen, 0 )); } /***********************************************************************/ //! Short description. /*! \param Tkey \param Klen \param RetrieveSw */ xbShort xbNtx::FindKey( const char * Tkey, xbShort Klen, xbShort RetrieveSw ) { /* This routine sets the current key to the found key */ /* if RetrieveSw is true, the method positions the dbf record */ xbShort rc,i; xbLong TempNodeNo; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_RDLCK)) != 0) return rc; #endif if( NodeChain ) { ReleaseNodeMemory( NodeChain ); NodeChain = NULL; } if(( rc = GetHeadNode()) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } // If the index is empty if ( HeadNode.StartNode == 0) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return XB_NOT_FOUND; } /* load first node */ if(( rc = GetLeafNode( HeadNode.StartNode, 1 )) != 0 ) { CurDbfRec = 0L; #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* traverse down the tree until it hits a leaf */ while( GetLeftNodeNo( 0, CurNode )) /* while interior node */ { TempNodeNo = GetLeafFromInteriorNode( Tkey, Klen ); #if 1 // GetLeafFromInteriorNode will return 0 if the key is found on // an inode. But the leftNodeNo will not be 0. if (TempNodeNo == 0 && GetLeftNodeNo( 0, CurNode ) != 0) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) dbf->GetRecord( CurDbfRec ); return XB_FOUND; } #endif if(( rc = GetLeafNode( TempNodeNo, 1 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif CurDbfRec = 0L; return rc; } } /* leaf level */ for( i = 0; i < CurNode->Leaf.NoOfKeysThisNode; i++ ) { rc = CompareKey( Tkey, GetKeyData( i, CurNode ) ); if( rc == 0 ) { CurNode->CurKeyNo = i; CurDbfRec = GetDbfNo( i, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) dbf->GetRecord( CurDbfRec ); return XB_FOUND; } else if( rc == 2 ) { CurNode->CurKeyNo = i; CurDbfRec = GetDbfNo( i, CurNode ); if( RetrieveSw ) dbf->GetRecord( CurDbfRec ); // If key is lessthan, without length involved, // Check to see if the substring match #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if (CompareKey( Tkey, GetKeyData( i, CurNode ), Klen ) == 0) return XB_FOUND; else return XB_NOT_FOUND; } } CurNode->CurKeyNo = i; CurDbfRec = GetDbfNo( i, CurNode ); #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif if( RetrieveSw ) dbf->GetRecord( CurDbfRec ); return XB_NOT_FOUND; } /***********************************************************************/ //! Short description. /*! */ xbShort xbNtx::CalcKeyLen( void ) { xbShort rc; xbExpNode * TempNode; char FieldName[11]; char Type; TempNode = dbf->xbase->GetFirstTreeNode( ExpressionTree ); if( !TempNode ) return 0; if( TempNode->Type == 'd' ) return TempNode->ResultLen; if( TempNode->Type == 'D' ) { memset( FieldName, 0x00, 11 ); memcpy( FieldName, TempNode->NodeText, TempNode->Len ); Type = dbf->GetFieldType( dbf->GetFieldNo( FieldName )); if( Type == 'N' || Type == 'F' ) return TempNode->ResultLen; } if(( rc = dbf->xbase->ProcessExpression( ExpressionTree )) != XB_NO_ERROR ) return 0; TempNode = (xbExpNode *) dbf->xbase->Pop(); if( !TempNode ) return 0; rc = TempNode->DataLen; // if( !TempNode->InTree ) dbf->xbase->FreeExpNode( TempNode ); if( !TempNode->InTree ) delete TempNode; return rc; } /***********************************************************************/ //! Short description. /*! \param IxName \param Exp \param Unique \param Overlay */ xbShort xbNtx::CreateIndex(const char * IxName, const char * Exp, xbShort Unique, xbShort Overlay ) { xbShort i, NameLen, KeyLen, rc; IndexStatus = XB_CLOSED; if( strlen( Exp ) > 255 ) xb_error( XB_INVALID_KEY_EXPRESSION); if( dbf->GetDbfStatus() == 0 ) xb_error( XB_NOT_OPEN); /* Get the index file name and store it in the class */ NameLen = strlen( IxName ) + 1; if(( rc = dbf->NameSuffixMissing( 4, IxName )) > 0 ) NameLen +=4; /* if(( IndexName = (char *) malloc( NameLen )) == NULL ) { #ifdef HAVE_EXCEPTIONS throw xbOutOfMemoryException(); #else return XB_NO_MEMORY; #endif } */ /* copy the name to the class variable */ IndexName = IxName; if( rc == 1 ) IndexName += ".ntx"; else if( rc == 2 ) IndexName += ".NTX"; /* check if the file already exists */ if (((indexfp = fopen( IndexName, "r" )) != NULL ) && !Overlay ) { fclose( indexfp ); xb_io_error(XB_FILE_EXISTS, IndexName); } else if( indexfp ) fclose( indexfp ); if(( indexfp = fopen( IndexName, "w+b" )) == NULL ){ return XB_OPEN_ERROR; } #ifdef XB_LOCKING_ON /* ** Must turn off buffering when multiple programs may be accessing ** index files. */ setbuf( indexfp, NULL ); #endif #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) if((rc = LockIndex(F_SETLKW, F_WRLCK)) != 0) return rc; #endif /* parse the expression */ if(( rc = dbf->xbase->BuildExpressionTree( Exp, strlen( Exp ), dbf )) != XB_NO_ERROR ) return rc; ExpressionTree = dbf->xbase->GetTree(); dbf->xbase->SetTreeToNull(); /* build the header record */ memset( &HeadNode, 0x00, sizeof( NtxHeadNode )); HeadNode.Signature = 0x6; // Clipper 5.x HeadNode.Version = 1; HeadNode.StartNode = 1024L; KeyLen = CalcKeyLen(); // TODO // What is the Clipper key length limit? if( KeyLen == 0 || KeyLen > 100 ) /* 100 byte key length limit */ { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif xb_error(XB_INVALID_KEY); } else { HeadNode.KeyLen = KeyLen; } // This is not the algorithm that Clipper uses. I cant figure out // what they use from looking at the examples. // This is correct tho. HeadNode.KeysPerNode = (xbUShort) (( XB_NTX_NODE_SIZE - (2 * sizeof( xbUShort ))) / (HeadNode.KeyLen + 10 )) - 1; if (HeadNode.KeysPerNode % 2) HeadNode.KeysPerNode--; HeadNode.HalfKeysPerNode = (xbUShort) HeadNode.KeysPerNode / 2; HeadNode.KeySize = HeadNode.KeyLen + 8; // while(( HeadNode.KeySize % 4 ) != 0 ) HeadNode.KeySize++; /* multiple of 4*/ HeadNode.Unique = Unique; strncpy( HeadNode.KeyExpression, Exp, 255 ); rc=AllocKeyBufs(); if(rc) { fclose(indexfp); return rc; }; if(( rc = PutHeadNode( &HeadNode, indexfp, 0 )) != 0 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } /* write node #1 all 0x00 */ for( i = 0; i < XB_NTX_NODE_SIZE; i++ ) { if(( fwrite( "\x00", 1, 1, indexfp )) != 1 ) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif fclose( indexfp ); xb_io_error(XB_WRITE_ERROR, IndexName); } } IndexStatus = XB_OPEN; if ((rc = GetLeafNode(HeadNode.StartNode, 1)) != 0) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } for (i = 0; i < HeadNode.KeysPerNode + 1; i++) { CurNode->offsets[i] = (i * HeadNode.KeySize) + 2 + (2 * (HeadNode.KeysPerNode + 1)); } if ((rc = PutLeafNode(HeadNode.StartNode, CurNode )) != 0) { #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return rc; } #ifdef XB_LOCKING_ON if( dbf->GetAutoLock() ) LockIndex(F_SETLKW, F_UNLCK); #endif return dbf->AddIndexToIxList( index, IndexName ); } /***********************************************************************/ //! Short description. /*! \param RecNo \param n \param NodeNo */ xbShort xbNtx::PutLeftNodeNo( xbShort RecNo, xbNodeLink *n, xbLong NodeNo ) { /* This routine sets n node's leftnode number */ NtxLeafNode *temp; char *p; xbUShort itemOffset; if( !n ) xb_error( XB_INVALID_NODELINK); temp = &n->Leaf; if( RecNo < 0 || RecNo > HeadNode.KeysPerNode) xb_error(XB_INVALID_KEY); p = temp->KeyRecs; itemOffset = GetItemOffset(RecNo, n, 1); p += itemOffset; dbf->xbase->PutLong( p, NodeNo ); return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! \param RecNo \param n \param DbfNo */ xbShort xbNtx::PutDbfNo( xbShort RecNo, xbNodeLink *n, xbLong DbfNo ) { /* This routine sets n node's dbf number */ NtxLeafNode *temp; char *p; xbUShort itemOffset; if( !n ) xb_error( XB_INVALID_NODELINK); temp = &n->Leaf; if( RecNo < 0 || RecNo > (HeadNode.KeysPerNode)) xb_error(XB_INVALID_KEY); itemOffset = GetItemOffset(RecNo, n, 1); p = temp->KeyRecs; p += itemOffset; p += 4; dbf->xbase->PutLong( p, DbfNo ); return XB_NO_ERROR; } /************************************************************************/ //! Short description. /*! \param l \param n */ xbShort xbNtx::PutLeafNode( xbLong l, xbNodeLink *n ) { NtxLeafNode *temp; char *p; if(( fseek( indexfp, l , SEEK_SET )) != 0 ) { fclose( indexfp ); xb_io_error( XB_SEEK_ERROR, IndexName ); } temp = &n->Leaf; p = temp->KeyRecs; dbf->xbase->PutShort( p, temp->NoOfKeysThisNode ); // The offsets at the head of each leaf are not necessarly in order. p += 2; for (int i = 0; i < HeadNode.KeysPerNode + 1; i++) { dbf->xbase->PutShort( p, n->offsets[i] ); p += 2; } if(( fwrite( &n->Leaf.KeyRecs, XB_NTX_NODE_SIZE, 1, indexfp )) != 1 ) { fclose( indexfp ); xb_io_error(XB_WRITE_ERROR, IndexName); } PutHeadNode(&HeadNode, indexfp, 1); return 0; } /************************************************************************/ //! Short description. /*! \param Head \param f \param UpdateOnly */ xbShort xbNtx::PutHeadNode( NtxHeadNode * Head, FILE * f, xbShort UpdateOnly ) { char buf[4]; char *p; if(( fseek( f, 0L, SEEK_SET )) != 0 ) { fclose( f ); xb_io_error( XB_SEEK_ERROR, IndexName ); } memset( buf, 0x00, 2 ); dbf->xbase->PutUShort( buf, Head->Signature ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error(XB_WRITE_ERROR, IndexName); } memset( buf, 0x00, 2 ); dbf->xbase->PutUShort( buf, Head->Version ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } memset( buf, 0x00, 4 ); dbf->xbase->PutULong( buf, Head->StartNode ); if(( fwrite( &buf, 4, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } memset( buf, 0x00, 4 ); dbf->xbase->PutULong( buf, Head->UnusedOffset ); if(( fwrite( &buf, 4, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } if( UpdateOnly ) { fflush(indexfp); xb_io_error( XB_NO_ERROR, IndexName ); } memset( buf, 0x00, 2 ); dbf->xbase->PutUShort( buf, Head->KeySize ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } memset( buf, 0x00, 2 ); dbf->xbase->PutUShort( buf, Head->KeyLen ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } memset( buf, 0x00, 2 ); dbf->xbase->PutUShort( buf, Head->DecimalCount ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } memset( buf, 0x00, 2 ); dbf->xbase->PutUShort( buf, Head->KeysPerNode ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } memset( buf, 0x00, 2 ); dbf->xbase->PutUShort( buf, Head->HalfKeysPerNode ); if(( fwrite( &buf, 2, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } p = HeadNode.KeyExpression; while (*p) { *p = tolower(*p); p++; } if(( fwrite( &Head->KeyExpression, 256, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } memset( buf, 0x00, 1 ); buf[0] = Head->Unique; if(( fwrite( &buf, 1, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } if(( fwrite( &Head->NotUsed, 745, 1, f )) != 1 ) { fclose( f ); xb_io_error( XB_WRITE_ERROR, IndexName ); } return 0; } xbShort xbNtx::TouchIndex( void ) { xbShort rc; if (( rc = GetHeadNode()) != XB_NO_ERROR) return rc; HeadNode.Version++; if (( rc = PutHeadNode(&HeadNode, indexfp, 1)) != XB_NO_ERROR) return rc; return XB_NO_ERROR; } /************************************************************************/ //! Short description. /*! \param RecNo \param n */ xbShort xbNtx::PutKeyData( xbShort RecNo, xbNodeLink *n ) { /* This routine copies the KeyBuf data into xbNodeLink n */ NtxLeafNode *temp; char *p; xbShort i; xbUShort itemOffset; if( !n ) xb_error( XB_INVALID_NODELINK ); temp = &n->Leaf; if( RecNo < 0 || RecNo > (HeadNode.KeysPerNode)) xb_error( XB_INVALID_KEY ); itemOffset = GetItemOffset(RecNo, n, 1); p = temp->KeyRecs; p += itemOffset; p += 8; for( i = 0; i < HeadNode.KeyLen; i++ ) { *p = KeyBuf[i]; p++; } return XB_NO_ERROR; } /************************************************************************/ //! Short description. /*! \param n \param pos \param d \param l \param w */ xbShort xbNtx::PutKeyInNode( xbNodeLink * n, xbShort pos, xbLong d, xbLong l, xbShort w ) { /* check the node */ if( !n ) xb_error( XB_INVALID_NODELINK ); if( pos < 0 || pos > HeadNode.KeysPerNode ) xb_error( XB_INVALID_RECORD ); if( n->Leaf.NoOfKeysThisNode >= HeadNode.KeysPerNode ) xb_error( XB_NODE_FULL ); InsertKeyOffset(pos, n); PutKeyData( pos, n ); PutDbfNo( pos, n, d ); PutLeftNodeNo( pos, n, l ); n->Leaf.NoOfKeysThisNode++; if( w ) return PutLeafNode( n->NodeNo, n ); else return 0; } /************************************************************************/ //! Short description. /*! \param n1 \param n2 \param pos \param d */ xbShort xbNtx::SplitLeafNode( xbNodeLink *n1, xbNodeLink *n2, xbShort pos, xbLong d ) { xbShort i,j,rc; xbShort temp; xbShort start; xbShort end; xbShort length; if( !n1 || !n2 ) xb_error( XB_INVALID_NODELINK ); if( pos < 0 || pos > HeadNode.KeysPerNode ) xb_error( XB_INVALID_RECORD ); length = strlen(KeyBuf); // If the new key goes in the first node. if (pos < HeadNode.HalfKeysPerNode) { // Setup key to insert into parent memcpy(PushItem.Key, GetKeyData(HeadNode.HalfKeysPerNode -1, n1), HeadNode.KeyLen); PushItem.RecordNumber = GetDbfNo(HeadNode.HalfKeysPerNode -1, n1); PushItem.Node = 0L; start = pos; end = HeadNode.HalfKeysPerNode - 1; temp = n1->offsets[end]; for( i = end; i > start; i--) { n1->offsets[i] = n1->offsets[i-1]; } n1->offsets[start] = temp; // Insert new key PutKeyData( start , n1 ); PutDbfNo ( start , n1, d ); } else { // If the passed-in key IS median key, just copy it. if (pos == HeadNode.HalfKeysPerNode) { memcpy(PushItem.Key, KeyBuf, HeadNode.KeyLen); PushItem.RecordNumber = d; start = pos; end = pos; } else { // Otherwise, the median key will be middle key becasue the // new key will be inserted somewhere above the middle. memcpy(PushItem.Key, GetKeyData(HeadNode.HalfKeysPerNode, n1), HeadNode.KeyLen); PushItem.RecordNumber = GetDbfNo(HeadNode.HalfKeysPerNode, n1); start = HeadNode.HalfKeysPerNode ; end = pos -1; } temp = n1->offsets[start]; for( i = start; i < end; i++) { n1->offsets[i] = n1->offsets[i+1]; } n1->offsets[end] = temp; // Insert new key PutKeyData( pos -1 , n1 ); PutDbfNo ( pos -1 , n1, d ); } // Dup the node data memcpy(n2->Leaf.KeyRecs, n1->Leaf.KeyRecs, XB_NTX_NODE_SIZE); // Dup the offsets for ( i = 0; i < HeadNode.KeysPerNode +1; i++) { n2->offsets[i] = n1->offsets[i]; } // Setup the second node for (j = 0, i = HeadNode.HalfKeysPerNode; i < HeadNode.KeysPerNode; i++, j++ ) { temp = n2->offsets[j]; n2->offsets[j] = n2->offsets[i]; n2->offsets[i] = temp; } // Get the last offset for both nodes temp = n2->offsets[j]; n2->offsets[j] = n2->offsets[HeadNode.KeysPerNode]; n2->offsets[HeadNode.KeysPerNode] = temp; // Set the new count of both nodes n2->Leaf.NoOfKeysThisNode = HeadNode.HalfKeysPerNode; n1->Leaf.NoOfKeysThisNode = HeadNode.HalfKeysPerNode; if(( rc = PutLeafNode( n1->NodeNo, n1 )) != 0 ) return rc; if(( rc = PutLeafNode( n2->NodeNo, n2 )) != 0 ) return rc; return 0; } /************************************************************************/ //! Short description. /*! \param n1 \param n2 \param */ xbShort xbNtx::SplitINode( xbNodeLink *n1, xbNodeLink *n2, xbLong ) /* parent, tempnode, tempnodeno */ { xbShort i,j,rc; xbShort temp; xbShort pos = n1->CurKeyNo; xbShort start; xbShort end; xbLong n1LastNodeNo = 0; NtxItem oldPushItem; oldPushItem.Node = PushItem.Node; oldPushItem.RecordNumber = PushItem.RecordNumber; memcpy(oldPushItem.Key, PushItem.Key, sizeof(PushItem.Key)); // n2->NodeNo = HeadNode.TotalNodes++; n2->NodeNo = GetNextNodeNo(); // If the new key goes in the first node. if (pos < HeadNode.HalfKeysPerNode) { // Setup key to insert into parent memcpy(PushItem.Key, GetKeyData(HeadNode.HalfKeysPerNode -1, n1), HeadNode.KeyLen); PushItem.RecordNumber = GetDbfNo(HeadNode.HalfKeysPerNode -1, n1); PushItem.Node = n2->NodeNo; n1LastNodeNo = GetLeftNodeNo(HeadNode.HalfKeysPerNode -1, n1); start = pos; end = HeadNode.HalfKeysPerNode - 1; // Insert the new key. temp = n1->offsets[end]; for( i = end; i > start; i--) { n1->offsets[i] = n1->offsets[i-1]; } n1->offsets[start] = temp; } else { // If the passed-in key IS median key, just copy it. if (pos == HeadNode.HalfKeysPerNode) { PutLeftNodeNo(0, n2, oldPushItem.Node); // PushItem should remain the same, except for its left pointer PushItem.Node = n2->NodeNo; start = pos; end = pos; } else { // Otherwise, the median key will be middle key becasue the // new key will be inserted somewhere above the middle. memcpy(PushItem.Key, GetKeyData(HeadNode.HalfKeysPerNode, n1), HeadNode.KeyLen); PushItem.RecordNumber = GetDbfNo(HeadNode.HalfKeysPerNode, n1); PushItem.Node = n2->NodeNo; n1LastNodeNo = GetLeftNodeNo(HeadNode.HalfKeysPerNode, n1); // start = HeadNode.HalfKeysPerNode + 1; start = HeadNode.HalfKeysPerNode; end = pos -1; // Insert the new key. temp = n1->offsets[start]; for( i = start; i < end; i++) { n1->offsets[i] = n1->offsets[i+1]; } n1->offsets[end] = temp; pos--; } } /* restore original key */ memcpy( KeyBuf, oldPushItem.Key, HeadNode.KeyLen + 1); // Insert new key PutKeyData( pos, n1 ); PutDbfNo ( pos, n1, oldPushItem.RecordNumber); PutLeftNodeNo( pos, n1, GetLeftNodeNo (pos + 1, n1)); PutLeftNodeNo( pos + 1 /* +1 ?*/, n1, oldPushItem.Node /* t */ ); // Dup the node data into the new page memcpy(n2->Leaf.KeyRecs, n1->Leaf.KeyRecs, XB_NTX_NODE_SIZE); // Dup the offsets for ( i = 0; i < HeadNode.KeysPerNode +1; i++) { n2->offsets[i] = n1->offsets[i]; } // Setup the second node for (j = 0, i = HeadNode.HalfKeysPerNode; i < HeadNode.KeysPerNode; i++, j++ ) { temp = n2->offsets[j]; n2->offsets[j] = n2->offsets[i]; n2->offsets[i] = temp; } // Get the last offset for both nodes temp = n2->offsets[j]; n2->offsets[j] = n2->offsets[HeadNode.KeysPerNode]; n2->offsets[HeadNode.KeysPerNode] = temp; PutLeftNodeNo(HeadNode.HalfKeysPerNode, n1, n1LastNodeNo); // Set the new count of both nodes n2->Leaf.NoOfKeysThisNode = HeadNode.HalfKeysPerNode; n1->Leaf.NoOfKeysThisNode = HeadNode.HalfKeysPerNode; if((rc = PutLeafNode( n1->NodeNo,n1 )) != 0) return rc; if((rc = PutLeafNode( n2->NodeNo,n2 )) != 0) return rc; return 0; } /************************************************************************/ //! Short description. /*! \param RecBufSw \param KeyBufSw */ xbShort xbNtx::CreateKey( xbShort RecBufSw, xbShort KeyBufSw ) { /* RecBufSw 0 Use RecBuf */ /* 1 Use RecBuf2 */ /* KeyBufSw 0 Use KeyBuf */ /* 1 Use KeyBuf2 */ xbShort rc; xbExpNode * TempNode; if(( rc = dbf->xbase->ProcessExpression( ExpressionTree, RecBufSw )) != XB_NO_ERROR ) return rc; TempNode = (xbExpNode *) dbf->xbase->Pop(); if( !TempNode ) xb_error( XB_INVALID_KEY ); if( KeyBufSw ) { memset( KeyBuf2, 0x00, HeadNode.KeyLen + 1 ); memcpy( KeyBuf2, TempNode->StringResult, TempNode->DataLen ); } else { memset( KeyBuf, 0x00, HeadNode.KeyLen + 1 ); memcpy( KeyBuf, TempNode->StringResult, TempNode->DataLen ); } // if( !TempNode->InTree ) dbf->xbase->FreeExpNode( TempNode ); if( !TempNode->InTree ) delete TempNode; return 0; } /************************************************************************/ //! Short description. /*! \param key */ xbShort xbNtx::GetCurrentKey(char *key) { CreateKey(0, 0); memcpy(key, KeyBuf, HeadNode.KeyLen + 1); return 0; } /************************************************************************/ //! Short description. /*! \param DbfRec */ xbShort xbNtx::AddKey( xbLong DbfRec ) { /* This routine assumes KeyBuf contains the contents of the index to key */ xbShort i,rc; xbNodeLink * TempNode; xbNodeLink * Tparent; xbLong TempNodeNo = 0L; /* new, unattached leaf node no */ /* find node key belongs in */ rc = FindKey( KeyBuf, HeadNode.KeyLen, 0 ); if( rc == XB_FOUND && HeadNode.Unique ) xb_error(XB_KEY_NOT_UNIQUE); // 9/29/98 // these lines commented out - compatibity wins over efficiency for this library // /* 1.02 next statement moves to key match w/ space in nodes to reduce splits */ // if( !HeadNode.Unique && rc == XB_FOUND && // HeadNode.KeysPerNode == CurNode->Leaf.NoOfKeysThisNode ) // { // if(( rc = CloneNodeChain()) != XB_NO_ERROR ) return rc; // if(( rc = GetNextKey( 0 )) != XB_NO_ERROR ) // UncloneNodeChain(); // while( HeadNode.KeysPerNode == CurNode->Leaf.NoOfKeysThisNode && // rc == XB_NO_ERROR && // (CompareKey( KeyBuf, GetKeyData( CurNode->CurKeyNo, CurNode ), // HeadNode.KeyLen ) == 0 ) // ) // if(( rc = GetNextKey( 0 )) != XB_NO_ERROR ) // UncloneNodeChain(); // } /************************************************/ /* section A - if room in node, add key to node */ /************************************************/ if( CurNode->Leaf.NoOfKeysThisNode < HeadNode.KeysPerNode ) { if(( rc = PutKeyInNode( CurNode,CurNode->CurKeyNo,DbfRec,0L,1)) != 0) return rc; if(( rc = PutHeadNode( &HeadNode, indexfp, 1 )) != 0) return rc; return XB_NO_ERROR; } /***********************************************************************/ /* section B - split leaf node if full and put key in correct position */ /***********************************************************************/ TempNode = GetNodeMemory(); // Create a new page TempNode->NodeNo = GetNextNodeNo(); rc = SplitLeafNode( CurNode, TempNode, CurNode->CurKeyNo, DbfRec ); if( rc ) return rc; /* TempNode is on disk, now we have to point someone above to that node. Keep the NodeNo of the on disk new node. */ TempNodeNo = TempNode->NodeNo; ReleaseNodeMemory( TempNode ); /* PushItem also contains the key to put into the parent PushItem should point at TempNode */ PushItem.Node = TempNodeNo; /*****************************************************/ /* section C go up tree splitting nodes as necessary */ /*****************************************************/ Tparent = CurNode->PrevNode; while( Tparent && Tparent->Leaf.NoOfKeysThisNode >= HeadNode.KeysPerNode ) { TempNode = GetNodeMemory(); if( !TempNode ) #ifdef HAVE_EXCEPTIONS throw xbOutOfMemoryException(); #else return XB_NO_MEMORY; #endif rc = SplitINode( Tparent, TempNode, TempNodeNo ); if( rc ) return rc; TempNodeNo = TempNode->NodeNo; ReleaseNodeMemory( TempNode ); ReleaseNodeMemory( CurNode ); CurNode = Tparent; CurNode->NextNode = NULL; Tparent = CurNode->PrevNode; } /************************************************************/ /* Section D if CurNode is split root, create new root */ /************************************************************/ /* at this point CurNode = The node that was just split TempNodeNo = The new node split off from CurNode */ if(CurNode->NodeNo == HeadNode.StartNode ) { TempNode = GetNodeMemory(); if( !TempNode ) #ifdef HAVE_EXCEPTIONS throw xbOutOfMemoryException(); #else return XB_NO_MEMORY; #endif memcpy( KeyBuf, PushItem.Key, HeadNode.KeyLen ); PutKeyData( 0, TempNode ); PutDbfNo ( 0, TempNode, PushItem.RecordNumber ); PutLeftNodeNo( 0, TempNode, CurNode->NodeNo ); PutLeftNodeNo( 1, TempNode, PushItem.Node ); TempNode->NodeNo = GetNextNodeNo(); TempNode->Leaf.NoOfKeysThisNode++; HeadNode.StartNode = TempNode->NodeNo; rc = PutLeafNode( TempNode->NodeNo, TempNode ); if( rc ) return rc; rc = PutHeadNode( &HeadNode, indexfp, 1 ); if( rc ) return rc; ReleaseNodeMemory( TempNode ); return XB_NO_ERROR; } /**********************************/ /* Section E make room in parent */ /**********************************/ InsertKeyOffset(Tparent->CurKeyNo, Tparent); /* put key in parent */ i = Tparent->CurKeyNo; memcpy( KeyBuf, PushItem.Key, HeadNode.KeyLen); PutKeyData( i, Tparent ); PutDbfNo( i, Tparent, PushItem.RecordNumber); PutLeftNodeNo( i , Tparent, CurNode->NodeNo ); PutLeftNodeNo( i + 1 , Tparent, TempNodeNo ); Tparent->Leaf.NoOfKeysThisNode++; rc = PutLeafNode( Tparent->NodeNo, Tparent ); if( rc ) return rc; rc = PutHeadNode( &HeadNode, indexfp, 1 ); if( rc ) return rc; return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! \param n */ xbShort xbNtx::UpdateParentKey( xbNodeLink * n ) { /* this routine goes backwards thru the node chain looking for a parent node to update */ xbNodeLink * TempNode; if( !n ) return XB_INVALID_NODELINK; if( !GetDbfNo( 0, n )) { cout << "Fatal index error - Not a leaf node" << n->NodeNo << "\n"; // exit(0); return XB_NOT_LEAFNODE; } TempNode = n->PrevNode; while( TempNode ) { if( TempNode->CurKeyNo < TempNode->Leaf.NoOfKeysThisNode ) { memcpy(KeyBuf,GetKeyData(n->Leaf.NoOfKeysThisNode-1,n),HeadNode.KeyLen); PutKeyData( TempNode->CurKeyNo, TempNode ); return PutLeafNode( TempNode->NodeNo, TempNode ); } TempNode = TempNode->PrevNode; } return XB_NO_ERROR; } /***********************************************************************/ //! Short description. /*! \param n */ /* This routine queues up a list of nodes which have been emptied */ void xbNtx::UpdateDeleteList( xbNodeLink *n ) { n->NextNode = DeleteChain; DeleteChain = n; } /***********************************************************************/ //! Short description. /*! */ /* Delete nodes from the node list - for now we leave the empty nodes */ /* dangling in the file. Eventually we will remove nodes from the file */ void xbNtx::ProcessDeleteList( void ) { if( DeleteChain ) { ReleaseNodeMemory( DeleteChain ); DeleteChain = NULL; } } /***********************************************************************/ //! Short description. /*! */ xbShort xbNtx::KeyWasChanged( void ) { CreateKey( 0, 0 ); /* use KeyBuf, RecBuf */ CreateKey( 1, 1 ); /* use KeyBuf2, RecBuf2 */ if( CompareKey( KeyBuf, KeyBuf2, HeadNode.KeyLen ) != 0 ) return 1; else return 0; } // /***********************************************************************/ // xbNodeLink * xbNtx::LeftSiblingHasSpace( xbNodeLink * n ) // { // xbNodeLink * TempNode; // xbNodeLink * SaveCurNode; // /* returns a Nodelink to xbNodeLink n's left sibling if it has space */ // /* if left most node in parent return NULL */ // if( n->PrevNode->CurKeyNo == 0 ) // return NULL; // SaveCurNode = CurNode; // GetLeafNode( GetLeftNodeNo( n->PrevNode->CurKeyNo-1, n->PrevNode ), 2 ); // if( CurNode->Leaf.NoOfKeysThisNode < HeadNode.KeysPerNode ) // { // TempNode = CurNode; // CurNode = SaveCurNode; // TempNode->PrevNode = n->PrevNode; // return TempNode; // } // else /* node is already full */ // { // ReleaseNodeMemory( CurNode ); // CurNode = SaveCurNode; // return NULL; // } //} /***********************************************************************/ // xbNodeLink * xbNtx::RightSiblingHasSpace( xbNodeLink * n ) // { // /* returns a Nodelink to xbNodeLink n's right sibling if it has space */ // xbNodeLink * TempNode; // xbNodeLink * SaveCurNode; // /* if left most node in parent return NULL */ // if( n->PrevNode->CurKeyNo >= n->PrevNode->Leaf.NoOfKeysThisNode ) // return NULL; // SaveCurNode = CurNode; // /* point curnode to right sib*/ // GetLeafNode( GetLeftNodeNo( n->PrevNode->CurKeyNo+1, n->PrevNode ), 2 ); // if( CurNode->Leaf.NoOfKeysThisNode < HeadNode.KeysPerNode ) // { // TempNode = CurNode; // CurNode = SaveCurNode; // TempNode->PrevNode = n->PrevNode; // return TempNode; // } // else /* node is already full */ // { // ReleaseNodeMemory( CurNode ); // CurNode = SaveCurNode; // return NULL; // } // } // /***********************************************************************/ // xbShort xbNtx::MoveToRightNode( xbNodeLink * n, xbNodeLink * Right ) // { // xbShort j; // xbNodeLink * TempNode; // xbNodeLink * SaveCurNode; // xbNodeLink * SaveNodeChain; // if( n->CurKeyNo == 0 ) // { // j = 1; // SaveNodeChain = NodeChain; // SaveCurNode = CurNode; // NodeChain = NULL; // GetLastKey( n->NodeNo, 0 ); // memcpy( KeyBuf, GetKeyData( CurNode->CurKeyNo, CurNode),HeadNode.KeyLen); // ReleaseNodeMemory( NodeChain ); // NodeChain = SaveNodeChain; // CurNode = SaveCurNode; // } // else // { // j = 0; // memcpy( KeyBuf, GetKeyData( j, n ), HeadNode.KeyLen); // } // PutKeyInNode( Right, 0, 0L, GetLeftNodeNo( j, n ), 1 ); // ReleaseNodeMemory( Right ); // TempNode = n; // CurNode = n->PrevNode; // n = n->PrevNode; // n->NextNode = NULL; // UpdateDeleteList( TempNode ); // DeleteSibling( n ); // return XB_NO_ERROR; // } // /***********************************************************************/ // xbShort xbNtx::MoveToLeftNode( xbNodeLink * n, xbNodeLink * Left ) // { // xbShort j, rc; // xbNodeLink * SaveNodeChain; // xbNodeLink * TempNode; // if( n->CurKeyNo == 0 ) // j = 1; // else // j = 0; // /* save the original node chain */ // SaveNodeChain = NodeChain; // NodeChain = NULL; // /* determine new right most key for left node */ // GetLastKey( Left->NodeNo, 0 ); // memcpy( KeyBuf, GetKeyData( CurNode->CurKeyNo, CurNode ), HeadNode.KeyLen); // ReleaseNodeMemory( NodeChain ); // NodeChain = NULL; /* for next GetLastKey */ // PutKeyData( Left->Leaf.NoOfKeysThisNode, Left); // PutLeftNodeNo( Left->Leaf.NoOfKeysThisNode+1, Left, GetLeftNodeNo( j,n )); // Left->Leaf.NoOfKeysThisNode++; // Left->CurKeyNo = Left->Leaf.NoOfKeysThisNode; // if(( rc = PutLeafNode( Left->NodeNo, Left )) != 0 ) return rc; // n->PrevNode->NextNode = NULL; // UpdateDeleteList( n ); // /* get the new right most key for left to update parents */ // GetLastKey( Left->NodeNo, 0 ); // /* assemble the chain */ // TempNode = Left->PrevNode; // TempNode->CurKeyNo--; // NodeChain->PrevNode = Left->PrevNode; // UpdateParentKey( CurNode ); // ReleaseNodeMemory( NodeChain ); // ReleaseNodeMemory( Left ); // CurNode = TempNode; // NodeChain = SaveNodeChain; // TempNode->CurKeyNo++; // DeleteSibling( TempNode ); // return XB_NO_ERROR; // } // /***********************************************************************/ // xbShort xbNtx::DeleteSibling( xbNodeLink * n ) // { // xbNodeLink * Left; // xbNodeLink * Right; // xbNodeLink * SaveCurNode; // xbNodeLink * SaveNodeChain; // xbNodeLink * TempNode; // xbShort rc; // /* this routine deletes sibling CurRecNo out of xbNodeLink n */ // if( n->Leaf.NoOfKeysThisNode > 1 ) // { // RemoveKeyFromNode( n->CurKeyNo, n ); // if( n->CurKeyNo == n->Leaf.NoOfKeysThisNode ) // { // SaveNodeChain = NodeChain; // SaveCurNode = CurNode; // NodeChain = NULL; // GetLastKey( n->NodeNo, 0 ); // /* assemble the node chain */ // TempNode = NodeChain->NextNode; // NodeChain->NextNode = NULL; // ReleaseNodeMemory( NodeChain ); // TempNode->PrevNode = n; // UpdateParentKey( CurNode ); // /* take it back apart */ // ReleaseNodeMemory( TempNode ); // NodeChain = SaveNodeChain; // CurNode = SaveCurNode; // } // } // else if( n->NodeNo == HeadNode.StartNode ) // { // /* get here if root node and only one child remains */ // /* make remaining node the new root */ // if( n->CurKeyNo == 0 ) // HeadNode.StartNode = GetLeftNodeNo( 1, n ); // else // HeadNode.StartNode = GetLeftNodeNo( 0, n ); // UpdateDeleteList( n ); // NodeChain = NULL; // CurNode = NULL; // } // else if (( Left = LeftSiblingHasSpace( n )) != NULL ) // { // return MoveToLeftNode( n, Left ); // } // else if (( Right = RightSiblingHasSpace( n )) != NULL ) // { // return MoveToRightNode( n, Right ); // } // /* else if left sibling exists */ // else if( n->PrevNode->CurKeyNo > 0 ) // { // /* move right branch from left sibling to this node */ // SaveCurNode = CurNode; // SaveNodeChain = NodeChain; // NodeChain = NULL; // GetLeafNode( GetLeftNodeNo( n->PrevNode->CurKeyNo-1, n->PrevNode ), 2 ); // Left = CurNode; // Left->PrevNode = SaveCurNode->PrevNode; // GetLastKey( Left->NodeNo, 0 ); // strncpy( KeyBuf, GetKeyData( CurNode->CurKeyNo,CurNode),HeadNode.KeyLen ); // if( n->CurKeyNo == 1 ) // PutLeftNodeNo( 1, n, GetLeftNodeNo( 0, n )); // PutKeyData( 0, n ); // PutLeftNodeNo( 0, n, GetLeftNodeNo( Left->Leaf.NoOfKeysThisNode, Left )); // if(( rc = PutLeafNode( n->NodeNo, n )) != XB_NO_ERROR ) return rc; // SaveCurNode = n->PrevNode; // SaveCurNode->NextNode = NULL; // ReleaseNodeMemory( n ); // Left->Leaf.NoOfKeysThisNode--; // if(( rc = PutLeafNode( Left->NodeNo, Left )) != XB_NO_ERROR ) return rc; // /* rebuild left side of tree */ // GetLastKey( Left->NodeNo, 0 ); // NodeChain->PrevNode = SaveCurNode; // SaveCurNode->CurKeyNo--; // UpdateParentKey( CurNode ); // ReleaseNodeMemory( NodeChain ); // ReleaseNodeMemory( Left ); // CurNode = SaveCurNode; // NodeChain = SaveNodeChain; // } // /* right sibling must exist */ // else if( n->PrevNode->CurKeyNo <= n->PrevNode->Leaf.NoOfKeysThisNode ) // { // /* move left branch from left sibling to this node */ // SaveCurNode = CurNode; // SaveNodeChain = NodeChain; // NodeChain = NULL; // /* move the left node number one to the left if necessary */ // if( n->CurKeyNo == 0 ) // { // PutLeftNodeNo( 0, n, GetLeftNodeNo( 1, n )); // GetLastKey( GetLeftNodeNo( 0, n ), 0 ); // memcpy(KeyBuf,GetKeyData(CurNode->CurKeyNo,CurNode),HeadNode.KeyLen); // PutKeyData( 0, n ); // ReleaseNodeMemory( NodeChain ); // NodeChain = NULL; // } // GetLeafNode( GetLeftNodeNo( n->PrevNode->CurKeyNo+1, n->PrevNode ), 2 ); // /* put leftmost node number from right node in this node */ // PutLeftNodeNo( 1, n, GetLeftNodeNo( 0, CurNode )); // if(( rc = PutLeafNode( n->NodeNo, n )) != XB_NO_ERROR ) return rc; // /* remove the key from the right node */ // RemoveKeyFromNode( 0, CurNode ); // if(( rc = PutLeafNode( CurNode->NodeNo, CurNode )) != XB_NO_ERROR ) return rc; // ReleaseNodeMemory( CurNode ); // /* update new parent key value */ // GetLastKey( n->NodeNo, 0 ); // NodeChain->PrevNode = n->PrevNode; // UpdateParentKey( CurNode ); // ReleaseNodeMemory( NodeChain ); // NodeChain = SaveNodeChain; // CurNode = SaveCurNode; // } // else // { // /* this should never be true-but could be if 100 byte limit is ignored*/ // cout << "Fatal index error\n"; // exit(0); // } // return XB_NO_ERROR; // } /***********************************************************************/ //! Short description. /*! \param DbfRec */ xbShort xbNtx::DeleteKey( xbLong DbfRec ) { /* this routine assumes the key to be deleted is in KeyBuf */ xbShort rc; // FindKey will set CurNodeNo on evey page down to the // key being deleted. This is important. Plus we // need to be able to find the key to delete it. CurNode = NULL; if(( rc = FindKey( KeyBuf, DbfRec )) != XB_FOUND ) return rc; // Then delete it rc = DeleteKeyFromNode( CurNode->CurKeyNo, CurNode ); CurDbfRec = GetDbfNo( CurNode->CurKeyNo, CurNode ); if(( rc = PutHeadNode( &HeadNode, indexfp, 1 )) != 0 ) return rc; return XB_NO_ERROR; } //! Short description. /*! \param pos \param n */ xbShort xbNtx::DeleteKeyFromNode(xbShort pos, xbNodeLink *n ) { xbNodeLink *TempNode; xbShort rc; // Check to see if this is an inode if (GetLeftNodeNo( 0 , n ) != 0) { // Copy the rightmost key from the left node. TempNode = n; GetLeafNode ( GetLeftNodeNo (n->CurKeyNo, n), 1); while ((rc = GetLeftNodeNo( 0, CurNode )) != 0) { GetLeafNode ( GetLeftNodeNo (CurNode->Leaf.NoOfKeysThisNode, CurNode), 1); } // Get the key Data strcpy (KeyBuf , GetKeyData( CurNode->Leaf.NoOfKeysThisNode -1, CurNode)); PutKeyData( pos, TempNode ); // Get the xbDbf no PutDbfNo (pos, TempNode, GetDbfNo( CurNode->Leaf.NoOfKeysThisNode -1, CurNode) ); // We don't change the LeftNodeNo. determined later // Write the changed node PutLeafNode( TempNode->NodeNo, TempNode ); // Now delete the key from the child TempNode = CurNode; if((rc = PutLeafNode( n->NodeNo,n )) != 0) return rc; return DeleteKeyFromNode( TempNode->Leaf.NoOfKeysThisNode -1, TempNode); } else { return RemoveKeyFromNode(pos, n); } return XB_NO_ERROR; } //! Short description. /*! \param pos \param n */ xbShort xbNtx::RemoveKeyFromNode( xbShort pos, xbNodeLink *n ) { xbNodeLink *TempNode; xbNodeLink *sibling; xbNodeLink *parent; xbShort rc; xbLong newHeadNode = 0; bool harvest = false; // Here we are a leaf node.. if ( n->NodeNo == HeadNode.StartNode && n->Leaf.NoOfKeysThisNode == 1) { // we are about to delete the last node from the head node. newHeadNode = GetLeftNodeNo( 0 , n ); } // Remove the key from the current node. DeleteKeyOffset(pos, n); n->Leaf.NoOfKeysThisNode--; // Check to see if the number of keys left is less then // 1/2 KeysPerNode if ( ! ( n->NodeNo == HeadNode.StartNode ) && n->Leaf.NoOfKeysThisNode < HeadNode.HalfKeysPerNode) { // This observed clipper behavior. // If less then 1/2 keys per node, then merge with right sibling. // If no right sibling, merge with left sibling. parent = n->PrevNode; // If the parents cur key is the last key, then take the left node if (parent->CurKeyNo == parent->Leaf.NoOfKeysThisNode) { TempNode = CurNode; GetLeafNode( GetLeftNodeNo(parent->CurKeyNo -1, parent), 2 ); sibling = CurNode; CurNode = TempNode; rc = JoinSiblings(parent, parent->CurKeyNo -1, sibling, n); // Harvest the empty node, if necessary Clipper keeps the old key // count on the node, to we can't set it to 0 if (rc == XB_HARVEST_NODE) { harvest = true; } if((rc = PutLeafNode( n->NodeNo,n )) != 0) return rc; if((rc = PutLeafNode( sibling->NodeNo,sibling )) != 0) return rc; if((rc = PutLeafNode( parent->NodeNo,parent )) != 0) return rc; if (harvest) { HeadNode.UnusedOffset = n->NodeNo; // Save the empty xbNodeLink // ReleaseNodeMemory(n); // We may have to delete a node from the parent return RemoveKeyFromNode( parent->CurKeyNo, parent); } } else { // Take the right node TempNode = CurNode; GetLeafNode( GetLeftNodeNo(parent->CurKeyNo + 1, parent), 2 ); sibling = CurNode; CurNode = TempNode; rc = JoinSiblings(parent, parent->CurKeyNo, n, sibling); // Harvest the empty node, if necessary Clipper keeps the old key // count on the node, to we can't set it to 0 if (rc == XB_HARVEST_NODE) { harvest = true; } if((rc = PutLeafNode( n->NodeNo,n )) != 0) return rc; if((rc = PutLeafNode( sibling->NodeNo,sibling )) != 0) return rc; if((rc = PutLeafNode( parent->NodeNo,parent )) != 0) return rc; if (harvest) { HeadNode.UnusedOffset = sibling->NodeNo; // Save the empty xbNodeLink ReleaseNodeMemory( sibling ); // Now the parents->CurKeyNo+1 left pointer is empty, and // we are about to delete the parent. So move the left node no // from the parents->CurKeyNo+1 to the parent->CurNodeNo PutLeftNodeNo( parent->CurKeyNo +1 , parent, GetLeftNodeNo( parent->CurKeyNo, parent )); // We may have to delete a node from the parent return RemoveKeyFromNode( parent->CurKeyNo, parent); } } } else { if ( n->NodeNo == HeadNode.StartNode && n->Leaf.NoOfKeysThisNode == 0 ) { // we are about to delete the last node from the head node. HeadNode.UnusedOffset = HeadNode.StartNode; HeadNode.StartNode = newHeadNode; } if((rc = PutLeafNode( n->NodeNo,n )) != 0) return rc; // If more then 1/2 keys per node -> done. return XB_NO_ERROR; } return XB_NO_ERROR; } //! Short description. /*! \param parent \param parentPos \param n1 \param n2 */ xbShort xbNtx::JoinSiblings(xbNodeLink *parent, xbShort parentPos, xbNodeLink *n1, xbNodeLink* n2) { // ASSUMES: keys in n1 are less then keys in n2 // // Here, the contents of n1 need to be merged with n2. If n1 + parent_key // + n2 can all fit in n1, then leave n2 empty, and remove the key from the // parent. // Otherwise evenly distribute the keys from n1 and n2 over both, resetting // the parent. xbShort i, j; // xbLong rightPointerOffset; int totalKeys = 0; int median = 0; // if n1 has exactly (it will never have less) 1/2 keys per node // then put everything into n1. if ( (n1->Leaf.NoOfKeysThisNode + n2->Leaf.NoOfKeysThisNode + 1) <= HeadNode.KeysPerNode) { int n1LastNodeNo = GetLeftNodeNo(n2->Leaf.NoOfKeysThisNode, n2); // Bring down the parent strcpy(KeyBuf, GetKeyData( parentPos, parent )); PutKeyData( n1->Leaf.NoOfKeysThisNode , n1); PutDbfNo ( n1->Leaf.NoOfKeysThisNode, n1, GetDbfNo( parentPos, parent ) ); n1->Leaf.NoOfKeysThisNode++; // Copy over the rest of the keys for (i = n1->Leaf.NoOfKeysThisNode, j = 0; j < n2->Leaf.NoOfKeysThisNode; i++, j++) { strcpy(KeyBuf, GetKeyData( j, n2 )); PutKeyData( i, n1); PutLeftNodeNo( i, n1, GetLeftNodeNo( j, n2) ); PutDbfNo ( i , n1, GetDbfNo( j, n2 ) ); } n1->Leaf.NoOfKeysThisNode += j; PutLeftNodeNo(n1->Leaf.NoOfKeysThisNode, n1, n1LastNodeNo); // We need a way to signal that this node will be harvested. // Clipper keeps the KeyCount on harvested nodes, it does NOT // set them to 0. return XB_HARVEST_NODE; } else { // Distribute the keys evenly. Of off by one, the extra // goes to n1. // If n1 contains the greater than keys, then at this point we // know that n1 has more than 1/2MKPN. therefore we copy // over untill we get to median. All the while removing // keys from n2. Then totalKeys = n1->Leaf.NoOfKeysThisNode + n2->Leaf.NoOfKeysThisNode + 1; median = (int) totalKeys/2; // If n1 has more keys then n2, then we need to copy the last keys // of n1 to the beginning of n2. // Leave HalfKeysPerNode+1 keys in n1, then the last key will // be copied up to the parent. if (n1->Leaf.NoOfKeysThisNode > HeadNode.HalfKeysPerNode) { // Bring down the parent InsertKeyOffset(0, n2); strcpy(KeyBuf, GetKeyData( parentPos, parent )); PutKeyData( 0 , n2); PutDbfNo ( 0, n2, GetDbfNo( parentPos, parent ) ); n2->Leaf.NoOfKeysThisNode++; // PutLeftNodeNo(0, n2, GetLeftNodeNo(n1->Leaf.NoOfKeysThisNode, n1)); for (i = n1->Leaf.NoOfKeysThisNode -1; i > median; i--) { // Put the key in n2 InsertKeyOffset(0, n2); strcpy(KeyBuf, GetKeyData( i, n1 )); PutKeyData( 0, n2); PutLeftNodeNo( 0, n2, GetLeftNodeNo( i, n1) ); PutDbfNo ( 0 , n2, GetDbfNo( i, n1 ) ); // Remove the key from the current node. n1->Leaf.NoOfKeysThisNode--; n2->Leaf.NoOfKeysThisNode++; } // Copy up the last key from n1, that will become the new parent key. strcpy(KeyBuf, GetKeyData( n1->Leaf.NoOfKeysThisNode -1 , n1 )); PutKeyData( parentPos, parent); PutDbfNo ( parentPos , parent, GetDbfNo( n1->Leaf.NoOfKeysThisNode -1, n1) ); n1->Leaf.NoOfKeysThisNode--; } else { xbLong n1LastLeftNodeNo = 0; xbShort medianOffset = n2->Leaf.NoOfKeysThisNode - median -1; // Bring down the parent strcpy(KeyBuf, GetKeyData( parentPos, parent )); PutKeyData( n1->Leaf.NoOfKeysThisNode , n1); PutDbfNo ( n1->Leaf.NoOfKeysThisNode, n1, GetDbfNo( parentPos, parent ) ); n1->Leaf.NoOfKeysThisNode++; n1LastLeftNodeNo = GetLeftNodeNo(medianOffset, n2); PutLeftNodeNo( n1->Leaf.NoOfKeysThisNode, n1, GetLeftNodeNo(medianOffset, n2)); // Moving the median to the parent may have to occur // before moving the other keys to n1. This we would have // to calcualte the correct offset from the median // Copy up the first key from n2 (the median), // that will become the new parent key. strcpy(KeyBuf, GetKeyData( medianOffset, n2 )); PutKeyData( parentPos, parent); PutDbfNo ( parentPos , parent, GetDbfNo(medianOffset, n2 ) ); n1LastLeftNodeNo = GetLeftNodeNo(medianOffset, n2); // Still investigating the -1 thing with clipper, If anyone has clues, // please let me know - bob@synxis.com // if ( n1->Leaf.NoOfKeysThisNode >= (median - 1)) // { // // Clipper, don't know why // PutLeftNodeNo(0, n2 , -1 ); // cout << "Clipper hack" << endl; // } DeleteKeyOffset(medianOffset, n2); n2->Leaf.NoOfKeysThisNode--; // xbShort clipperMessedUpIndex = n1->Leaf.NoOfKeysThisNode; for (i = n1->Leaf.NoOfKeysThisNode, j = 0; j < medianOffset; i++, j++) { strcpy(KeyBuf, GetKeyData( 0, n2 )); PutKeyData( i, n1); PutLeftNodeNo( i, n1, GetLeftNodeNo( 0, n2) ); PutDbfNo ( i , n1, GetDbfNo( 0, n2 ) ); // if ( i == clipperMessedUpIndex) // { // // Clipper, don't know why // PutLeftNodeNo(0, n2 , -1 ); // cout << "Clipper hack in loop i = " << i << endl; // } // Remove the key from the current node. DeleteKeyOffset(0, n2); n2->Leaf.NoOfKeysThisNode--; n1->Leaf.NoOfKeysThisNode++; } PutLeftNodeNo(n1->Leaf.NoOfKeysThisNode, n1, n1LastLeftNodeNo); } } return XB_NO_ERROR; } /************************************************************************/ //! Short description. /*! \param option */ #ifdef XBASE_DEBUG xbShort xbNtx::CheckIndexIntegrity( const xbShort option ) { /* if option = 1, print out some stats */ xbShort rc; xbLong ctr = 1L; if ( option ) cout << "Checking NTX " << IndexName << endl; rc = dbf->GetRecord( ctr ); while( ctr < dbf->NoOfRecords() ) { ctr++; if( option ) cout << "\nChecking Record " << ctr; if(!dbf->RecordDeleted()) { CreateKey( 0, 0 ); rc = FindKey( KeyBuf, dbf->GetCurRecNo()); if( rc != XB_FOUND ) { if( option ) { cout << "\nRecord number " << dbf->GetCurRecNo() << " Not Found\n"; cout << "Key = " << KeyBuf << "\n"; } return rc; } } if(( rc = dbf->GetRecord( ctr )) != XB_NO_ERROR ) return rc; } if( option ) { cout << "Exiting with rc = " << rc << "\n"; cout << "\nTotal records checked = " << ctr << "\n"; } return XB_NO_ERROR; } #endif /***********************************************************************/ //! Short description. /*! \param statusFunc */ xbShort xbNtx::ReIndex(void (*statusFunc)(xbLong itemNum, xbLong numItems)) { /* this method assumes the index has been locked in exclusive mode */ xbLong l; xbShort rc, i, NameLen, saveAutoLock; NtxHeadNode TempHead; FILE *t, *temp; xbString TempName; memcpy( &TempHead, &HeadNode, sizeof( struct NtxHeadNode )); TempHead.StartNode = 1024L; if(( rc = dbf->xbase->DirectoryExistsInName( IndexName )) > 0 ) NameLen = rc + 13; else NameLen = 13; if (rc) { TempName.assign(IndexName, 0, rc); TempName += "TEMPFILE.NTX"; } else TempName = "TEMPFILE.NTX"; if(( t = fopen( TempName, "w+b" )) == NULL ) return XB_OPEN_ERROR; if(( rc = PutHeadNode( &TempHead, t, 0 )) != 0 ) { fclose( t ); remove( TempName ); return rc; } for( i = 0; i < XB_NTX_NODE_SIZE; i++ ) { if(( fwrite( "\x00", 1, 1, t )) != 1 ) { fclose( t ); remove( TempName ); xb_io_error( XB_WRITE_ERROR, TempName ); } } temp = indexfp; indexfp = t; if ((rc = GetLeafNode(TempHead.StartNode, 1)) != 0) return rc; for (i = 0; i < TempHead.KeysPerNode; i++) { CurNode->offsets[i] = (i * HeadNode.KeySize) + 2 + (2 * (HeadNode.KeysPerNode + 1)); } if ((rc = PutLeafNode(TempHead.StartNode, CurNode )) != 0) return rc; indexfp = temp; if( fclose( indexfp ) != 0 ) xb_io_error( XB_CLOSE_ERROR, IndexName); if( fclose( t ) != 0 ) xb_io_error( XB_CLOSE_ERROR, TempName ); if( remove( IndexName ) != 0 ) xb_io_error( XB_CLOSE_ERROR, IndexName ); if( rename( TempName, IndexName ) != 0 ) xb_io_error( XB_WRITE_ERROR, IndexName ); if(( indexfp = fopen( IndexName, "r+b" )) == NULL ) xb_open_error( IndexName ); saveAutoLock = dbf->GetAutoLock(); dbf->AutoLockOff(); for( l = 1; l <= dbf->NoOfRecords(); l++ ) { if(statusFunc) statusFunc(l, dbf->NoOfRecords()); if(( rc = dbf->GetRecord(l)) != XB_NO_ERROR ) return rc; if(!dbf->GetRealDelete() || !dbf->RecordDeleted()) { /* Create the key */ CreateKey( 0, 0 ); /* add key to index */ if(( rc = AddKey( l )) != XB_NO_ERROR ) return rc; } } if(saveAutoLock) dbf->AutoLockOn(); return XB_NO_ERROR; } //! Short description. /*! */ xbLong xbNtx::GetNextNodeNo() { struct stat FileStat; int rc; xbULong FileSize; if(HeadNode.UnusedOffset != 0) { FileSize = HeadNode.UnusedOffset; HeadNode.UnusedOffset = 0; PutHeadNode(&HeadNode, indexfp, 1); return FileSize; } rc = fstat(fileno(indexfp), &FileStat); if (rc != 0) { return 0; } FileSize = (xbULong)FileStat.st_size; // File offset is zero based, so the file size will be the // offset of the next page. return FileSize; } //! Short description. /*! \param buf \param len */ void xbNtx::GetExpression(char *buf, int len) { memcpy(buf, HeadNode.KeyExpression, len < 256 ? len : 256); } #endif /* XB_INDEX_NTX */ xbase-2.0.0/xbase/xbfilter.cpp0000644000000000000000000001154407203043261011671 /* $Id: xbfilter.cpp Xbase project source code This file conatains a header file for the xbStack object which is used for handling expressions. Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.8.x 3/29/99 - Initial support for filters added */ #ifdef __GNUG__ #pragma implementation "xbfilter.h" #endif #ifdef __WIN32__ #include #else #include #endif #include #include /*! \file xbfilter.cpp */ #ifdef XB_FILTERS /************************************************************************/ //! Short description. /*! \param dbf \param index \param exp */ xbFilter::xbFilter( xbDbf * dbf, xbIndex * index, char * exp ) { xbShort rc; Status = 0; CurFilterRecNo = 0L; d = dbf; i = index; if(( rc = d->xbase->ParseExpression( exp, d )) != XB_NO_ERROR ) Status = rc; else{ e = d->xbase->GetExpressionHandle(); if( d->xbase->GetExpressionResultType( e ) != 'L' ) Status = XB_PARSE_ERROR; } } /***********************************************************************/ //! Short description. /*! */ xbShort xbFilter::GetFirstFilterRec() { xbShort rc; if( Status ) return Status; if( i ) rc = i->GetFirstKey(); else rc = d->GetFirstRecord(); while( rc == XB_NO_ERROR ){ if(( rc = d->xbase->ProcessExpression( e )) != XB_NO_ERROR ) xb_error( rc ); cout << "xbfilter fixme" << endl; // if( d->xbase->GetInt()){ CurFilterRecNo = d->GetCurRecNo(); return XB_NO_ERROR; // } if( i ) rc = i->GetNextKey(); else rc = d->GetNextRecord(); } return rc; } /***********************************************************************/ //! Short description. /*! */ xbShort xbFilter::GetLastFilterRec() { xbShort rc; if( Status ) return Status; if( i ) rc = i->GetLastKey(); else rc = d->GetPrevRecord(); while( rc == XB_NO_ERROR ){ if(( rc = d->xbase->ProcessExpression( e )) != XB_NO_ERROR ) xb_error( rc ); cout << "xbfilter fixme" << endl; // if( d->xbase->GetInt()){ CurFilterRecNo = d->GetCurRecNo(); return XB_NO_ERROR; // } if( i ) rc = i->GetPrevKey(); else rc = d->GetPrevRecord(); } return rc; } /***********************************************************************/ //! Short description. /*! */ xbShort xbFilter::GetNextFilterRec() { xbShort rc; if( Status ) return Status; if( !CurFilterRecNo ) return GetFirstFilterRec(); if( i ){ rc = i->GetNextKey(); } else rc = d->GetNextRecord(); while( rc == XB_NO_ERROR ){ if(( rc = d->xbase->ProcessExpression( e )) != XB_NO_ERROR ) xb_error( rc ); cout << "xbfilter fix me" << endl; // if( d->xbase->GetInt()){ CurFilterRecNo = d->GetCurRecNo(); return XB_NO_ERROR; // } if( i ) rc = i->GetNextKey(); else rc = d->GetNextRecord(); } return rc; } /***********************************************************************/ //! Short description. /*! */ xbShort xbFilter::GetPrevFilterRec() { xbShort rc; if( Status ) return Status; if( !CurFilterRecNo ) return GetLastFilterRec(); if( i ){ rc = i->GetPrevKey(); } else rc = d->GetPrevRecord(); while( rc == XB_NO_ERROR ){ if(( rc = d->xbase->ProcessExpression( e )) != XB_NO_ERROR ) xb_error( rc ); cout << "xbfilter fix me" << endl; // if( d->xbase->GetInt()){ CurFilterRecNo = d->GetCurRecNo(); return XB_NO_ERROR; // } if( i ) rc = i->GetPrevKey(); else rc = d->GetPrevRecord(); } return rc; } /***********************************************************************/ #endif // XB_FILTERS_ON xbase-2.0.0/xbase/dbf.h0000644000000000000000000004057207230134245010260 /* $Id: dbf.h,v 1.8 2001/01/13 20:20:53 dbryson Exp $ Xbase project source code This file contains the Class definition for a xbDBF object. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.3 11/30/97 - Added memo field processing V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.4d 10/28/98 - Added support for OS2/DOS/Win/NT locking V 1.8 11/29/98 - New class names and types V 1.9.2 9/14/99 - Updated EOR and EOF processing */ #ifndef __XB_DBF_H__ #define __XB_DBF_H__ #ifdef __GNUG__ #pragma interface #endif #ifdef __WIN32__ #include #else #include #endif #include #include #include #include /*! \file dbf.h */ #if defined(XB_INDEX_ANY) class XBDLLEXPORT xbIndex; class XBDLLEXPORT xbNdx; class XBDLLEXPORT xbNtx; #endif /*****************************/ /* Field Types */ #define XB_CHAR_FLD 'C' #define XB_LOGICAL_FLD 'L' #define XB_NUMERIC_FLD 'N' #define XB_DATE_FLD 'D' #define XB_MEMO_FLD 'M' #define XB_FLOAT_FLD 'F' /*****************************/ /* File Status Codes */ #define XB_CLOSED 0 #define XB_OPEN 1 #define XB_UPDATED 2 /*****************************/ /* Other defines */ #define XB_OVERLAY 1 #define XB_DONTOVERLAY 0 #define XB_CHAREOF '\x1A' /* end of DBF */ #define XB_CHARHDR '\x0D' /* header terminator */ //! Used to define the fields in a database (DBF file). /*! Generally one would define an xbSchema array to be passed to xbDbf::CreateDatabase() to define the fields in the database. For example, one might create a declaration as follows: \code xbSchema MyRecord[] = { { "FIRSTNAME", XB_CHAR_FLD, 15, 0 }, { "LASTNAME", XB_CHAR_FLD, 20, 0 }, { "BIRTHDATE", XB_DATE_FLD, 8, 0 }, { "AMOUNT", XB_NUMERIC_FLD, 9, 2 }, { "SWITCH", XB_LOGICAL_FLD, 1, 0 }, { "FLOAT1", XB_FLOAT_FLD, 9, 2 }, { "FLOAT2", XB_FLOAT_FLD, 9, 1 }, { "FLOAT3", XB_FLOAT_FLD, 9, 2 }, { "FLOAT4", XB_FLOAT_FLD, 9, 3 }, { "MEMO1", XB_MEMO_FLD, 10, 0 }, { "ZIPCODE", XB_NUMERIC_FLD, 5, 0 }, { "",0,0,0 } }; \endcode Note that the last xbSchema in an array must be a "null" entry like the one above: \code { "",0,0,0 } \endcode To indicate the end of the array. */ struct XBDLLEXPORT xbSchema { char FieldName[11]; char Type; // xbUShort FieldLen; /* does not work */ // xbUShort NoOfDecs; /* does not work */ unsigned char FieldLen; /* fields are stored as one byte on record*/ unsigned char NoOfDecs; }; //! Defines a field in an XBase file header (DBF file header) /*! This structure is only used internally by the xbDbf class. */ struct XBDLLEXPORT xbSchemaRec { char FieldName[11]; char Type; /* field type */ char *Address; /* pointer to field in record buffer 1 */ // xbUShort FieldLen; /* does not work */ // xbUShort NoOfDecs; /* does not work */ unsigned char FieldLen; /* fields are stored as one byte on record */ unsigned char NoOfDecs; char *Address2; /* pointer to field in record buffer 2 */ char *fp; /* pointer to null terminated buffer for field */ /* see method GetString */ xbShort LongFieldLen; /* to handle long field lengths */ }; //! xbIxList struct /*! Internal use only. */ struct XBDLLEXPORT xbIxList { xbIxList * NextIx; xbString IxName; #if defined(XB_INDEX_ANY) xbIndex * index; xbShort Unique; xbShort KeyUpdated; #endif }; //! xbMH struct /*! Internal use only. */ #ifdef XB_MEMO_FIELDS struct XBDLLEXPORT xbMH{ /* memo header */ xbLong NextBlock; /* pointer to next block to write */ char FileName[8]; /* name of dbt file */ char Version; /* not sure */ xbShort BlockSize; /* memo file block size */ }; #endif //! xbDbf class /*! The xbDbf class encapsulates an xbase DBF database file. It includes all dbf access, field access, and locking methods. */ class XBDLLEXPORT xbDbf { public: xbDbf( xbXBase * ); xbXBase *xbase; /* linkage to main base class */ // char EofChar[10]; /* datafile methods */ #if defined(XB_INDEX_ANY) xbShort AddIndexToIxList(xbIndex *, const char *IndexName); xbShort RemoveIndexFromIxList( xbIndex * ); #endif xbShort AppendRecord( void ); xbShort BlankRecord( void ); xbLong CalcCheckSum( void ); xbShort CloseDatabase(bool deleteIndexes = 0); xbShort CopyDbfStructure( const char *, xbShort ); xbShort CreateDatabase( const char * Name, xbSchema *, const xbShort Overlay ); //! Return the current position in the dbf file /*! */ xbLong DbfTell( void ) { return ftell( fp ); } //! Delete all records /*! */ xbShort DeleteAllRecords( void ) { return DeleteAll(0); } xbShort DeleteRecord( void ); #ifdef XBASE_DEBUG xbShort DumpHeader( xbShort ); #endif xbShort DumpRecord( xbULong ); //! Return number of fields /*! */ xbLong FieldCount( void ) { return NoOfFields; } //! Return Dbf name /*! */ xbString& GetDbfName( void ) { return DatabaseName; } //! Return status /*! */ xbShort GetDbfStatus( void ) { return DbfStatus; } xbShort GetFirstRecord( void ); xbShort GetLastRecord( void ); xbShort GetNextRecord( void ); xbShort GetPrevRecord( void ); //! Return current record number /*! */ xbLong GetCurRecNo( void ) { return CurRec; } xbShort GetRecord( xbULong ); //! Return a pointer to the record buffer /*! */ char * GetRecordBuf( void ) { return RecBuf; } //! Return record length /*! */ xbShort GetRecordLen( void ) { return RecordLen; } xbShort NameSuffixMissing( xbShort, const char * ); xbLong NoOfRecords( void ); xbLong PhysicalNoOfRecords(void); xbShort OpenDatabase( const char * ); xbShort PackDatabase(xbShort LockWaitOption, void (*packStatusFunc)(xbLong itemNum, xbLong numItems) = 0, void (*indexStatusFunc)(xbLong itemNum, xbLong numItems) = 0); xbShort PutRecord(void); // Put record to current position xbShort PutRecord(xbULong); xbShort RebuildAllIndices(void (*statusFunc)(xbLong itemNum, xbLong numItems) = 0); xbShort RecordDeleted( void ); //! Set number of records to zero???? /*! */ void ResetNoOfRecs( void ) { NoOfRecs = 0L; } xbShort SetVersion( xbShort ); //! Undelete all records /*! */ xbShort UndeleteAllRecords( void ) { return DeleteAll(1); } xbShort UndeleteRecord( void ); xbShort Zap( xbShort ); /* field methods */ const char *GetField(xbShort FieldNo) const; // Using internal static buffer const char *GetField(const char *Name) const; xbShort GetField( xbShort FieldNo, char *Buf) const; xbShort GetRawField(const xbShort FieldNo, char *Buf) const; xbShort GetField( xbShort FieldNo, char *Buf, xbShort RecBufSw) const; xbShort GetField( const char *Name, char *Buf) const; xbShort GetRawField(const char *Name, char *Buf) const; xbShort GetField( const char *Name, char *Buf, xbShort RecBufSw) const; xbShort GetField(xbShort FieldNo, xbString&, xbShort RecBufSw ) const; xbShort GetFieldDecimal( const xbShort ); xbShort GetFieldLen( const xbShort ); char * GetFieldName( const xbShort ); xbShort GetFieldNo( const char * FieldName ) const; char GetFieldType( const xbShort FieldNo ) const; xbShort GetLogicalField( const xbShort FieldNo ); xbShort GetLogicalField( const char * FieldName ); char * GetStringField( const xbShort FieldNo ); char * GetStringField( const char * FieldName ); xbShort PutField( const xbShort, const char * ); xbShort PutRawField( const xbShort FieldNo, const char *buf ); xbShort PutField( const char *Name, const char *buf); xbShort PutRawField( const char *Name, const char *buf ); xbShort ValidLogicalData( const char * ); xbShort ValidNumericData( const char * ); xbLong GetLongField( const char *FieldName) const; xbLong GetLongField( const xbShort FieldNo) const; xbShort PutLongField( const xbShort, const xbLong ); xbShort PutLongField( const char *, const xbLong); xbFloat GetFloatField( const char * FieldName ); xbFloat GetFloatField( const xbShort FieldNo ); xbShort PutFloatField( const char *, const xbFloat); xbShort PutFloatField( const xbShort, const xbFloat); xbDouble GetDoubleField(const char *); xbDouble GetDoubleField(const xbShort, xbShort RecBufSw = 0); xbShort PutDoubleField(const char *, const xbDouble); xbShort PutDoubleField(const xbShort, const xbDouble); #ifdef XB_LOCKING_ON xbShort LockDatabase( const xbShort, const xbShort, const xbULong ); xbShort ExclusiveLock( const xbShort ); xbShort ExclusiveUnlock( void ); #ifndef HAVE_FCNTL xbShort UnixToDosLockCommand( const xbShort WaitOption, const xbShort LockType ) const; #endif #else xbShort LockDatabase( const xbShort, const xbShort, const xbLong ) { return XB_NO_ERROR; } xbShort ExclusiveLock( const xbShort ) { return XB_NO_ERROR; }; xbShort ExclusiveUnlock( void ) { return XB_NO_ERROR; }; #endif //! Turn autolock on /*! */ void AutoLockOn( void ) { AutoLock = 1; } //! Turn autolock off /*! */ void AutoLockOff( void ) { AutoLock = 0; } //! Return whether or not autolocking is on or off /*! */ xbShort GetAutoLock(void) { return AutoLock; } #ifdef XB_MEMO_FIELDS xbShort GetMemoField( const xbShort FieldNo,const xbLong len, char * Buf, const xbShort LockOption ); xbLong GetMemoFieldLen( const xbShort FieldNo ); xbShort UpdateMemoData( const xbShort FieldNo, const xbLong len, const char * Buf, const xbShort LockOption ); xbShort MemoFieldExists( const xbShort FieldNo ) const; xbShort LockMemoFile( const xbShort WaitOption, const xbShort LockType ); xbShort MemoFieldsPresent( void ) const; xbLong CalcLastDataBlock(); xbShort FindBlockSetInChain( const xbLong BlocksNeeded, const xbLong LastDataBlock, xbLong & Location, xbLong &PreviousNode ); xbShort GetBlockSetFromChain( const xbLong BlocksNeeded, const xbLong Location, const xbLong PreviousNode ); #ifdef XBASE_DEBUG xbShort DumpMemoFreeChain( void ); void DumpMemoHeader( void ) const; void DumpMemoBlock( void ) const; #endif #endif //! Turn on "real" deletes /*! This should be done before creating a database (with xbDbf::CreateDatatabase()) and thereafter before opening a database with xbDbfCreateDatabase(). You cannot "turn on" real deletes once a database has been created and records added. */ void RealDeleteOn(void) { RealDelete = 1; if(fp) ReadHeader(1); } /*! Turn off "real" deletes */ void RealDeleteOff(void) { RealDelete = 0; if(fp) ReadHeader(1); } //! Return whether "real" deletes are on or off /*! Use this to determine if "real deletes" are being used with the database. */ xbShort GetRealDelete(void) { return RealDelete; } #if defined(XB_INDEX_ANY) xbShort IndexCount(void); xbIndex *GetIndex(xbShort indexNum); #endif protected: xbString DatabaseName; xbShort XFV; /* xBASE file version */ xbShort NoOfFields; char DbfStatus; /* 0 = closed 1 = open 2 = updates pending */ FILE *fp; /* file pointer */ xbSchemaRec *SchemaPtr; /* Pointer to field data */ char *RecBuf; /* Pointer to record buffer */ char *RecBuf2; /* Pointer to original rec buf */ #ifdef XB_MEMO_FIELDS FILE *mfp; /* memo file pointer */ void *mbb; /* memo block buffer */ xbMH MemoHeader; /* memo header structure */ xbShort mfield1; /* memo block field one FF */ xbShort MStartPos; /* memo start pos of data */ xbLong MFieldLen; /* memo length of data */ xbLong NextFreeBlock; /* next free block in free chain */ xbLong FreeBlockCnt; /* count of free blocks this set */ xbLong MNextBlockNo; /* free block chain */ xbLong MNoOfFreeBlocks; /* free block chain */ xbLong CurMemoBlockNo; /* Current block no loaded */ #endif /* Next seven variables are read directly off the database header */ /* Don't change the order of the following seven items */ char Version; char UpdateYY; char UpdateMM; char UpdateDD; // xbLong NoOfRecs; // xbShort HeaderLen; // xbShort RecordLen; xbULong NoOfRecs; xbUShort HeaderLen; xbUShort RecordLen; //#ifdef XB_REAL_DELETE xbULong FirstFreeRec; xbULong RealNumRecs; //#endif xbIxList * MdxList; xbIxList * NdxList; xbIxList * FreeIxList; xbULong CurRec; /* Current record or zero */ xbShort AutoLock; /* Auto update option 0 = off */ //#ifdef XB_REAL_DELETE xbShort RealDelete; /* real delete option 0 = off */ //#endif #ifdef XB_LOCKING_ON xbShort CurLockType; /* current type of file lock */ xbShort CurLockCount; /* number of current file locks */ xbULong CurLockedRecNo; /* currently locked record no */ xbShort CurRecLockType; /* current type of rec lock held (F_RDLOCK or F_WRLCK) */ xbShort CurRecLockCount; /* number of current record locks */ xbShort CurMemoLockType; /* current type of memo lock */ xbShort CurMemoLockCount; /* number of current memo locks */ #endif xbShort DeleteAll( xbShort ); void InitVars( void ); xbShort PackDatafiles(void (*statusFunc)(xbLong itemNum, xbLong numItems) = 0); xbShort ReadHeader( xbShort ); xbShort WriteHeader( const xbShort ); #ifdef XB_MEMO_FIELDS xbShort AddMemoData( const xbShort FieldNo, const xbLong Len, const char * Buf ); xbShort CreateMemoFile( void ); xbShort DeleteMemoField( const xbShort FieldNo ); xbShort GetDbtHeader( const xbShort Option ); xbShort GetMemoBlockSize( void ) { return MemoHeader.BlockSize; } xbShort OpenMemoFile( void ); xbShort PutMemoData( const xbLong StartBlock, const xbLong BlocksNeeded, const xbLong Len, const char * Buf ); xbShort ReadMemoBlock( const xbLong BlockNo, const xbShort Option); xbShort SetMemoBlockSize( const xbShort ); xbShort UpdateHeadNextNode( void ) const; xbShort WriteMemoBlock( const xbLong BlockNo, const xbShort Option ); xbShort IsType3Dbt( void ) const { return( Version==(char)0x83 ? 1:0 ); } xbShort IsType4Dbt( void ) const {return (( Version==(char)0x8B || Version==(char)0x8E ) ? 1:0 );} #endif }; #endif // __XB_DBF_H__ xbase-2.0.0/xbase/exp.h0000644000000000000000000002327707203043261010321 /* $Id: exp.h,v 1.6 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains a header file for the EXP object, which is used for expression processing. Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.1 5/25/98 - Expression support enhancements */ #ifndef __XB_EXP_H__ #define __XB_EXP_H__ #ifdef __GNUG__ #pragma interface #endif #include #ifdef XB_EXPRESSIONS /* compile if expression logic on */ #define XB_EXPRESSION xbExpNode #include #include /*! \file exp.h */ #undef ABS #undef MIN #undef MAX class XBDLLEXPORT xbDbf; //! xbFuncDtl struct /*! */ struct XBDLLEXPORT xbFuncDtl { const char * FuncName; /* function name */ xbShort ParmCnt; /* no of parms it needs */ char ReturnType; /* return type of function */ void (*ExpFuncPtr)(); /* pointer to function routine */ }; //! xbExpNode struct /*! */ class XBDLLEXPORT xbExpNode { public: char * NodeText; /* expression text */ char Type; /* same as TokenType below */ xbShort Len; /* length of expression text */ xbShort InTree; /* this node in the tree? 1=yes */ xbExpNode * Node; /* pointer to parent */ xbExpNode * Sibling1; /* pointer to sibling 1 */ xbExpNode * Sibling2; /* pointer to sibling 2 */ xbExpNode * Sibling3; /* pointer to sibling 3 */ xbShort DataLen; /* length of data in result buffer */ xbShort ResultLen; /* length of result buffer */ // char * Result; /* result buffer - ptr to result */ xbString StringResult; xbDouble DoubResult; /* Numeric Result */ xbShort IntResult; /* logical result */ xbDbf * dbf; /* pointer to datafile */ xbShort FieldNo; /* field no if DBF field */ char ExpressionType; /* used in head node C,N,L or D */ public: xbExpNode() : NodeText(0), Type(0), Len(0), InTree(0), Node(0), Sibling1(0), Sibling2(0), Sibling3(0), DataLen(0), ResultLen(0), DoubResult(0), IntResult(0), dbf(0), FieldNo(-1), ExpressionType(0) {} ~xbExpNode(){ if( Sibling1 ) delete Sibling1; if( Sibling2 ) delete Sibling2; if( Sibling3 ) delete Sibling3; } }; //! xbExpn class /*! */ /* Expression handler */ class XBDLLEXPORT xbExpn : public xbStack, public xbDate { public: xbShort ProcessExpression( xbExpNode *, xbShort ); xbExpNode * GetTree( void ) { return Tree; } void SetTreeToNull( void ) { Tree = NULL; } xbExpNode * GetFirstTreeNode( xbExpNode * ); xbExpn( void ); xbShort GetNextToken( const char *s, xbShort MaxLen); /* expression methods */ xbDouble ABS( xbDouble ); xbLong ASC( const char * ); xbLong AT( const char *, const char * ); char * CDOW( const char * ); char * CHR( xbLong ); char * CMONTH( const char * ); char * DATE(); xbLong DAY( const char * ); xbLong DESCEND( const char * ); xbLong DOW( const char * ); char * DTOC( const char * ); char * DTOS( const char * ); xbDouble EXP( xbDouble ); xbLong INT( xbDouble ); xbLong ISALPHA( const char * ); xbLong ISLOWER( const char * ); xbLong ISUPPER( const char * ); char * LEFT( const char *, xbShort ); xbLong LEN( const char * ); xbDouble LOG( xbDouble ); char * LOWER( const char * ); char * LTRIM( const char * ); xbDouble MAX( xbDouble, xbDouble ); xbLong MONTH( const char * ); /* MONTH() */ xbDouble MIN( xbDouble, xbDouble ); char * RECNO( xbULong ); xbLong RECNO( xbDbf * ); char * REPLICATE( const char *, xbShort ); char * RIGHT( const char *, xbShort ); char * RTRIM( const char * ); char * SPACE( xbShort ); xbDouble SQRT( xbDouble ); char * STR( const char * ); char * STR( const char *, xbShort ); char * STR( const char *, xbShort, xbShort ); char * STR( xbDouble ); char * STR( xbDouble, xbShort ); char * STR(xbDouble, xbUShort length, xbShort numDecimals ); char * STRZERO( const char * ); char * STRZERO( const char *, xbShort ); char * STRZERO( const char *, xbShort, xbShort ); char * STRZERO( xbDouble ); char * STRZERO( xbDouble, xbShort ); char * STRZERO( xbDouble, xbShort, xbShort ); char * SUBSTR( const char *, xbShort, xbShort ); char * TRIM( const char * ); char * UPPER( const char * ); xbLong VAL( const char * ); xbLong YEAR( const char * ); //! Short description. /*! \param f */ void SetDefaultDateFormat(const xbString f){ DefaultDateFormat = f; } xbString GetDefaultDateFormat() const { return DefaultDateFormat; } xbShort ProcessExpression( const char *exp, xbDbf * d ); xbShort ParseExpression( const char *exp, xbDbf * d ); XB_EXPRESSION * GetExpressionHandle(); char GetExpressionResultType(XB_EXPRESSION * ); char * GetCharResult(); xbString & GetStringResult(); xbDouble GetDoubleResult(); xbLong GetIntResult(); xbShort ProcessExpression( xbExpNode * ); xbShort BuildExpressionTree( const char * Expression, xbShort MaxTokenLen, xbDbf *d ); #ifdef XBASE_DEBUG void DumpExpressionTree( xbExpNode * ); void DumpExpNode( xbExpNode * ); #endif protected: xbFuncDtl *XbaseFuncList; /* pointer to list of Xbase functions */ // xbExpNode *NextFreeExpNode; /* pointer to chain of free nodes */ xbExpNode *Tree; xbShort LogicalType; /* set to 1 for logical type nodes */ char TokenType; /* E - Expression, not in simplest form */ /* C - Constant */ /* N - Numeric Constant */ /* O - Operator */ /* F - Function */ /* D - Database Field */ /* s - character string result */ /* l - logical or short int result */ /* d - double result */ char PreviousType; /* used to see if "-" follows operator */ char * Op1; /* pointer to operand 1 */ char * Op2; /* pointer to operand 2 */ xbDouble Opd1; /* double result 1 */ xbDouble Opd2; /* double result 2 */ xbShort OpLen1; /* length of memory allocated to operand 1 */ xbShort OpLen2; /* length of memory allocated to operand 2 */ xbShort OpDataLen1; /* length of data in op1 */ xbShort OpDataLen2; /* length of data in op2 */ char OpType1; /* type of operand 1 */ char OpType2; /* type of operand 2 */ xbShort TokenLen; /* length of token */ static xbString DefaultDateFormat; /*default date format for DTOC func*/ enum { WorkBufMaxLen = 200 }; char WorkBuf[WorkBufMaxLen+1]; xbShort IsWhiteSpace( char ); char IsSeparator( char ); xbExpNode * LoadExpNode( const char * ENodeText, const char EType, const xbShort ELen, const xbShort BufLen ); xbShort OperatorWeight( const char *Oper, xbShort len ); xbShort ReduceComplexExpression( const char * NextToken, xbShort Len, xbExpNode * cn, xbDbf *d ); xbShort GetFunctionTokenLen( const char *s ); xbShort ReduceFunction( const char *NextToken, xbExpNode *cn, xbDbf *d ); xbExpNode * GetNextTreeNode( xbExpNode * ); xbShort ProcessOperator( xbShort ); xbShort ProcessFunction( char * ); xbShort ValidOperation( char *, char, char ); char GetOperandType( xbExpNode * ); xbShort AlphaOperation( char * ); xbShort NumericOperation( char * ); xbExpNode * GetExpNode( xbShort ); xbShort GetFuncInfo( const char *Function, xbShort Option ); xbDouble GetDoub( xbExpNode * ); xbLong GetInt( xbExpNode * ); }; #endif // XB_EXPRESSIONS #endif // __XB_EXP_H__ xbase-2.0.0/xbase/html.h0000644000000000000000000001161507203043261010462 /* $Id: html.h,v 1.7 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains a header file for the HTML object which is used for HTML generation. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.4c 10/26/98 - Added GenFormFields, SetCookie, GetCookie V 1.8 11/29/98 - Version 1.8 upgrade */ #ifndef __XB_HTML_H__ #define __XB_HTML_H__ #ifdef __GNUG__ #pragma interface #endif #ifdef __WIN32__ #include #else #include #endif #include #include #include /*! \file html.h */ //! xbFieldList struct /*! */ struct xbFieldList{ char * Label; /* field label on form */ char * FieldName; /* form field name */ xbShort FieldLen; /* form display length */ xbShort FieldNo; /* database field no */ xbShort Option; /* field option */ }; typedef char **xbArrayPtr; //! xbHtml class /*! */ class XBDLLEXPORT xbHtml { public: xbHtml ( void ); //! Short description. /*! */ void BoldOff( void ) { cout << "\n"; }; //! Short description. /*! */ void BoldOn( void ) { cout << ""; }; //! Short description. /*! */ void Bullet( void ) { cout << "

  • "; }; void DumpArray( void ); //! Short description. /*! */ void EmphasizeOff( void ) { cout << "\n"; }; //! Short description. /*! */ void EmphasizeOn( void ) { cout << ""; }; //! Short description. /*! */ void EndHtmlPage( void ) { cout << "\n\n"; } xbShort GenFormFields(xbDbf *d, xbShort Option,const char * Title,xbFieldList *fl); xbShort GetArrayNo( const char * FieldName ); const char * GetCookie( const char *CookieName ); char * GetData( xbShort ); char * GetDataForField( const char *FieldName ); char * GetEnv( char * s ){ return getenv( s ); } xbShort GetMethod( void ); //! Short description. /*! */ void HeaderOff( xbShort i ){ cout << "\n"; }; //! Short description. /*! */ void HeaderOn( xbShort i ){ cout << "\n"; }; //! Short description. /*! */ void ItalicOff( void ) { cout << "\n"; }; //! Short description. /*! */ void ItalicOn( void ) { cout << ""; }; //! Short description. /*! */ void NewLine( void ) { cout << "
    "; } xbShort PostMethod( void ); void PrintEncodedChar( char ); void PrintEncodedString( const char *s ); //! Short description. /*! */ void PrintHtml( char * s ) { cout << s; }; //! Short description. /*! */ void PrintHtml( xbLong l ) { cout << l; }; //! Short description. /*! */ void PrintHtml( xbShort i ) { cout << i; }; //! Short description. /*! */ void PrintHtml( int i ) { cout << i; }; void StartHtmlPage( const char *Title ); //! Short description. /*! */ void StartTextPage( void ) { cout << "Content-type: text/plain\n\n"; } void TextOut( const char *String ); xbLong Tally( const char *FileName ); xbShort SetCookie(const char *Name, const char *Value, const char *ExpDate, const char *ExpTime,const char *TimeZone, const char *Path, const char *Domain, xbShort Secure ); void SpaceToPlus( char * ); void PlusToSpace( char * ); void SendRedirect( char * ) const; protected: xbArrayPtr FieldNameArray; xbArrayPtr DataValueArray; xbShort NoOfDataFields; char * HtmlWorkBuf; xbShort HtmlBufLen; void LoadArray( void ); void DeleteEscChars( char *String ); void InitVals( void ); }; #endif // __XB_HTML_H__ xbase-2.0.0/xbase/ndx.h0000644000000000000000000002357007203043261010312 /* $Id: ndx.h,v 1.6 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains a header file for the xbNdx object, which is used for handling NDX type indices. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.02 10/25/97 - Index performance enhancements V 1.3 11/30/97 - Moved GetLong and GetShort to DBF class for memos V 1.5 1/2/98 - Added Dbase IV memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - umeric index support V 1.9 4/12/99 - Bug fix w/ AddKey and code cleanup */ #ifndef __XB_NDX_H__ #define __XB_NDX_H__ #ifdef __GNUG__ #pragma interface #endif #include #include /*! \file ndx.h */ // // Define the following to use inline versions of the respective methods. // #define XB_INLINE_COMPAREKEY #define XB_INLINE_GETDBFNO #define XB_NDX_NODE_BASESIZE 24 // size of base header data #define XB_VAR_NODESIZE // define to enable variable node sizes #ifndef XB_VAR_NODESIZE #define XB_NDX_NODE_SIZE 2048 //#define XB_NDX_NODE_SIZE 512 // standard dbase node size #else #define XB_DEFAULT_NDX_NODE_SIZE 512 #define XB_MAX_NDX_NODE_SIZE 4096 #define XB_NDX_NODE_SIZE NodeSize #define XB_NDX_NODE_MULTIPLE 512 #endif // XB_VAR_NODESIZE //! xbNdxHeadnode struct /*! */ struct XBDLLEXPORT xbNdxHeadNode { /* ndx header on disk */ xbLong StartNode; /* header node is node 0 */ xbLong TotalNodes; /* includes header node */ xbLong NoOfKeys; /* actual count + 1 */ xbUShort KeyLen; /* length of key data */ xbUShort KeysPerNode; xbUShort KeyType; /* 00 = Char, 01 = Numeric */ xbLong KeySize; /* key len + 8 bytes */ char Unknown2; char Unique; // char KeyExpression[488]; #ifndef XB_VAR_NODESIZE char KeyExpression[XB_NDX_NODE_SIZE - 24]; #else char KeyExpression[XB_MAX_NDX_NODE_SIZE - 24]; #endif // XB_VAR_NODESIZE }; //! xbNdxLeafNode struct /*! */ struct XBDLLEXPORT xbNdxLeafNode { /* ndx node on disk */ xbLong NoOfKeysThisNode; #ifndef XB_VAR_NODESIZE char KeyRecs[XB_NDX_NODE_SIZE-4]; #else char KeyRecs[XB_MAX_NDX_NODE_SIZE - 4]; #endif // XB_VAR_NODESIZE }; //! xbNdxNodeLink struct /*! */ struct XBDLLEXPORT xbNdxNodeLink { /* ndx node memory */ xbNdxNodeLink * PrevNode; xbNdxNodeLink * NextNode; xbLong CurKeyNo; /* 0 - KeysPerNode-1 */ xbLong NodeNo; struct xbNdxLeafNode Leaf; }; //! xbNdx class /*! */ class XBDLLEXPORT xbNdx : public xbIndex { // xbExpNode * ExpressionTree; /* Expression tree for index */ public: xbNdx() : xbIndex() {} xbNdx( xbDbf * ); ~xbNdx() {} /* don't uncomment next line - it causes seg faults for some undiagnosed reason*/ // ~NDX() { if( NdxStatus ) CloseIndex(); } xbShort OpenIndex ( const char * FileName ); xbShort CloseIndex(); xbShort CreateIndex( const char *IxName, const char *Exp, xbShort Unique, xbShort OverLay ); xbLong GetTotalNodes(); xbLong GetCurDbfRec() { return CurDbfRec; } xbShort CreateKey( xbShort, xbShort ); xbShort GetCurrentKey(char *key); xbShort AddKey( xbLong ); xbShort UniqueIndex() { return HeadNode.Unique; } xbShort DeleteKey( xbLong ); xbShort KeyWasChanged(); xbShort FindKey( const char *Key ); xbShort FindKey(); xbShort FindKey( xbDouble ); #ifdef XBASE_DEBUG void DumpHdrNode(); void DumpNodeRec( xbLong NodeNo ); void DumpNodeChain(); xbShort CheckIndexIntegrity( const xbShort Option ); #endif //! Short description. /*! */ xbShort GetNextKey() { return GetNextKey( 1 ); } //! Short description. /*! */ xbShort GetLastKey() { return GetLastKey( 0, 1 ); } //! Short description. /*! */ xbShort GetFirstKey() { return GetFirstKey( 1 ); } //! Short description. /*! */ xbShort GetPrevKey() { return GetPrevKey( 1 ); } xbShort ReIndex(void (*statusFunc)(xbLong itemNum, xbLong numItems) = 0); xbShort KeyExists( const char * Key ) { return FindKey( Key, strlen( Key ), 0 ); } xbShort KeyExists( xbDouble ); virtual void SetNodeSize(xbShort size); virtual void GetExpression(char *buf, int len); protected: xbNdxHeadNode HeadNode; xbNdxLeafNode LeafNode; xbLong xbNodeLinkCtr; xbLong ReusedxbNodeLinks; xbString IndexName; #ifndef XB_VAR_NODESIZE char Node[XB_NDX_NODE_SIZE]; #else char Node[XB_MAX_NDX_NODE_SIZE]; #endif // XB_VAR_NODESIZE // FILE *ndxfp; // int NdxStatus; /* 0 = closed, 1 = open */ xbNdxNodeLink * NodeChain; /* pointer to node chain of index nodes */ xbNdxNodeLink * FreeNodeChain; /* pointer to chain of free index nodes */ xbNdxNodeLink * CurNode; /* pointer to current node */ xbNdxNodeLink * DeleteChain; /* pointer to chain to delete */ xbNdxNodeLink * CloneChain; /* pointer to node chain copy (add dup) */ xbLong CurDbfRec; /* current Dbf record number */ char *KeyBuf; /* work area key buffer */ char *KeyBuf2; /* work area key buffer */ /* private functions */ xbLong GetLeftNodeNo( xbShort, xbNdxNodeLink * ); #ifndef XB_INLINE_COMPAREKEY xbShort CompareKey( const char *Key1, const char *Key2, xbShort Klen ); #else //! Short description. /*! */ inline xbShort CompareKey( const char *Key1, const char *Key2, xbShort Klen ) { #if 0 const char *k1, *k2; xbShort i; #endif xbDouble d1, d2; int c; if(!( Key1 && Key2 )) return -1; if( Klen > HeadNode.KeyLen ) Klen = HeadNode.KeyLen; if( HeadNode.KeyType == 0 ) { c = memcmp(Key1, Key2, Klen); if(c < 0) return 2; else if(c > 0) return 1; return 0; } else /* key is numeric */ { d1 = dbf->xbase->GetDouble( Key1 ); d2 = dbf->xbase->GetDouble( Key2 ); if( d1 == d2 ) return 0; else if( d1 > d2 ) return 1; else return 2; } } #endif #ifndef XB_INLINE_GETDBFNO xbLong GetDbfNo( xbShort, xbNdxNodeLink * ); #else //! Short description. /*! */ inline xbLong GetDbfNo( xbShort RecNo, xbNdxNodeLink *n ) { xbNdxLeafNode *temp; char *p; if( !n ) return 0L; temp = &n->Leaf; if( RecNo < 0 || RecNo > ( temp->NoOfKeysThisNode - 1 )) return 0L; p = temp->KeyRecs + 4; p += RecNo * ( 8 + HeadNode.KeyLen ); return( dbf->xbase->GetLong( p )); } #endif char * GetKeyData( xbShort, xbNdxNodeLink * ); xbUShort GetKeysPerNode(); xbShort GetHeadNode(); xbShort GetLeafNode( xbLong, xbShort ); xbNdxNodeLink * GetNodeMemory(); void ReleaseNodeMemory( xbNdxNodeLink * ); xbShort BSearchNode(const char *key, xbShort klen, const xbNdxNodeLink *node, xbShort *comp); xbLong GetLeafFromInteriorNode( const char *Tkey, xbShort Klen ); xbShort CalcKeyLen(); xbShort PutKeyData( xbShort, xbNdxNodeLink * ); xbShort PutLeftNodeNo( xbShort, xbNdxNodeLink *, xbLong ); xbShort PutLeafNode( xbLong, xbNdxNodeLink * ); xbShort PutHeadNode( xbNdxHeadNode *, FILE *, xbShort ); xbShort PutDbfNo( xbShort, xbNdxNodeLink *, xbLong ); xbShort PutKeyInNode( xbNdxNodeLink *, xbShort, xbLong, xbLong, xbShort ); xbShort SplitLeafNode( xbNdxNodeLink *, xbNdxNodeLink *, xbShort, xbLong ); xbShort SplitINode( xbNdxNodeLink *, xbNdxNodeLink *, xbLong ); xbShort AddToIxList(); xbShort RemoveFromIxList(); xbShort RemoveKeyFromNode( xbShort, xbNdxNodeLink * ); xbShort FindKey( const char *Tkey, xbShort Klen, xbShort RetrieveSw ); xbShort UpdateParentKey( xbNdxNodeLink * ); xbShort GetFirstKey( xbShort ); xbShort GetNextKey( xbShort ); xbShort GetLastKey( xbLong, xbShort ); xbShort GetPrevKey( xbShort ); void UpdateDeleteList( xbNdxNodeLink * ); void ProcessDeleteList(); xbNdxNodeLink * LeftSiblingHasSpace( xbNdxNodeLink * ); xbNdxNodeLink * RightSiblingHasSpace( xbNdxNodeLink * ); xbShort DeleteSibling( xbNdxNodeLink * ); xbShort MoveToLeftNode( xbNdxNodeLink *, xbNdxNodeLink * ); xbShort MoveToRightNode( xbNdxNodeLink *, xbNdxNodeLink * ); xbShort FindKey( const char *Tkey, xbLong DbfRec ); /* for a specific dbf no */ xbShort CloneNodeChain(); xbShort UncloneNodeChain(); //#ifdef XB_LOCKING_ON // xbShort LockIndex( const xbShort, const xbShort ) const; //#else // xbShort LockIndex( const xbShort, const xbShort ) const { return NO_ERROR; } //#endif }; #endif /* __XB_NDX_H__ */ xbase-2.0.0/xbase/retcodes.h0000644000000000000000000000662707177414604011352 /* $Id: retcodes.h,v 1.4 2000/10/31 00:59:48 dbryson Exp $ Xbase project source code This file contains a listing of all the Xbase return codes. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.8.0a 1/27/99 - Changed return codes to negative values */ /*! \file retcodes.h */ #ifndef __XB_RETCODES_H__ #define __XB_RETCODES_H__ /***********************************************/ /* Return Codes and Error Messages */ #define XB_NO_ERROR 0 #define XB_EOF -100 #define XB_BOF -101 #define XB_NO_MEMORY -102 #define XB_FILE_EXISTS -103 #define XB_OPEN_ERROR -104 #define XB_WRITE_ERROR -105 #define XB_UNKNOWN_FIELD_TYPE -106 #define XB_ALREADY_OPEN -107 #define XB_NOT_XBASE -108 #define XB_INVALID_RECORD -109 #define XB_INVALID_OPTION -110 #define XB_NOT_OPEN -111 #define XB_SEEK_ERROR -112 #define XB_READ_ERROR -113 #define XB_NOT_FOUND -114 #define XB_FOUND -115 #define XB_INVALID_KEY -116 #define XB_INVALID_NODELINK -117 #define XB_KEY_NOT_UNIQUE -118 #define XB_INVALID_KEY_EXPRESSION -119 #define XB_DBF_FILE_NOT_OPEN -120 #define XB_INVALID_KEY_TYPE -121 #define XB_INVALID_NODE_NO -122 #define XB_NODE_FULL -123 #define XB_INVALID_FIELDNO -124 #define XB_INVALID_DATA -125 #define XB_NOT_LEAFNODE -126 #define XB_LOCK_FAILED -127 #define XB_CLOSE_ERROR -128 #define XB_INVALID_SCHEMA -129 #define XB_INVALID_NAME -130 #define XB_INVALID_BLOCK_SIZE -131 #define XB_INVALID_BLOCK_NO -132 #define XB_NOT_MEMO_FIELD -133 #define XB_NO_MEMO_DATA -134 #define XB_EXP_SYNTAX_ERROR -135 #define XB_PARSE_ERROR -136 #define XB_NO_DATA -137 #define XB_UNKNOWN_TOKEN_TYPE -138 #define XB_INVALID_FIELD -140 #define XB_INSUFFICIENT_PARMS -141 #define XB_INVALID_FUNCTION -142 #define XB_INVALID_FIELD_LEN -143 #define XB_HARVEST_NODE -144 #define XB_INVALID_DATE -145 #endif /* __XB_RETCODES_H__ */ xbase-2.0.0/xbase/xbase.h0000644000000000000000000001152107316217017010623 /* $Id: xbase.h,v 1.19 2001/06/26 23:43:11 dbryson Exp $ Xbase project source code This file contains a header file for the xbXBase class, which is the base class for using the Xbase DBMS library. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.8.0a 1/27/99 - Added DisplayError method */ #ifndef __XB_XBASE_H__ #define __XB_XBASE_H__ #ifdef __GNUG__ #pragma interface #endif #ifdef __WIN32__ #include "xbase/xbconfigw32.h" #else #include "xbase/xbconfig.h" #endif // // Identify ourselves // #define XDB_VERSION "2.0.0" #define XBASE_VERSION "2.0.0" #include #if defined(__WIN32__) #include "windows.h" // ripped from wxWindows // _declspec works in BC++ 5 and later, as well as VC++ #if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) # ifdef XBMAKINGDLL # define XBDLLEXPORT __declspec( dllexport ) # define XBDLLEXPORT_DATA(type) __declspec( dllexport ) type # define XBDLLEXPORT_CTORFN # elif defined(XBUSINGDLL) # define XBDLLEXPORT __declspec( dllimport ) # define XBDLLEXPORT_DATA(type) __declspec( dllimport ) type # define XBDLLEXPORT_CTORFN # else # define XBDLLEXPORT # define XBDLLEXPORT_DATA(type) type # define XBDLLEXPORT_CTORFN # endif #else # define XBDLLEXPORT # define XBDLLEXPORT_DATA(type) type # define XBDLLEXPORT_CTORFN #endif #else // !Windows # define XBDLLEXPORT # define XBDLLEXPORT_DATA(type) type # define XBDLLEXPORT_CTORFN #endif // Win/!Win #include #include #include #include #if defined(XB_EXPRESSIONS) #include #endif /*! \file xbase.h */ class XBDLLEXPORT xbDbf; //! xbDbList struct /*! */ struct XBDLLEXPORT xbDbList{ xbDbList * NextDbf; char * DbfName; xbDbf * dbf; }; //! xbXBase class /*! */ #if defined(XB_EXPRESSIONS) class XBDLLEXPORT xbXBase : public xbExpn { #else class XBDLLEXPORT xbXBase : public xbDate { #endif protected: xbDbList * DbfList; xbDbList * FreeDbfList; xbShort EndianType; /* B = Big Endian, L = Little Endian */ public: ~xbXBase(); xbXBase(); xbShort AddDbfToDbfList(xbDbf *d, const char *DatabaseName); xbDbf * GetDbfPtr( const char *Name ); xbShort DirectoryExistsInName( const char *Name ); xbShort GetEndianType( void ) { return EndianType; } void DisplayError( const xbShort ErrorCode ) const; static const char* GetErrorMessage( const xbShort ErrorNo ); /* next 6 routines handle both big endian and little endian machines */ xbDouble GetDouble( const char *p ); xbLong GetLong ( const char *p ); xbULong GetULong ( const char *p ); xbShort GetShort ( const char *p ); void PutLong ( char *p, const xbLong l ); void PutShort ( char *p, const xbShort s ); void PutULong ( char *p, const xbULong l ); void PutUShort( char *p, const xbUShort s ); void PutDouble( char *p, const xbDouble d ); xbShort RemoveDbfFromDbfList( xbDbf * ); }; #include #if defined(XB_INDEX_ANY) #include #endif #ifdef XB_INDEX_NDX #include #endif #ifdef XB_INDEX_NTX #include #endif #if defined(XB_FILTERS) && !defined(XB_INDEX_ANY) #error XB_FILTERS cant be used without index support #elif defined(XB_FILTERS) #include #endif #ifdef XB_LOCKING_ON #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_SYS_LOCKING_H #include #define F_SETLKW 0 #define F_SETLK 1 #define F_RDLCK 2 #define F_WRLCK 3 #define F_UNLCK 4 #endif #else enum { F_SETLKW = 0, F_WRLCK = 0 }; #endif #ifdef XB_HTML #include #endif #endif // __XB_XBASE_H__ xbase-2.0.0/xbase/xdate.h0000644000000000000000000001653507203043261010631 /* $Id: xdate.h,v 1.7 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains a header file for the xbDate object, which is used for handling dates. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys V 1.7.1 5/25/98 - Enhancements/bug fixes from eljorgo@fontun.com V 1.8.0a 1/29/99 - Added Default Date Format processing V 1.9.0 6/23/99 - CPP ified and minor bug fixes */ /*! \file xbdate.h */ #ifndef __XB_XDATE_H__ #define __XB_XDATE_H__ #ifdef __GNUG__ #pragma interface #endif #ifdef __WIN32__ #include #else #include #endif #include #define XB_FMT_WEEK 1 #define XB_FMT_MONTH 2 #define XB_FMT_YEAR 3 //! xbDate class /*! */ class XBDLLEXPORT xbDate { public: xbDate(); xbDate( const char * Date8 ); xbDate( const xbString &Date8 ); //! Short description. /*! */ const xbString & GetDate() const { return cDate8; }; //! Short description. /*! */ xbString & GetDate() { return cDate8; }; //! Short description. /*! */ const xbString & GetFormattedDate() const { return fDate; }; //! Short description. /*! */ xbString & GetFormattedDate() { return fDate; }; int SetDate( const char * Date8 ); //! Short description. /*! */ int SetDate( const xbString & Date8 ) { return SetDate((const char *) Date8 ); }; long JulianDays ( const char *Date8 ) const; //! Short description. /*! */ long JulianDays ( const xbString & Date8 ) const { return JulianDays((const char *) Date8 ); }; //! Short description. /*! */ long JulianDays () const { return JulianDays((const char *) cDate8 ); }; int YearOf ( const char *Date8 ) const; //! Short description. /*! */ int YearOf ( const xbString & Date8 ) const { return YearOf((const char *) Date8 ); }; //! Short description. /*! */ int YearOf () const { return YearOf((const char *) cDate8 ); }; int MonthOf ( const char *Date8 ) const; //! Short description. /*! */ int MonthOf ( const xbString &Date8 ) const { return MonthOf((const char *) Date8 ); }; //! Short description. /*! */ int MonthOf () const { return MonthOf(( const char *) cDate8 ); }; int DayOf ( int Format, const char *Date8 ) const; //! Short description. /*! */ int DayOf ( int Format, const xbString &Date8 ) const { return DayOf( Format, (const char *) Date8 ); }; //! Short description. /*! */ int DayOf ( int Format ) const { return DayOf( Format, (const char *) cDate8 ); }; int IsLeapYear ( const char *Date8 ) const; //! Short description. /*! */ int IsLeapYear ( const xbString &Date8 ) const { return IsLeapYear((const char *) Date8 ); }; //! Short description. /*! */ int IsLeapYear () const { return IsLeapYear((const char *) cDate8 ); }; int DateIsValid ( const char *Date8 ) const; //! Short description. /*! */ int DateIsValid ( const xbString & Date8 ) const { return DateIsValid( (const char *) Date8 ); }; xbString& LastDayOfMonth( const char *Date8 ); //! Short description. /*! */ xbString& LastDayOfMonth( const xbString & Date8 ) { return LastDayOfMonth((const char *) Date8 ); }; //! Short description. /*! */ xbString& LastDayOfMonth() { return LastDayOfMonth((const char *) cDate8 ); }; xbString& Sysdate (); xbString& JulToDate8( long ); xbString& FormatDate( const char *Format, const char *Date8 ); //! Short description. /*! */ xbString& FormatDate( const xbString &Format, const char *Date8 ) { return FormatDate((const char *) Format, Date8 ); }; //! Short description. /*! */ xbString& FormatDate( const char *Format, const xbString &Date8 ) { return FormatDate( Format, (const char *) Date8 ); }; //! Short description. /*! */ xbString& FormatDate( const xbString &Format, const xbString &Date8 ) { return FormatDate((const char *) Format,(const char *) Date8 ); }; //! Short description. /*! */ xbString& FormatDate( const char *Format ) { return FormatDate( (const char *) Format, (const char *) cDate8 ); }; //! Short description. /*! */ xbString& FormatDate( const xbString &Format ) { return FormatDate((const char *) Format, (const char *) cDate8 ); }; xbString& CharDayOf ( const char *Date8 ); //! Short description. /*! */ xbString& CharDayOf ( const xbString &Date8 ) { return CharDayOf((const char *) Date8 ); }; //! Short description. /*! */ xbString& CharDayOf () { return CharDayOf((const char *) cDate8 ); }; xbString& CharMonthOf ( const char *Date8 ); //! Short description. /*! */ xbString& CharMonthOf ( const xbString &Date8 ) { return CharMonthOf(( const char *) Date8 ); }; //! Short description. /*! */ xbString& CharMonthOf () { return CharMonthOf(( const char *) cDate8 ); }; xbString &operator+=( int ); xbString &operator-=( int ); xbString &operator++( int ); /* post increment */ xbString &operator--( int ); /* post increment */ xbString &operator+ ( int ); xbString &operator- ( int ); long operator-( const xbDate & ) const; int operator==( const xbDate & ) const; int operator!=( const xbDate & ) const; int operator< ( const xbDate & ) const; int operator> ( const xbDate & ) const; int operator<=( const xbDate & ) const; int operator>=( const xbDate & ) const; protected: void SetDateTables(); xbString cDate8; /* CCYYMMDD date format */ xbString fDate; /* other date format */ static int AggregatedDaysInMonths[2][13]; static int DaysInMonths[2][13]; static const xbString *Days[7]; static const xbString *Months[12]; }; #endif // __XB_XDATE_H__ xbase-2.0.0/xbase/xstack.h0000644000000000000000000000437507203043261011020 /* $Id: xstack.h,v 1.5 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file conatains a header file for the xbStack object which is used for handling expressions. Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys */ /*! \file xstack.h */ #ifndef __XB_STACK_H__ #define __XB_STACK_H__ #ifdef __GNUG__ #pragma interface #endif #include //! xbStackElement struct /*! */ struct xbStackElement{ xbStackElement * Previous; xbStackElement * Next; void * UserPtr; }; //! xbStack class /*! */ class XBDLLEXPORT xbStack{ public: xbStack( void ); void InitStack( void ); void * Pop( void ); xbShort Push( void * ); //! Short description. /*! */ xbShort GetStackDepth( void ) { return StackDepth; } void DumpStack( void ); protected: xbShort StackDepth; xbStackElement * First; xbStackElement * Last; xbStackElement * Free; /* points to free stack items */ xbStackElement * GetStackElement( void ); void FreeStackElement( xbStackElement * ); }; #endif // __XB_STACK_H__ xbase-2.0.0/xbase/xtypes.h0000644000000000000000000000343207177414604011065 /* $Id: xtypes.h,v 1.4 2000/10/31 00:59:48 dbryson Exp $ Xbase project source code Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.8.0a 1/29/99 - V1.8 upgrade */ #ifndef __XB_XTYPES_H__ #define __XB_XTYPES_H__ #include /*! \file xtypes.h */ //! xbULong type /*! */ typedef unsigned long int xbULong; //! xbUShort type /*! */ typedef unsigned short int xbUShort; //! xbShort type /*! */ typedef short int xbShort; #define xbLong long //typedef long LONG; //! xbFloat type /*! */ typedef float xbFloat; //! xbDouble type /*! */ typedef double xbDouble; #endif // __XB_XTYPES_H__ xbase-2.0.0/xbase/xbexcept.h0000644000000000000000000000720307203043261011336 /* $Id: xbexcept.h,v 1.6 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains definitions for xbase exceptions. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net */ #ifndef __XBEXCEPT_H__ #define __XBEXCEPT_H__ #ifdef __GNUG__ #pragma interface #endif #ifdef __WIN32__ #include #else #include #endif #include /*! \file xbexcept.h */ const char *xbStrError(xbShort err); #ifndef HAVE_EXCEPTIONS #define xb_error(code) { return code;} #define xb_io_error(code,name) { return code;} #define xb_open_error(name) { return XB_OPEN_ERROR;} #define xb_memory_error { return XB_NO_MEMORY;} #define xb_eof_error { return XB_EOF;} #else #ifdef HAVE_EXCEPTION #include #elif HAVE_G___EXCEPTION_H #include #elif #error "Exceptions are unsupported on your system." #endif #ifdef __BORLANDC__ #define XB_THROW throw () using std::exception; #else #define XB_THROW #endif //! xbException class /*! */ /* FIXME: class exception is member of -- willy */ class XBDLLEXPORT xbException : public exception { public: xbException (int err); virtual ~xbException () XB_THROW; virtual const char* what() const XB_THROW; virtual const char *error(); int getErr(); private: int err; }; #define xb_error(code) {throw xbException(code);return (code);} //! xbIOException class /*! */ class XBDLLEXPORT xbIOException : public xbException { public: xbIOException (int err); xbIOException (int err, const char *n); virtual ~xbIOException () XB_THROW; virtual const char* what() const XB_THROW; const char *_errno() const; const char *name; protected: int m_errno; }; #define xb_io_error(code, name) {throw xbIOException(code,name);return (code);} //! xbOpenException class /*! */ class XBDLLEXPORT xbOpenException : public xbIOException { public: xbOpenException (); xbOpenException (const char *n); virtual ~xbOpenException () XB_THROW; virtual const char* what() const XB_THROW; }; #define xb_open_error(name) { throw xbOpenException(name); return 0;} //! xbOutOfMemoryException class /*! */ class XBDLLEXPORT xbOutOfMemoryException : public xbException { public: xbOutOfMemoryException (); virtual ~xbOutOfMemoryException () XB_THROW; virtual const char* what() const XB_THROW; }; #define xb_memory_error {throw xbOutOfMemoryException();return 0;} //! xbEofException class /*! */ class XBDLLEXPORT xbEoFException : public xbIOException { public: xbEoFException (); virtual ~xbEoFException () XB_THROW; virtual const char* what() const XB_THROW; }; #define xb_eof_error {throw xbEoFException();return 0;} #endif #endif // __XBEXCEPT_H__ xbase-2.0.0/xbase/xbstring.h0000644000000000000000000000727207234452760011376 /* Xbase project source code This file contains the Class definition for a xbString object. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.9.2 9/14/99 - Misc user supplied updates */ #ifndef __XBSTRING_H__ #define __XBSTRING_H__ #ifdef __GNUG__ #pragma interface #endif #ifdef __WIN32__ #include #else #include #endif #include #include /*! \file xbstring.h */ //! xbString class /*! */ class XBDLLEXPORT xbString { public: enum {npos = -1}; xbString(); xbString(size_t size); xbString(char c); xbString(const char *s); xbString(const char *s, size_t maxlen); xbString(const xbString &s); ~xbString(); xbString &operator=(const xbString &s); xbString &operator=(const char *s); xbString &operator=(char c); bool isNull() const; bool isEmpty() const; size_t len() const; size_t length() const; void resize(size_t size); xbString copy() const; xbString &sprintf(const char *format, ...); void setNum(long num); xbString& assign(const xbString& str, size_t pos = 0, int n = npos); xbString& assign(char* str, int n); char operator[](int n) { return data[n]; } char getCharacter( int n ) const { return data[n]; } operator const char *() const; xbString &operator+=(const char *s); xbString &operator+=(char c); xbString &operator-=(const char *s); void putAt(size_t pos, char c); const char *getData() const; const char *c_str() const; void toLowerCase(); int pos(char c); int pos(const char* s); void trim(); bool compare(char s); bool compare(const char *s); bool operator == ( const xbString& ) const; bool operator != ( const xbString& ) const; bool operator < ( const xbString& ) const; bool operator > ( const xbString& ) const; bool operator <= ( const xbString& ) const; bool operator >= ( const xbString& ) const; friend ostream& operator << ( ostream&, const xbString& ); xbString &remove(size_t pos = 0, int n = npos); xbString mid(size_t pos = 0, int n = npos) const; protected: void ctor(const char *s); void ctor(const char *s, size_t maxlen); char *data; size_t size; static const char * NullString; }; bool operator==(const xbString &s1, const char *s2); bool operator!=(const xbString &s1, const char *s2); bool operator==(const xbString &s1, char s2); bool operator!=(const xbString &s1, char s2); xbString operator+(const xbString &s1, const xbString &s2); xbString operator+(const xbString &s1, const char *s2); xbString operator+(const char *s1, const xbString &s2); xbString operator+(const xbString &s1, char c2); xbString operator+(char c1, const xbString &s2); xbString operator-(const xbString &s1, const xbString &s2); #endif xbase-2.0.0/xbase/index.h0000644000000000000000000000745207203043261010631 /* $Id: index.h,v 1.5 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains a header file for the NTX object, which is used for handling NTX type indices. NTX are the Clipper equivalant of xbNdx files. Copyright (C) 1998 SynXis Corp., Bob Cotton 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 9/1/98 - Initial release of software */ #ifndef __XB_INDEX_H__ #define __XB_INDEX_H__ #ifdef __GNUG__ #pragma interface #endif #include #include /*! \file index.h */ #define XB_UNIQUE 1 #define XB_NOT_UNIQUE 0 //! xbIndex class /*! */ class XBDLLEXPORT xbIndex { public: xbIndex *index; xbDbf *dbf; xbExpNode *ExpressionTree; xbString IndexName; FILE *indexfp; int IndexStatus; /* 0 = closed, 1 = open */ xbLong CurDbfRec; /* current Dbf record number */ char *KeyBuf; /* work area key buffer */ char *KeyBuf2; /* work area key buffer */ #ifdef XB_LOCKING_ON protected: int CurLockCount; int CurLockType; #endif xbShort NodeSize; public: xbIndex() {} xbIndex(xbDbf *); virtual ~xbIndex() {} virtual xbShort OpenIndex ( const char * ) = 0; virtual xbShort CloseIndex() = 0; #ifdef XBASE_DEBUG virtual void DumpHdrNode() = 0; virtual void DumpNodeRec( xbLong ) = 0; virtual void DumpNodeChain() = 0; virtual xbShort CheckIndexIntegrity( const xbShort ) = 0; #endif virtual xbShort CreateIndex( const char *, const char *, xbShort, xbShort ) = 0; virtual xbLong GetTotalNodes() = 0; virtual xbLong GetCurDbfRec() = 0; virtual xbShort CreateKey( xbShort, xbShort ) = 0; virtual xbShort GetCurrentKey(char *key) = 0; virtual xbShort AddKey( xbLong ) = 0; virtual xbShort UniqueIndex() = 0; virtual xbShort DeleteKey( xbLong ) = 0; virtual xbShort KeyWasChanged() = 0; virtual xbShort FindKey( const char * ) = 0; virtual xbShort FindKey() = 0; virtual xbShort FindKey( xbDouble ) = 0; virtual xbShort GetNextKey() = 0; virtual xbShort GetLastKey() = 0; virtual xbShort GetFirstKey() = 0; virtual xbShort GetPrevKey() = 0; virtual xbShort ReIndex(void (*statusFunc)(xbLong itemNum, xbLong numItems) = 0) = 0; // virtual xbShort KeyExists( char * Key ) { return FindKey( Key, strlen( Key ), 0 ); } virtual xbShort KeyExists( xbDouble ) = 0; #ifdef XB_LOCKING_ON virtual xbShort LockIndex( const xbShort, const xbShort ); #else virtual xbShort LockIndex( const xbShort, const xbShort ) const { return XB_NO_ERROR; } #endif virtual xbShort TouchIndex( void ) { return XB_NO_ERROR; } virtual void SetNodeSize(xbShort size) {} virtual xbShort GetNodeSize(void) { return NodeSize; } virtual void GetExpression(char *buf, int len) = 0; }; #endif /* __XB_INDEX_H__ */ xbase-2.0.0/xbase/ntx.h0000644000000000000000000001653507203043261010335 /* $Id: ntx.h,v 1.5 2000/11/10 19:04:17 dbryson Exp $ Xbase project source code This file contains a header file for the xbNdx object, which is used for handling xbNdx type indices. Copyright (C) 1997 StarTech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software */ #ifndef __XB_NTX_H__ #define __XB_NTX_H__ #ifdef __GNUG__ #pragma interface #endif #include #include /*! \file ntx.h */ #define XB_NTX_NODE_SIZE 1024 //! xbNtxHeadNode struct /*! */ struct NtxHeadNode { /* ntx header on disk */ xbUShort Signature; /* Clipper 5.x or Clipper 87 */ xbUShort Version; /* Compiler Version */ /* Also turns out to be a last modified counter */ xbLong StartNode; /* Offset in file for first index */ xbULong UnusedOffset; /* First free page offset */ xbUShort KeySize; /* Size of items (KeyLen + 8) */ xbUShort KeyLen; /* Size of the Key */ xbUShort DecimalCount; /* Number of decimal positions */ xbUShort KeysPerNode; /* Max number of keys per page */ xbUShort HalfKeysPerNode; /* Min number of keys per page */ char KeyExpression[256]; /* Null terminated key expression */ unsigned Unique; /* Unique Flag */ char NotUsed[745]; }; //! xbNtxLeafNode struct /*! */ struct NtxLeafNode { /* ndx node on disk */ xbUShort NoOfKeysThisNode; char KeyRecs[XB_NTX_NODE_SIZE]; }; //! xbNtxItem struct /*! */ struct NtxItem { xbULong Node; xbULong RecordNumber; char Key[256]; }; //! xbNtxNodeLink struct /*! */ struct xbNodeLink { /* ndx node memory */ xbNodeLink * PrevNode; xbNodeLink * NextNode; xbUShort CurKeyNo; /* 0 - KeysPerNode-1 */ xbLong NodeNo; struct NtxLeafNode Leaf; xbUShort *offsets; }; //! xbNtx class /*! */ class XBDLLEXPORT xbNtx : public xbIndex { public: NtxHeadNode HeadNode; NtxLeafNode LeafNode; xbLong NodeLinkCtr; xbLong ReusedNodeLinks; char Node[XB_NTX_NODE_SIZE]; xbNodeLink * NodeChain; /* pointer to node chain of index nodes */ xbNodeLink * FreeNodeChain; /* pointer to chain of free index nodes */ xbNodeLink * CurNode; /* pointer to current node */ xbNodeLink * DeleteChain; /* pointer to chain to delete */ xbNodeLink * CloneChain; /* pointer to node chain copy (add dup) */ NtxItem PushItem; /* private functions */ xbLong GetLeftNodeNo( xbShort, xbNodeLink * ); xbShort CompareKey( const char *, const char *, xbShort ); xbShort CompareKey( const char *, const char * ); xbLong GetDbfNo( xbShort, xbNodeLink * ); char * GetKeyData( xbShort, xbNodeLink * ); xbUShort GetItemOffset ( xbShort, xbNodeLink *, xbShort ); xbUShort InsertKeyOffset ( xbShort, xbNodeLink * ); xbUShort GetKeysPerNode( void ); xbShort GetHeadNode( void ); xbShort GetLeafNode( xbLong, xbShort ); xbNodeLink * GetNodeMemory( void ); xbLong GetNextNodeNo( void ); void ReleaseNodeMemory( xbNodeLink * ); xbULong GetLeafFromInteriorNode( const char *, xbShort ); xbShort CalcKeyLen( void ); xbShort PutKeyData( xbShort, xbNodeLink * ); xbShort PutLeftNodeNo( xbShort, xbNodeLink *, xbLong ); xbShort PutLeafNode( xbLong, xbNodeLink * ); xbShort PutHeadNode( NtxHeadNode *, FILE *, xbShort ); xbShort TouchIndex( void ); xbShort PutDbfNo( xbShort, xbNodeLink *, xbLong ); xbShort PutKeyInNode( xbNodeLink *, xbShort, xbLong, xbLong, xbShort ); xbShort SplitLeafNode( xbNodeLink *, xbNodeLink *, xbShort, xbLong ); xbShort SplitINode( xbNodeLink *, xbNodeLink *, xbLong ); xbShort AddToIxList( void ); xbShort RemoveFromIxList( void ); xbShort RemoveKeyFromNode( xbShort, xbNodeLink * ); xbShort DeleteKeyFromNode( xbShort, xbNodeLink * ); xbShort JoinSiblings(xbNodeLink *, xbShort, xbNodeLink *, xbNodeLink *); xbUShort DeleteKeyOffset( xbShort, xbNodeLink *); xbShort FindKey( const char *, xbShort, xbShort ); xbShort UpdateParentKey( xbNodeLink * ); xbShort GetFirstKey( xbShort ); xbShort GetNextKey( xbShort ); xbShort GetLastKey( xbLong, xbShort ); xbShort GetPrevKey( xbShort ); void UpdateDeleteList( xbNodeLink * ); void ProcessDeleteList( void ); // xbNodeLink * LeftSiblingHasSpace( xbNodeLink * ); // xbNodeLink * RightSiblingHasSpace( xbNodeLink * ); // xbShort DeleteSibling( xbNodeLink * ); // xbShort MoveToLeftNode( xbNodeLink *, xbNodeLink * ); // xbShort MoveToRightNode( xbNodeLink *, xbNodeLink * ); xbShort FindKey( const char *, xbLong ); /* for a specific dbf no */ xbShort CloneNodeChain( void ); /* test */ xbShort UncloneNodeChain( void ); /* test */ xbNtx() : xbIndex() {} xbNtx( xbDbf * ); /* note to gak - don't uncomment next line - it causes seg faults */ // ~NTX() { if( NtxStatus ) CloseIndex(); } xbShort OpenIndex ( const char * ); xbShort CloseIndex( void ); void DumpHdrNode ( void ); void DumpNodeRec ( xbLong ); xbShort CreateIndex( const char *, const char *, xbShort, xbShort ); xbLong GetTotalNodes( void ); xbLong GetCurDbfRec( void ) { return CurDbfRec; } void DumpNodeChain( void ); xbShort CreateKey( xbShort, xbShort ); xbShort GetCurrentKey(char *key); xbShort AddKey( xbLong ); xbShort UniqueIndex( void ) { return HeadNode.Unique; } xbShort DeleteKey( xbLong DbfRec ); xbShort KeyWasChanged( void ); xbShort FindKey( const char * ); xbShort FindKey( void ); xbShort FindKey( xbDouble ); #ifdef XBASE_DEBUG xbShort CheckIndexIntegrity( const xbShort Option ); #endif xbShort GetNextKey( void ) { return GetNextKey( 1 ); } xbShort GetLastKey( void ) { return GetLastKey( 0, 1 ); } xbShort GetFirstKey( void ) { return GetFirstKey( 1 ); } xbShort GetPrevKey( void ) { return GetPrevKey( 1 ); } xbShort ReIndex(void (*statusFunc)(xbLong itemNum, xbLong numItems) = 0) ; xbShort KeyExists( char * Key ) { return FindKey( Key, strlen( Key ), 0 ); } xbShort KeyExists( xbDouble ); xbShort xbNtx::AllocKeyBufs(void); virtual void GetExpression(char *buf, int len); }; #endif /* __XB_NTX_H__ */ xbase-2.0.0/xbase/xbconfig.h0000644000000000000000000000771307316216552011333 /* xbase/xbconfig.h. Generated automatically by configure. */ /* xbase/xbconfig.h.in. Generated automatically from configure.in by autoheader. */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE /* #undef _ALL_SOURCE */ #endif /* Define if on MINIX. */ /* #undef _MINIX */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define if the C++ compiler supports BOOL */ #define HAVE_BOOL 1 /* define if you have setenv */ #define HAVE_FUNC_SETENV 1 /* Define if you need the GNU extensions to compile */ #define _GNU_SOURCE 1 /* Define if you need to have .ndx indexes */ #define XB_INDEX_NDX 1 /* Define if you need to have .ntx indexes */ #define XB_INDEX_NTX 1 /* Define if you need to support memo fields */ #define XB_MEMO_FIELDS 1 /* Define if you need expressions */ #define XB_EXPRESSIONS 1 /* Define if you need html support */ #define XB_HTML 1 /* Define if you need locking support */ #define XB_LOCKING_ON 1 /* Define if you need to turn on XBase specific debug */ #define XBASE_DEBUG 1 /* Define if your compiler support exceptions */ /* #undef HAVE_EXCEPTIONS */ /* Define if you want Castellano (Spanish) Dates */ /* #undef XB_CASTELLANO */ /* Define if using real deletes */ #define XB_REAL_DELETE 1 /* Define if need filters */ #define XB_FILTERS 1 /* Define if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define if you have the flock function. */ #define HAVE_FLOCK 1 /* Define if you have the getdomainname function. */ #define HAVE_GETDOMAINNAME 1 /* Define if you have the snprintf function. */ #define HAVE_SNPRINTF 1 /* Define if you have the socket function. */ #define HAVE_SOCKET 1 /* Define if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define if you have the vsnprintf function. */ #define HAVE_VSNPRINTF 1 /* Define if you have the vsprintf function. */ #define HAVE_VSPRINTF 1 /* Define if you have the header file. */ #define HAVE_CTYPE_H 1 /* Define if you have the header file. */ #define HAVE_DIRENT_H 1 /* Define if you have the header file. */ #define HAVE_EXCEPTION 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ /* #undef HAVE_G___EXCEPTION_H */ /* Define if you have the header file. */ /* #undef HAVE_IO_H */ /* Define if you have the header file. */ /* #undef HAVE_NDIR_H */ /* Define if you have the header file. */ #define HAVE_STDARG_H 1 /* Define if you have the header file. */ #define HAVE_STRING_H 1 /* Define if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define if you have the header file. */ /* #undef HAVE_SYS_DIR_H */ /* Define if you have the header file. */ /* #undef HAVE_SYS_LOCKING_H */ /* Define if you have the header file. */ /* #undef HAVE_SYS_NDIR_H */ /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if you have the header file. */ /* #undef HAVE_TVISION_TV_H */ /* Should we include generic index support? */ #if defined(XB_INDEX_NDX) || defined(XB_INDEX_NTX) #define XB_INDEX_ANY 1 #endif /* expressions required for indexes */ #if defined(XB_INDEX_ANY) && !defined(XB_EXPRESSIONS) #define XB_EXPRESSIONS 1 #endif /* default memo block size */ #define XB_DBT_BLOCK_SIZE 512 /* filename path separator */ #define PATH_SEPARATOR '/' #ifndef HAVE_BOOL #define HAVE_BOOL 1 typedef int bool; const bool false = 0; const bool true = 1; #endif xbase-2.0.0/xbase/xbfilter.h0000644000000000000000000000353407203043261011336 /* xbfilter.h Xbase project source code This file conatains a header file for the xbFilter object which is used for filtering data. Copyright (C) 1997 Startech, Gary A. Kunkel 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. This library 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 License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com See our website at: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.6b 4/8/98 - Numeric index keys */ /*! \file xbfilter.h */ #ifndef __XB_FILTER_H__ #define __XB_FILTER_H__ #ifdef __GNUG__ #pragma interface #endif //! xbFilter class /*! */ class XBDLLEXPORT xbFilter { public: xbFilter( xbDbf * dbf, xbIndex * index, char * expression ); xbShort GetFirstFilterRec(); xbShort GetLastFilterRec(); xbShort GetNextFilterRec(); xbShort GetPrevFilterRec(); protected: xbULong CurFilterRecNo; xbShort Status; xbExpNode *e; xbDbf *d; xbIndex *i; }; #endif xbase-2.0.0/xbase/xbconfigw32.h0000644000000000000000000001007207202063230011642 /* xbase/xbconfig.h. Generated automatically by configure. */ /* xbase/xbconfig.h.in. Generated automatically from configure.in by autoheader. */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE /* #undef _ALL_SOURCE */ #endif /* Define if on MINIX. */ /* #undef _MINIX */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define if the C++ compiler supports BOOL */ #define HAVE_BOOL 1 /* define if you have setenv */ #define HAVE_FUNC_SETENV 1 /* Define if you need the GNU extensions to compile */ #define _GNU_SOURCE 1 /* Define if you need to have .ndx indexes */ #define XB_INDEX_NDX 1 /* Define if you need to have .ntx indexes */ #define XB_INDEX_NTX 1 /* Define if you need to support memo fields */ #define XB_MEMO_FIELDS 1 /* Define if you need expressions */ #define XB_EXPRESSIONS 1 /* Define if you need html support */ #define XB_HTML 1 /* Define if you need locking support */ //#define XB_LOCKING_ON 0 /* Define if you need to turn on XBase specific debug */ #define XBASE_DEBUG 1 /* Define if your compiler support exceptions */ /* #undef HAVE_EXCEPTIONS */ /* Define if you want Castellano (Spanish) Dates */ /* #undef XB_CASTELLANO */ /* Define if using real deletes */ #define XB_REAL_DELETE 1 /* Define if need filters */ #define XB_FILTERS 1 /* Define if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define if you have the flock function. */ #define HAVE_FLOCK 1 /* Define if you have the getdomainname function. */ #define HAVE_GETDOMAINNAME 1 /* Define if you have the snprintf function. */ #define HAVE_SNPRINTF 1 /* Define if you have the socket function. */ #define HAVE_SOCKET 1 /* Define if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define if you have the vsnprintf function. */ //#define HAVE_VSNPRINTF 1 /* Define if you have the vsprintf function. */ #define HAVE_VSPRINTF 1 /* Define if you have the header file. */ #define HAVE_CTYPE_H 1 /* Define if you have the header file. */ #define HAVE_DIRENT_H 1 /* Define if you have the header file. */ #define HAVE_EXCEPTION 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ /* #undef HAVE_G___EXCEPTION_H */ /* Define if you have the header file. */ /* #undef HAVE_IO_H */ /* Define if you have the header file. */ /* #undef HAVE_NDIR_H */ /* Define if you have the header file. */ #define HAVE_STDARG_H 1 /* Define if you have the header file. */ #define HAVE_STRING_H 1 /* Define if you have the header file. */ //#define HAVE_STRINGS_H 1 /* Define if you have the header file. */ /* #undef HAVE_SYS_DIR_H */ /* Define if you have the header file. */ /* #undef HAVE_SYS_LOCKING_H */ /* Define if you have the header file. */ /* #undef HAVE_SYS_NDIR_H */ /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if you have the header file. */ /* #undef HAVE_TVISION_TV_H */ /* Name of package */ #define PACKAGE "xbase" /* Version number of package */ #define VERSION "2.0.0" /* Should we include generic index support? */ #if defined(XB_INDEX_NDX) || defined(XB_INDEX_NTX) #define XB_INDEX_ANY 1 #endif /* expressions required for indexes */ #if defined(XB_INDEX_ANY) && !defined(XB_EXPRESSIONS) #define XB_EXPRESSIONS 1 #endif /* default memo block size */ #define XB_DBT_BLOCK_SIZE 512 /* filename path separator */ #define PATH_SEPARATOR '/' #ifndef HAVE_BOOL #define HAVE_BOOL 1 typedef int bool; const bool false = 0; const bool true = 1; #endif xbase-2.0.0/xbase/makefile.g950000644000000000000000000001022107203043261011440 # This file is part of the XBase libraries # Copyright (C) 2000 Derry Bryson # # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # xdb.sourceforge.net # # # Makefile for Mingw32/Cygwin. This makefile builds both a static and DLL # version of the XBase library. Note, this makefile was derived from the # c++ example in Mumit Kahn's dllhelper archive. # CC = gcc CXX = c++ # # Uncomment the next line to enable debug code. Note that XBASE_DEBUG # is also (possibly) defined in xbconfigw32.h (it is by default). # #DEBUG = -g -DXBASE_DEBUG CXXFLAGS = -O2 $(DEBUG) -Wall --pipe -fvtable-thunks CFLAGS = -02 $(DEBUG) -Wall --pipe CPPFLAGS = -I.. AS = as DLLTOOL = dlltool DLLWRAP = dllwrap exeext = .exe # # Various targets to build. # DLL_NAME = xbasedll.dll DLL_EXP_LIB = libxbasedll.a DLL_EXP_DEF = xbasedll.def STATICLIB_NAME = libxbase.a DLL_OBJ_DIR = dobj STATIC_OBJ_DIR = sobj all: $(DLL_OBJ_DIR) $(STATIC_OBJ_DIR) $(DLL_NAME) $(STATICLIB_NAME) $(DLL_OBJ_DIR) : -md $(DLL_OBJ_DIR) $(STATIC_OBJ_DIR) : -md $(STATIC_OBJ_DIR) # # DLL related variables. These are used when building the DLL. See later. # # Must define XBMAKINGDLL when building the DLL. Otherwise import/exports # will not work correctly. DLL_CFLAGS = -DXBMAKINGDLL -mdll # The default entry point defined by dllwrap; the default user callback # is DllMain, and there is stub in dllinit.c. DLL_LDFLAGS = # any extra libraries that your DLL may depend on. DLL_LDLIBS = -lstdc++ OBJS = \ dbf.o \ exp.o \ expfunc.o \ expproc.o \ fields.o \ html.o \ index.o \ lock.o \ memo.o \ ndx.o \ ntx.o \ stack.o \ xbase.o \ xbexcept.o \ xbfilter.o \ xbstring.o \ xdate.o DLL_OBJS = $(addprefix $(DLL_OBJ_DIR)/,$(OBJS)) STATIC_OBJS = $(addprefix $(STATIC_OBJ_DIR)/,$(OBJS)) # # Note that we let dllwrap create both the DEF and IMPORT library in # one shot. No need to run dlltool anymore. # DLLWRAP_FLAGS = --export-all --output-def $(DLL_EXP_DEF) \ --implib $(DLL_EXP_LIB) \ --driver-name $(CXX) $(DLL_NAME) $(DLL_EXP_DEF) $(DLL_EXP_LIB): $(DLL_OBJS) $(CC) -shared -o $@ -Wl,--output-def,$(DLL_EXP_DEF) \ -Wl,--out-implib,$(DLL_EXP_LIB) $(DLL_OBJS) \ $(DLL_LDFLAGS) $(DLL_LDLIBS) # $(DLLWRAP) $(DLLWRAP_FLAGS) -o $(DLL_NAME) \ # $(DLL_OBJS) $(DLL_LDFLAGS) $(DLL_LDLIBS) $(STATICLIB_NAME) : $(STATIC_OBJS) ar -ru $(STATICLIB_NAME) $(STATIC_OBJS) ranlib $(STATICLIB_NAME) clean: -rm -f $(DLL_OBJS) $(STATIC_OBJS) $(DLL_NAME) $(DLL_EXP_LIB) $(DLL_EXP_DEF) $(STATICLIB_NAME) # # dependencies (need better ones!). # $(DLL_OBJS) $(STATIC_OBJS) : \ xbase.h \ dbf.h \ exp.h \ html.h \ index.h \ ndx.h \ ntx.h \ retcodes.h \ xbase.h \ xbconfigw32.h \ xbexcept.h \ xbfilter.h \ xbstring.h \ xdate.h \ xstack.h \ xtypes.h # # default rules for building DLL objects. Note that client programs (ie., # the ones that *use* the DLL) have to be compiled without the DLL_CFLAGS # flags. # $(DLL_OBJ_DIR)/%.o : %.cpp $(CXX) -c $(DLL_CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< $(DLL_OBJ_DIR)/%.o : %.c $(CC) -c $(DLL_CFLAGS) $(CPPFLAGS) $(CFLAGS) -o $@ $< # # default rules for building static objects. # $(STATIC_OBJ_DIR)/%.o : %.cpp $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< $(STATIC_OBJ_DIR)/%.o : %.c $(CC) -c $ $(CPPFLAGS) $(CFLAGS) -o $@ $< xbase-2.0.0/xbase/xbase.ide0000644000000000000000000026713007203051746011146 Borland C++ Project File ²º¾úÎiXb,z/F,4ŒkßÐÎy É@@²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõ÷øùúûüýþÿ                         °       ! " # $ % & ' ( ) * + , - .  / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜ ™ =>?@DEUVfmwxyz{…ˆ‹Ž‘”—𠣦©¬¯²µ¸»¾ÁÄÇÊÍÐÓÖÙÜßâåèëý    –– – –––––––!–$–'–*–-–0–3–6–9–<–?–B–E–H–K–N–Q–T–W–(— ˜èŽ$ AppE&xpert...莰xbase莲.莳.def莴.rtf莵 .ha莶.hrc获.rhI莸.inc莹.asi莺 .obj莻.lib莼.resèŽ(½StripAutoDependsèŽ,¾Remove &AutoDependsèŽ@¿)Remove all [AutoDepend] nodes from a nodeèŽÀ .cppèŽÁ.rcSèŽÂ.exeèŽÃ .dllèŽÄ.c¬èŽÅ.casèŽ$Æ &C CompiležèŽÇ.asmèŽ$Ȭ AppExpertDllèŽÉ$TASMèŽ Ê$IMPLIB~èŽ<Ë"$NOSWAP $CAP MSG(HC312MSG) $EDNAMEèŽÌ.hlpèŽÍ.hpjèŽ Î cpp/cpp32èŽ\ÏD$NOSWAP $CAP MSG(BORL2MSG) +$RSP(-I$INC -D1;$DEF -o$OUTNAME) $EDNAMEèŽÐ.i”èŽÑ$ARGSèŽ Ò]$EDNAME†èŽÓ.kb~èŽÔ.dlgèŽÕ.txtèŽÖ.sppèŽ(×AppExpertDll.cXèŽ4Ø$SAVE ALL $TD $EXENAME $ARGNèŽ(Ù&Turbo DebuggerAèŽ<Ú%Turbo Debugger on current target nodeèŽ,Û$TD -l $EXENAME $ARGèŽÜb.exeèŽ4Ý-m"goto_line $LINE" $EDNAMEèŽ Þ$OUTNAMEèŽ ßgrep.comèŽLà3-n+ $NOSWAP$CAP MSG(GREP2MSG)$PROMPT void $SELNODES×èŽ áws32.exeèŽ â OwlCovertèŽ$ã owlcvt.exe´èŽ(äConvertOWL1SourceèŽLå3+$RSP($OWLCVT) $SELNODES $CAP MSG(BORL2MSG) $NOSWAP¡èŽLæ4Convert currently selected nodes from OWL 1 to OWL 2èŽ$ç regist32.exeèŽ,è$TARGET -RegServerrèŽDé,Register the current target as an OLE serverèŽ,ê$TARGET -UnregServerèŽ0ë&Unregister OLE ServerKèŽHì.Unregister the current target as an OLE server?èŽí.prjèŽ$î RunScriptFileèŽ,ï&Load and Run ScriptèŽ4ðLoad and run a cScript fileèŽ4ñHelp_Compiler 32bit hcrtf.exeèŽ ò hcrtf.exeèŽ$ó CompileHLP32èŽ<ô%/xn $NOSWAP $CAP MSG(GENERIC) $EDNAMEèŽLõ2Compile help project node .hpj to Windows 4.0 .hlpÝèŽ4÷Create an AppExpert project¹èŽ øURescanèŽ$ùT idOutputPathèŽTúT:Rescan the header files to recreate the AppExpert database£èŽûT.apxèŽ(üRC_File_Editor‡èŽ$ý EditResourceèŽ(þEdit &ResourcesõèŽ$ÿ Edit resourceèŽ .fntèŽ, Bitmap_File_EditorèŽ( EditBitmapFileèŽ$  Edit &BitmapèŽ$  Edit bitmapèŽ .bmpèŽ .rleèŽ, Cursor_File_EditorÑèŽ( EditCursorFileÆèŽ$  Edit &CursorèŽ( Edit cursor fileèŽ .curèŽ( Icon_File_EditorèŽ$  EditIconFileèŽ$  Edit &IconèŽ( Edit icon file†èŽ .icoèŽ( Res_File_EditorâèŽ, EditBinaryResources èŽ0 Edit &Binary Resources èŽ .drvèŽ .vbxèŽ .cplèŽ .fonèŽ( ASFN:xbase.dll4sèŽ tex58èŽ   c0d32.objèŽ$  import32.libèŽ   cw32i.libèŽ DoDoèŽ   xdate.cppèŽ  exp.cppReèŽ$  expfunc.cpprSèŽ$!  expproc.cpppèŽ$"  fields.cppèŽ # html.cpp èŽ $  index.cppèŽ % lock.cppEèŽ & memo.cppèŽ ' ndx.cppèŽ ( ntx.cppfoèŽ )  stack.cppèŽ *  xbase.cppèŽ$+  xbexcept.cppcèŽ,,  xbfilter.cppad Code)èŽ(-  xbstring.cppull)èŽ . dbf.cppÌèŽ0/ -..\XBASE\XBCONFIGW32.H‘èŽ(0 0..\xbase/xbase.hèŽ01 0C:\BC5\INCLUDE\string.h{èŽ02 3C:\BC5\INCLUDE\_defs.hoèŽ03 0C:\BC5\INCLUDE\stddef.hcèŽ04 3C:\BC5\INCLUDE\_null.hWèŽ05 0C:\BC5\INCLUDE\windows.hèŽ86 0C:\BC5\INCLUDE\win32\windows.hèŽ07 0C:\BC5\INCLUDE\excpt.h«èŽ08 0C:\BC5\INCLUDE\stdarg.hŸèŽ09 0C:\BC5\INCLUDE\windef.h“èŽ0: 0C:\BC5\INCLUDE\winnt.h‡èŽ4; 0C:\BC5\INCLUDE\win32\winnt.hèŽ0< 0C:\BC5\INCLUDE\ctype.hnèŽ0= 0C:\BC5\INCLUDE\pshpack4.hèŽ0> 0C:\BC5\INCLUDE\poppack.hèŽ0? 0C:\BC5\INCLUDE\pshpack1.hèŽ0@ 0C:\BC5\INCLUDE\winbase.hèŽ8A 0C:\BC5\INCLUDE\win32\winbase.h(èŽ0B 0C:\BC5\INCLUDE\winerror.hèŽ0C 0C:\BC5\INCLUDE\wingdi.hèŽ4D 0C:\BC5\INCLUDE\win32\wingdi.hèŽ0E 0C:\BC5\INCLUDE\pshpack2.hèŽ0F 0C:\BC5\INCLUDE\winuser.h èŽ8G 0C:\BC5\INCLUDE\win32\winuser.h èŽ0H 0C:\BC5\INCLUDE\winnls.hüèŽ4I 0C:\BC5\INCLUDE\win32\winnls.hèŽ0J 0C:\BC5\INCLUDE\wincon.h>èŽ4K 0C:\BC5\INCLUDE\win32\wincon.hèŽ0L 0C:\BC5\INCLUDE\winver.h1 èŽ4M 0C:\BC5\INCLUDE\win32\winver.hèŽ0N 0C:\BC5\INCLUDE\winreg.h›èŽ4O 0C:\BC5\INCLUDE\win32\winreg.hèŽ0P 0C:\BC5\INCLUDE\winnetwk.hèŽ8Q 0C:\BC5\INCLUDE\win32\winnetwk.hvèŽ0R 0C:\BC5\INCLUDE\cderr.hhèŽ4S 0C:\BC5\INCLUDE\win32\cderr.hèŽ,T 0C:\BC5\INCLUDE\dde.hèŽ4U 0C:\BC5\INCLUDE\win32\dde.hÎèŽ0V 0C:\BC5\INCLUDE\ddeml.hÁèŽ4W 0C:\BC5\INCLUDE\win32\ddeml.hèŽ,X 0C:\BC5\INCLUDE\dlgs.hèŽ4Y 0C:\BC5\INCLUDE\win32\dlgs.h7èŽ0Z 0C:\BC5\INCLUDE\lzexpand.hèŽ8[ 0C:\BC5\INCLUDE\win32\lzexpand.hèŽ0\ 0C:\BC5\INCLUDE\mmsystem.hèŽ,] 0C:\BC5\INCLUDE\nb30.hèŽ4^ 0C:\BC5\INCLUDE\win32\nb30.hãèŽ,_ 0C:\BC5\INCLUDE\rpc.h èŽ4` 0C:\BC5\INCLUDE\win32\rpc.hF èŽ0a 0C:\BC5\INCLUDE\rpcdce.h9 èŽ4b 0C:\BC5\INCLUDE\win32\rpcdce.hèŽ0c 0C:\BC5\INCLUDE\rpcdcep.hèŽ8d 0C:\BC5\INCLUDE\win32\rpcdcep.h—èŽ0e 0C:\BC5\INCLUDE\rpcnsi.h‰èŽ4f 0C:\BC5\INCLUDE\win32\rpcnsi.hèŽ0g 0C:\BC5\INCLUDE\rpcnterr.hèŽ8h 0C:\BC5\INCLUDE\win32\rpcnterr.hèŽ0i 0C:\BC5\INCLUDE\shellapi.hèŽ8j 0C:\BC5\INCLUDE\win32\shellapi.hN èŽ0k 0C:\BC5\INCLUDE\winperf.h èŽ8l 0C:\BC5\INCLUDE\win32\winperf.h4 èŽ0m 0C:\BC5\INCLUDE\winsock.hèŽ0n 0C:\BC5\INCLUDE\commdlg.hèŽ8o 0C:\BC5\INCLUDE\win32\commdlg.h‘èŽ0p 0C:\BC5\INCLUDE\winspool.hèŽ8q 0C:\BC5\INCLUDE\win32\winspool.hwèŽ0r 0C:\BC5\INCLUDE\prsht.h_èŽ0s 0C:\BC5\INCLUDE\pshpack8.hèŽ,t 0C:\BC5\INCLUDE\ole2.hèŽ4u 0C:\BC5\INCLUDE\win32\ole2.h<èŽ0v 0C:\BC5\INCLUDE\objbase.hèŽ0w 0C:\BC5\INCLUDE\rpcndr.h#èŽ4x 0C:\BC5\INCLUDE\win32\rpcndr.hèŽ0y 0C:\BC5\INCLUDE\rpcnsip.hèŽ8z 0C:\BC5\INCLUDE\win32\rpcnsip.h* èŽ0{ 3C:\BC5\INCLUDE\stdlib.h èŽ0| 0C:\BC5\INCLUDE\wtypes.hièŽ0} 0C:\BC5\INCLUDE\unknwn.hp èŽ4~ 0C:\BC5\INCLUDE\win32\unknwn.hèŽ0 0C:\BC5\INCLUDE\objidl.hW èŽ4€ 0C:\BC5\INCLUDE\win32\objidl.hèŽ0 0C:\BC5\INCLUDE\cguid.h> èŽ4‚ 0C:\BC5\INCLUDE\win32\cguid.h èŽ0ƒ 0C:\BC5\INCLUDE\oleauto.hèŽ0„ 0C:\BC5\INCLUDE\oaidl.hœèŽ0… 0C:\BC5\INCLUDE\oleidl.hèŽ4† 0C:\BC5\INCLUDE\win32\oleidl.hèŽ0‡ 0C:\BC5\INCLUDE\winsvc.hy èŽ4ˆ 0C:\BC5\INCLUDE\win32\winsvc.hèŽ4‰ 0C:\BC5\INCLUDE\win32\mcx.h` èŽ4Š 0C:\BC5\INCLUDE\win32\imm.hS èŽ(‹ 3..\xbase/xtypes.hèŽ0Œ 3C:\BC5\INCLUDE\stdio.h< èŽ0 3C:\BC5\INCLUDE\_nfile.h0 èŽ,Ž 3..\xbase/retcodes.h§èŽ( 0..\xbase/xdate.hèŽ0 3..\xbase/xbconfigw32.hˆèŽ,‘ 0..\xbase/xbstring.h|èŽ0’ 0C:\BC5\INCLUDE\iostream.hèŽ(“ 0..\xbase/exp.heèŽ(” 0..\xbase/xstack.hèŽ(• 0..\xbase/dbf.hQèŽ(– 0..\xbase/index.hèŽ(— 0..\xbase/ndx.h=èŽ(˜ 0..\xbase/ntx.h3èŽ,™ 0..\xbase/xbfilter.h),>b~–²Îê">Zv’®ÖB^z–²Îê*NjŠÆâþ z – ² Ò î & B j ž Æ  . J ~ ž ¾ * J n – â . R ~  î f‚¦Ò:Z~º:Z~Òî:b†¢Îö>Zv¢Êî2Z~¢Êæ:j†¢¾Ú>b‚ž¾Þ&JjŠªÊê *JnšÂâ:jšÊú*b’Âò"V†¶æF~®ÞBrªÚ>r¢Ö:j¢Ò2f–Êö* Z ’  î "!N!‚!²!æ!"N"~"²"â"#J#‚#²#ê#$J$‚$²$ê$%J%v%ª%Ú% &>&n&¦&Ö&'6'j'š'Î'þ'2(b(’(Â(ö(&)Z)Ž)Â)ê)*J*v*ž*Î*ú**+R+z+¢+Ê+ò+,È=¶S QŒkßÈ":œÖÈ"êëÈ"ì4ëFÈ"îPë@`h$°níÈ"ðlë è, È#%— è, É O–t hs§£¢²¦¤d±¥ è, ÊO–THs§£¦¢ è,ËO–$s§ è,ÌO–,  ´Í è,ÍO–,  ´Í è,ÎO–$ Í è,ÏO–,3__DEBUG=2;__TRACE;__WARN è,Ð O– `h$ ˜|Fíg„ O– g„ O– g„  !O–! g„" Ðë#O–#  è,$ %™`h$&  ~í g„' (O–( `h$) Bí`h$* €Bí`h$+ ªí`h$, ‚ªí`h$- è  ƒªí`h$.! „ªí`h$/" …ªí`h$0# †ªí`h$1$ ‡ªí`h$2% ˆªí`h$3& ‰ªí`h$4' Šªí`h$5( ‹ªí`h$6) Œªí`h$7* ªí`h$8+ Žªí`h$9, ªí`h$:- ªí`h$;. ‘ªíO– <Úag)Æ;œü ’èŽ(=0..\xbase/html.hèŽ0>C:\BC5\INCLUDE\errno.hèŽ,?'..\xbase/xbexcept.hèŽ(@AutoDepReferenceg„A@BO–ˆB|€o. ‘`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)> !?»`g)O– CÚag))$ð’èŽ(D..\XBASE\XBASE.HèŽ0E..\xbase\xbconfigw32.hg„F@GO–ˆG|€o- m_g)Dag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)0 ag)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)E¢ag)?»`g)O– HÚag)>@ß’g„I@JO–€Jt€n, v_g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)?»`g)O– KÛag)£¬-’g„L@MO–hM\@ + `g)/ ¢ag){  !2  !4  !Ž x‡^)?»`g) ¢ag)‹ x‡^)Œ  !  !O– NÛag)†‡’g„O@PO–€Pt€n*  `g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)?»`g)O– QÛag)oæ’g„R@SO–xSl€m) `g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)O– TÛag)€I' ’èŽ0UC:\BC5\INCLUDE\sys/stat.hèŽ4VC:\BC5\INCLUDE\sys/types.hg„W@XO–X„€p( #`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)U !V !?»`g)O– YÜag)iN”# ’g„Z@[O–€[t€n' -`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)?»`g)O– \Üag)øXK’g„]@^O–€^t€n& 7`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)?»`g)O– _Üag)_’g„`@aO–xal€m% G`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)O– bÜag)8„N’g„c@dO–xdl€m$ Q`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)O– eÝag), |E’èŽ0fC:\BC5\INCLUDE\fcntl.hg„g@hO–h„€p# Z`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)f !V !?»`g)O– iÝag)U4Á’g„j@kO–€kt€n" g`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)?»`g)O– lÝag)€’èŽ,mC:\BC5\INCLUDE\math.hg„n@oO–ˆo|€o! r`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)m !?»`g)O– pÝag)¼ .’g„q@rO–ˆr|€o {`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)m !?»`g)O– sàag)d  ’g„t@uO–€ut€n †`g)/ ¢ag)0 ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)?»`g)O– vàag)¿T(’èŽ0wC:\BC5\INCLUDE\CTYPE.H"à!èŽ0xC:\BC5\INCLUDE\STDIO.HˆèŽ0yC:\BC5\INCLUDE\STDLIB.Hð èŽ0zC:\BC5\INCLUDE\STRING.Hè)èŽ,{C:\BC5\INCLUDE\TIME.Hg„$|@}ì@ l O– }”€r œ`g)w !2  !x !  !4  !y !z !3  !{ !E¢ag)0 ag)1  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !Ž x‡^) Ø`g) ¢ag)‘ Ì`g)’  !“ x‡^)” OT<)• ¨`g)– x‡^)— x‡^)˜ x‡^)™ OT<)=Â`g)È"~ ’¬ë;hèŽ$ xbase source`h$€ô“:í`h$‚(—”Bíg„$ƒ (H넪PO–„ èŽ0…ASFN:xbase.lib5 ! è,†…œHë‡O–D‡5öò€ôù3 _RTLDLL;èŽ ˆ( ? ªPg„$‰ˆT&šªPèŽ$‹% = ªPg„$Œ‹ü&šªPèŽ$Ž" ; ªPg„$ޤ &šªP莑 9 g„’‘œS&0šèŽ”" 7 g„•”D$&šèŽ—" 5 g„˜—ä'&šèŽš" 3 g„›š|+&šèŽ" 1 g„ž,/&šèŽ  / g„¡ Ì2&šèŽ£ - g„¤£l6& šèަ ) g„§¦:&"šèŽ© % g„ª©œ=&$šèެ ! g„­¬LA&&šèޝ  g„°¯ìD&(šè޲  g„³²”H&*šè޵(  g„¶µšèŽÓ S g„ÔÓà :œèŽÖ Q g„×Ö( :œèŽÙ O g„ÚÙ„:œèŽÜ M g„ÝÜà:œèŽß K g„àßP: œèŽ â I ì@ g„ãâ˜: œèŽå G g„æåä: œèŽè E g„éè0:œèŽ$ë C ì@ l g„ìë`*:œèŽý^>g„þýt&šèŽ  ^<g„  &šèŽ  ^:g„  Ä &šèŽ ^8g„  ¼S&1šèŽ  ^6Rg„  d$&š4Plˆ¬Èô ”À@d¼è@d¼èô4Lh€œ´Ðè8Tl´Øü DhŒ°Ôø@dˆ¬Ðô8`¼ä ˆ ¨ Ð  ¤Äà`€œ$@Ààüt”Äø¤ Ä à `$€$œ$(<(X(Ð+ð+ ,„/¤/Ô/ð/€3 3¼3<7\7ˆ7¤7,;L;h;ð>?,?¬BÌBüB,C\CŒC¸CÜC|G˜G¼GàGH(H@HpHœHàHI$IHIlII´IÐIìIJ$J@J\JxJ”J°JÌJèJK Kþÿÿÿ-Æ@hF#' ÌàT Aþÿÿÿ-BCiF$(ÌàT Dþÿÿÿ-EF`F$)ÌàT Gþÿÿÿ-HIkF#* ÌàTJþÿÿÿ-KLjF#+ 4U$MþÿÿÿÄ8ø/-ÌàTOþÿÿÿ-PQa-",ÌàTRþÿÿÿ-STb-"0ì0Bí4U$UþÿÿÿèTî2-ÌàTWþÿÿÿ-XYQFS14U$_þÿÿÿ\Ø4-ÌàTaþÿÿÿ-bcc/"tì34U$iþÿÿÿøÔÙ7jÌàTkþÿÿÿjÉlmeF#5 4U$nþÿÿÿ€œß9oÌàTpþÿÿÿoÊqrd/$dì8Bí4U${þÿÿÿÀNÛ<|ÌàT}þÿÿÿ|Ë~lF$:4U$dþÿÿÿ [Ù>ÎÌàTfþÿÿÿÎÏghmF$=4U$€ýÿÿÿ|¶ã@-ÌàT‚ýÿÿÿ-у„-Ìì?ÌàT …ýÿÿÿ-ц‡‘-ÌìA4U$!ˆýÿÿÿ<÷ôG-ÌàT"Šýÿÿÿ-Ò‹Œ0F˜ì! B4U$#ýÿÿÿDèôJ-ÌàT$ýÿÿÿ-‘A ì# H4U$%’ýÿÿÿúL-ÌàT&“ýÿÿÿ-ØÙÚ’1ˆ ì% KÌàT'•ýÿÿÿ-Û–—’ˆ ì% M4U$(˜ýÿÿÿ€îðOÜÌàT)™ýÿÿÿÜš›FT ì( NÌàT*œýÿÿÿÜÝšžFT ì(PÌàT+ŸýÿÿÿÜÒš¡FT ì(Q4U$,©ýÿÿÿdJïSªÌàT-«ýÿÿÿªÞ¬­t ì,R4U$.³üÿÿÿ©TßÌàT/´üÿÿÿß൶ .4U$0·üÿÿÿUáÌàT1¸üÿÿÿṺ 04U$2âþÿÿÿlÐîWãÌàT3äþÿÿÿãåÀæF$2V4U$4Âþÿÿÿ îYçÌàT5ÂþÿÿÿçèÃé-$4X4U$6Åþÿÿÿ@ ÷[çÌàT7Åþÿÿÿçêëì-$6Z4U$8Îýÿÿÿd¹ë^-ÌàT9Îýÿÿÿ-ÒÏ Dì8\4U$:îþÿÿÿ@ëò`-ÌàT;îþÿÿÿ-ïðÀF$:_4U$<ñþÿÿÿ„äóbòÌàT=óþÿÿÿòô~õF$<a4U$>ýÿÿÿ¬Âd-ÌàT?ýÿÿÿ-Ò÷¡¬ì>c4U$@®ýÿÿÿì»Îf-ÌàTA®ýÿÿÿ-Ò±²€$ì@(e4U$Bøþÿÿÿòh-ÌàTCøþÿÿÿ-ù7ú$œìB)gí!4U$Düýÿÿÿ8€äk-ÌàTEýýÿÿÿ-ÒþÿZFìDi4U$F ýÿÿÿøo-ÌàTG ýÿÿÿ-Ò  [FŒìFl4U$H ýÿÿÿȹ—r-ÌàTI ýÿÿÿ-Ò  \FìHp4U$J ýÿÿÿDÖŠu-ÌàTK ýÿÿÿ-Ò  ]F|ìJs4U$L ýÿÿÿÄàâ{-ÌàTM ýÿÿÿ-Ò ÿ^-ôìLv(LpÄlÀ8Œà4ˆÜ0T¨ü t˜ìdˆÜTxÌðD˜¼ 4 ˆ ¬ T x Ì t ˜ ì  d ˆ Ü T x Ì ð Dh¼à4X¬Ð$HœÀ8Œ°(| ôî| & VŒkßHÌ É¶))      !"#$%&'()*^4¼ì"^4$ÉÛ-HìATì^4 ^Òlì^4 ˜‡Âhì9lì^4³ ¼ì"pì^4´^4µ¼ì"Äì^4 ¶^4 ·¼ì"^4 ¸^4 ¹^4 ºì^4» X͘ì^4¼ìM^4À$X0â¼ì"8ì ^4Á 8ìE^4Â!ðì^4Ã$Ý¥"ìM¨ì^4Ä#¼ì"Œì ^4Å%Œì ^4Ç6¼ì"^4È ù~.HìATì^4Ì^4Í;¼ì"^4Ð^4ÓC¼ì"^4ÔD^4ÕE¼ì"^4ÖF¼ì";^4×I^4 í]hì9^4!û^4"  j^4# m°ìG^4$ n°ìG^4% q(ìI^4& t ìK^4' w^4( x^4) y^4* zÒ:n¢Ö >r¦ÚBvªÞFz®âJ~²æN‚¶êR†ºî"VоòPi&hdŒkß°µh& š É>   $†&d(žšŒkßH‘Ôˆë Ér&)*+,-./0123456789:;€‚(Àb(D|ÈŒkß(ðïh¬Döÿÿÿ ˆëò O– h¬Döÿÿÿ¼ð>@ôë}O– h¬Döÿÿÿë&O– h¬Döÿÿÿ lë)O– h¬D  öÿÿÿ ë*O– h¬D  öÿÿÿv ´ë+h¬D  öÿÿÿ„ð+¼Gë€Yh¬D  öÿÿÿs  Øë,O– h¬Döÿÿÿp  üë-h¬Döÿÿÿ´ë+ h¬Döÿÿÿl  ë.O– h¬Döÿÿÿi Dë/h¬DöÿÿÿØë, h¬Döÿÿÿe hë0O– h¬Döÿÿÿb Œë1h¬Döÿÿÿüë- h¬Döÿÿÿ_ °ë2O– h¬Döÿÿÿ\ Ôë3h¬Döÿÿÿ ë. h¬DöÿÿÿY øë4O– h¬DöÿÿÿT ë5h¬D  öÿÿÿ"Dë/ h¬D!!öÿÿÿQ @ë6O– "h¬D##öÿÿÿN !dë7h¬D$$öÿÿÿ& hë0 h¬D%%öÿÿÿK #ˆë8O– &h¬D''öÿÿÿH %¬ë9h¬D((öÿÿÿ*$Œë1 h¬D))öÿÿÿC 'Ðë:O– *h¬D++öÿÿÿ< )ôë;h¬D,,öÿÿÿ-(°ë2 O– -h¬D..öÿÿÿ/,Ôë3 O– /h¬D00öÿÿÿ1.øë4 O– 1h¬D22öÿÿÿ30ë5 O– 3h¬D44öÿÿÿ52@ë6 O– 5h¬D66öÿÿÿ74dë7 O– 7h¬D88öÿÿÿ96ˆë8 O– 9h¬D::öÿÿÿ;8¬ë9 O– ;h¬D<<öÿÿÿ=:Ðë: O– =h¬D>>öÿÿÿ?<ôë; O– ?h¬D@@öÿÿÿ ðAbàG나ì!•O– Ah¬DBBöÿÿÿC@´ë+ O– Ch¬DDDöÿÿÿE@BØë, O– Eh¬DFFöÿÿÿG@Düë- O– Gh¬DHHöÿÿÿI@F ë. O– Ih¬DJJöÿÿÿK@HDë/ O– Kh¬DLLöÿÿÿM@Jhë0 O– Mh¬DNNöÿÿÿO@LŒë1 O– Oh¬DPPöÿÿÿQ@N°ë2 O– Qh¬DRRöÿÿÿS@PÔë3 O– Sh¬DTTöÿÿÿU@Røë4 O– Uh¬DVVöÿÿÿW@Të5 O– Wh¬DXXöÿÿÿY@V@ë6 O– Yh¬DZZöÿÿÿ[@Xdë7 O– [h¬D\\öÿÿÿ]@Zˆë8 O– ]h¬D^^öÿÿÿ_@\¬ë9 O– _h¬D``öÿÿÿa@^Ðë: O– ah¬Dbböÿÿÿc@`ôë; O– c(lx¼È \h¬¸ü@„Ô\h¬ð4@„È \ äð4x¼È P” ä(lx¼ P \   ¬ ð ü @ L œ à ì 0 < € Œ Ð Ü , p | À Ì   ` l ° ¼  P\ ¬ðü@Lœàì0<€ŒÐÜ ,pÿ—62ŒkߌpÝ É°c :6Œkß É °c 62ŒkßÞÎ É  ¼ž ²®ŒkßTƒØ É’ !#%(,.02468:<>@BDFHJL¬¶ :6Œkß É W„ JFŒkß É* ")*+W„62Œkß ÉVFBŒkß8°  É&¬¶JFŒkß É*    W„b^Œkß ÉB      "$)*+W„62Œkß ÉW„:6Œkß É"W„62Œkß ÉW„62Œkß ÉW„:6Œkß É"¬¶>:Œkß É W„62Œkß ÉW„B>Œkß|Øý É"W„:6Œkß ÉM¬¶:6Œkß ÉW„62Œkߤ×ý ÉW„>:Œkßì×ý É9?¬¶JFŒkß É*W„b^ŒkßøTâ ÉB     ")*+3W„ NJŒkß É. ")*+EW„!ZVŒkß É:!  $&'57MW„"RNŒkß4Øý É2"$57MW„#b^Œkß ÉB#      ")*+¬¶$B>Œkßðeª É"$W„%:6Œkß É%  V&JFŒkß؆ É*&     ¬¶'>:Œkß É'¬¶(>:Œkß É(¬¶)>:Œkß É)¬¶*>:Œkß É*¬¶+>:Œkß É+¬¶,B>Œkß É",W„-^ZŒkßôàý É>-  $&'57?ACW„.JFŒkßÜ!ì É*.57?ACV/:6Œkßœ…´ É/¬¶062ŒkßDfâ É0¬¶162Œkß É1V262ŒkßFÌ É2¬¶362Œkß`âú É3V462ŒkßFÌ É4¬¶562Œkß É5W„6FBŒkß É&6")*+V762Œkß8FÌ É7¬¶8>:Œkß e˜ É8V962ŒkßTFÌ É9¬¶:62Œkß É:W„;NJŒkß É.;")*+-=V<62ŒkßpFÌ É<¬¶=:6Œkß É=V>62ŒkߌFÌ É>¬¶?:6ŒkßDXâ É?V@:6ŒkߨFÌ É@ ¬¶A:6Œkß Yâ ÉA¬¶BfbŒkßÔ#â ÉFB  W„C62Œkß ÉC"W„D62Œkß ÉD"W„E62Œkß ÉE"W„F:6Œkß ÉF";VG62ŒkßÄFÌ ÉG"¬¶HFBŒk߈ôá É&HW„I62Œkß ÉI$VJ62ŒkßàFÌ ÉJ$¬¶K:6Œkßäõá ÉKVL:6ŒkßüFÌ ÉL&'¬¶M:6Œkß@÷á ÉM¬¶NNJŒkßœøá É.NVO>:ŒkßGÌ ÉO)*+¬¶PNJŒkßøùá É.P¬¶QNJŒkßTûá É.Q¬¶R62Œkß°üá ÉRVS62Œkß4GÌ ÉS-VT62ŒkßPGÌ ÉT/VU62ŒkßlGÌ ÉU1¬¶V62Œkß ÉVVW62Œk߈GÌ ÉW3¬¶XB>Œkß É"XVY62ŒkߤGÌ ÉY5¬¶ZB>Œkß É"ZV[62ŒkßÀGÌ É[7¬¶\:6Œkß°áý É\ W„]62Œkß É]9V^62ŒkßÜGÌ É^9¬¶_62Œkß É_V`62ŒkßøGÌ É`;¬¶a62Œkß ÉaVb62Œkß`Ûý Éb=¬¶c>:Œkß%â ÉcVd62ŒkߨÛý Éd?¬¶e:6Œkß`&â ÉeVf62ŒkßðÛý ÉfA¬¶g:6Œkß ÉgVh62Œkß8Üý ÉhC¬¶i:6Œkß¼'â Éi"W„j62Œkß ÉjEVk62Œk߀Üý ÉkE¬¶l:6Œkß)â Él#$W„m62Œkß ÉmGW„n62Œkß ÉnGVo62ŒkßÈÜý ÉoG¬¶p62Œkßt*â Ép%W„q62Œkß ÉqIVr62ŒkßÝý ÉrI¬¶s62ŒkßÐ+â És&W„t62Œkß ÉtKVu62ŒkßXÝý ÉuK¬¶vNJŒkß,-â É.v'()*W„w62Œkß ÉwMW„x62Œkß ÉxMW„y62Œkß ÉyMW„z62Œkß ÉzMV{62Œkß Ýý É{Mÿ—|:6Œk߸¿Î É|"°c}62Œkß¼Š× É}$ÿ—~62ŒkßÌP™ É~ÿ—62ŒkßÐÛ Éÿ—€62ŒkßXKñ É€ ÿ—RNŒk߀$ É2 |B¹ì%–X–ÿ—‚RNŒkßxAÝ É2‚ tD¶é"–U–ÿ—ƒRNŒkßôjã É2ƒqF³æ–R–ÿ—„RNŒkßÔ á É2„nH°ã–O–ÿ—…RNŒkß$MÝ É2…j J­à–L–ÿ—†RNŒkߨßâ É2†g$LªÝ–I–ÿ—‡RNŒkßlÞ™ É2‡c(N§Ú–F–ÿ—ˆRNŒkß0h  É2ˆ`,P¤×–C–ÿ—‰RNŒkßPð× É2‰].R¡Ô –@–ÿ—ŠRNŒkße± É2ŠZ0TžÑ –=–ÿ—‹RNŒkß”ý  É2‹W2V›Î–:–ÿ—ŒRNŒkß$¡ É2Œ!R4X˜Ë–7–ÿ—RNŒkßh1² É2#O6Z•È 4–ÿ—ŽRNŒkß4Ñ­ É2Ž%L8\’Å 1–ÿ—RNŒkßDÙÜ É2'I:^ .–ÿ—RNŒkß,e± É2)F<`Œ¿ +–ÿ—‘RNŒk߈5› É2‘+A>b‰¼þ(–È=’ÌÈŒkßO–°’¤ŠŠ ‰Xj) ‰Xj) êcg)! êcg)" å{g)# ‰Xj)$ ‰Xj)% êcg)& êcg)' ‰Xj)( ‰Xj)) ‰Xj)* ‰Xj)+ ‰Xj), §Ri)- _j). ‰Xj)/ ¢ag)-0 ‰Xj)01  !02  !33  !04  !35  !06  !07  !08  !09  !0:  !0;  !0<  !0=  !0>  !0?  !0@  !0A  !0B  !0C  !0D  !0E  !0F  !0G  !0H  !0I  !0J  !0K  !0L  !0M  !0N  !0O  !0P  !0Q  !0R  !0S  !0T  !0U  !0V  !0W  !0X  !0Y  !0Z  !0[  !0\  !0]  !0^  !0_  !0`  !0a  !0b  !0c  !0d  !0e  !0f  !0g  !0h  !0i  !0j  !0k  !0l  !0m  !0n  !0o  !0p  !0q  !0r  !0s  !0t  !0u  !0v  !0w  !0x  !0y  !0z  !0{  !3|  !0}  !0~  !0  !0€  !0  !0‚  !0ƒ  !0„  !0…  !0†  !0‡  !0ˆ  !0‰  !0Š  !0‹ x‡^)3Œ  !3  !3Ž x‡^)3 ‰Xj)0 ¢ag)3‘ ýQi)0’  !0“ ‰Xj)0” ‰Xj)0• ‰Xj)0– ‰Xj)0— ‰Xj)0˜ ‰Xj)0™ &Si)0=‰Xj)0> !?‰Xj)'DE¢ag)U !V !f !m !w !x !y !z !{ !ÿ—“62Œkß°í› É“ ÿ—”:6ŒkßhJî É”@ƒ°c•62Œkßà)Ü É•†È=–&t²Œkß莖 ^4g„––(&šèŽ– ^2g„––œ+&šèŽ – ^0g„ – –L/&šèŽ – ^.g„ – –ì2&šèŽ– ^,g„––Œ6&!šèŽ– ^(g„––$:&#šèŽ– ^$g„––¼=&%šèŽ– ^ g„––lA&'šèŽ– ^g„–– E&)šèŽ– ^g„––´H&+šèŽ!–^g„"–!–\L&-šèŽ$– ^g„%–$–üO&/šèŽ'– ^bg„(–'–W&3šèŽ*–^`Lg„ +–*–-›€èŽ-–^^g„.–-–j&5šèŽ0–^\g„1–0–|i&7šèŽ3–^Zg„4–3–Ðe&9šèŽ6–^Xg„7–6–,b&;šèŽ9–^Vg„:–9–p^&=šèŽ<–^Tg„=–<–z&?šèŽ?–^Rg„@–?–H :œèŽB–^Pg„C–B–¤:œèŽE–^Ng„F–E–:œèŽH–^Lg„I–H–p:œèŽK–^Jg„L–K–¸: œèŽN–^Hg„O–N–: œèŽQ–^Fg„R–Q–P:œèŽT–^Dg„U–T–€*:œèŽW–^Bg„X–W–¨&:œ4Plˆ¤ÀÜø0Lh„ ¼Øô,Hd€œ¸Ôð ,Hd€œ¸Ôð (D`|˜´Ðì$@\x”°Ìè <XÈ=—Ò€RŒkßO–H%—;.C:\BC5\INCLUDE;../ C:\BC5\LIBõ xbase.csmÚ  !èŽ (— xbase.lib`È=˜XDŒkßèŽ, ˜ xbasedll.dll ›È=™¦h>ŒkßO–P™CöHò€ôù3_RTLDLL;XBMAKINGDLL<±%<±%<±%©î<±%<±%ø®âèÏ?•Ä<õÉ=õÎ>õyî<±%<±%­ø®âèÏ?•Ä<õÉ=õÎ>õÏ?õÐ@õ­ø®âèÏ?•Ä<õÉ=õÎ>õÏ?õÐ@õ­ø®âèÏ?Ä<õÉ=õÎ>õÏ?õÐ@õ­ø®âèÏ?•Ä<õÉ=õÎ>õÏ?õÐ@õ­ø®âèÏ?•ü¹ø¸ÏQ0Ï0Ï0ÏÌÌAÏä<±%Q0Ï0Ï?ÌÌAä<±%<±%í<±%<±%?AÏä<±%D Ráì<±%<±%?.C:\BC5\INCLUDE;..È=š¬X,X€Œkß è, š ”&šO–Àš²üÞÿý Ö%&ÿ©·ï³¶ ´$½À®ª«âÙá­µ#ü×Û  7-3./"ðõñ‰4*5*6*7*8*9*:*;*<*=*>*?*y*z*¹º»¼úûdþÿ‚vxu|†„b€Šy…k‹ˆ[hefg•c‘’”–—d]^zwŽs{m˜~o‡ƒ}q“n™›œžŸ ¡¢£°§¢s£²¦¤Õ±¥¸¿öõÚ3.10óøú ñͰ™‚ Ð…„@–ÑŒŠ‹ÌÍÎÏÓÔƒÒ ‡•˜ùôòŽ‘’“”—÷Ø× Ö Ú Ø Ù œ›žFt{qöˆùO– šw\j)Å;œ œO–ˆš|oo. ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)> !?‰Xj)O– š$_j))$öœO–ˆš|€o- _j)D‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)0 ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)E¢ag)?‰Xj)O– šx\j)>@ãœO–€štnn, §Ri)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– šx\j)†‹œO–€štnn* ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– šy\j)oêœO–xšlmm) ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)O– šz\j)€I+ œO–š„pp( ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)U !V !?‰Xj)O– šz\j)oN”' œO–€štnn' ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– š{\j)øXKœO–€štnn& êcg)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– š{\j)_œO–x!šlmm% êcg)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)O– "š{\j)8„RœO–x#šlmm$ ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)O– $š|\j), |IœO–%š„pp# ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)f !V !?‰Xj)O– &š|\j)ÌtÁœO–€'štnn" å{g)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– (š|\j)€œO–ˆ)š|oo! êcg)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)m !?‰Xj)O– *š}\j)¼ .œO–ˆ+š|oo êcg)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)m !?‰Xj)O– ,š}\j) œO–€-štnn ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– .š€\j)ïT<œO– /š”rr ‰Xj)w !2  !x !  !4  !y !z !3  !{ !E¢ag)0 ‰Xj) ¢ag)1  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)O– 0šx\j)£¬1œO–h1š\ + ‰Xj)/ ¢ag){  !2  !4  !Ž x‡^)?‰Xj) ¢ag)‹ x‡^)Œ  !  !O– 2š$_j)q;œ œO–ˆ3š|€o. ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)> !?‰Xj)O– 4š%_j)>@ãœO–€5št€n, §Ri)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– 6š%_j)£¬1œO–h7š\@ + ‰Xj)/ ¢ag){  !2  !4  !Ž x‡^)?‰Xj) ¢ag)‹ x‡^)Œ  !  !O– 8š%_j)~‹œO–€9št€n* ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– :š%_j)oêœO–x;šl€m) ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)O– <š&_j)DI+ œO–=š„€p( ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)U !V !?‰Xj)O– >š'_j)3N”' œO–€?št€n' ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)D$¬ Ì Ttô”´,LÜü| œ $<$´'Ô'L+l+ü./œ2¼2D6d6ì9 :Œ=¬=LAlAÔAôA|EœEI  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ,Si)‘ ýQi)’  !“ ÷Qi)0 §ei)” 1Si)• Ùfi)– ei)— Ždi)˜ Si)™ &Si)=Si)E¢ag)?#Si)8È=œ!è &ŒkßO– œ'_j)øXKO–€œt€n& êcg)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– œ(_j)_O–xœl€m% êcg)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)O– œ(_j)4„RO–xœl€m$ ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)O– œ(_j), |IO–œ„€p# ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)f !V !?‰Xj)O– œ)_j)ÆtÁO–€ œt€n" å{g)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– œ)_j)Ï€O–ˆ œ|€o! êcg)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)m !?‰Xj)O– œ*_j)n .O–ˆœ|€o êcg)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)m !?‰Xj)O– œ*_j)= O–€œt€n ‰Xj)/ ¢ag)0 ‰Xj) ¢ag)1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)?‰Xj)O– œ*_j)½T<O– œ”€r ‰Xj)w !2  !x !  !4  !y !z !3  !{ !E¢ag)0 ‰Xj) ¢ag)1  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~  !  !€  !  !‚  !ƒ  !„  !…  !†  !‡  !ˆ  !‰  !Š  !‹ x‡^)Œ  !Ž x‡^) ‰Xj)‘ ýQi)’  !“ ‰Xj)” ‰Xj)• ‰Xj)– ‰Xj)— ‰Xj)˜ ‰Xj)™ &Si)=‰Xj)8¸ØPpè  ˜¸8Xàˆ¨(H8… XTŒkß|Gë~¼4¥,z/¦/¶S\ƒd—| à hH¡žæ¡D*´6`´:š´6д²‚µ:¼µJ¶6<¶F‚¶J̶b.·6d·:ž·6Ô·6 ¸:D¸>‚¸6¸¸Bú¸:4¹:n¹6¤¹>â¹J,ºbŽºNܺZ6»Rˆ»bê»B,¼:f¼J°¼>î¼>,½>j½>¨½>æ½B(¾^†¾Jо: ¿6@¿6v¿6¬¿6â¿6À6NÀF”À6ÊÀ>Á6>Á6tÁNÂÁ6øÁ:2Â6hÂ:¢Â:ÜÂ:Ãf|Ã6²Ã6èÃ6Ä:XÄ6ŽÄFÔÄ6 Å6@Å:zÅ:´Å:îÅN<Æ>zÆNÈÆNÇ6LÇ6‚Ç6¸Ç6îÇ6$È6ZÈBœÈ6ÒÈBÉ6JÉ:„É6ºÉ6ðÉ6&Ê6\Ê6’Ê6ÈÊ>Ë6<Ë:vË6¬Ë:æË6Ì:VÌ6ŒÌ6ÂÌ:üÌ62Í6hÍ6žÍ6ÔÍ6 Î6@Î6vÎ6¬Î6âÎN0Ï6fÏ6œÏ6ÒÏ6Ð6>Ð:xÐ6®Ð6äÐ6Ñ6PÑR¢ÑRôÑRFÒR˜ÒRêÒR<ÓRŽÓRàÓR2ÔR„ÔRÖÔR(ÕRzÕRÌÕRÖRpÖRÂÖÌŽß6Äß:þß64à&ZçÒ,èX„è¦*ë¬XÖCòG! xbase-2.0.0/examples/0000777000000000000000000000000007316217172010152 5xbase-2.0.0/examples/Makefile.in0000644000000000000000000002324307316217172012137 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ GLINC = @GLINC@ GLLIB = @GLLIB@ LD = @LD@ LIBDL = @LIBDL@ LIBJPEG = @LIBJPEG@ LIBNSL = @LIBNSL@ LIBOBJS = @LIBOBJS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ NM = @NM@ PACKAGE = @PACKAGE@ PAMINC = @PAMINC@ PAMLIBPATHS = @PAMLIBPATHS@ PAMLIBS = @PAMLIBS@ RANLIB = @RANLIB@ TVPROGS = @TVPROGS@ VERSION = @VERSION@ XPMINC = @XPMINC@ XPMLIB = @XPMLIB@ XSUBDIRS = @XSUBDIRS@ X_INCLUDES = @X_INCLUDES@ X_LDFLAGS = @X_LDFLAGS@ doxygen = @doxygen@ topdir = @topdir@ x_includes = @x_includes@ x_libraries = @x_libraries@ INCLUDES = -I$(topdir) $(all_includes) LDADD = -L$(topdir)/xbase/.libs -lxbase # for shadow passwords override the value INSTALL_PROGRAM = @INSTALL@ noinst_PROGRAMS = sample1 sample2 sample3 sample4 sample5 exfilter exfilter_SOURCES = exfilter.cpp sample1_SOURCES = sample1.cpp sample2_SOURCES = sample2.cpp sample3_SOURCES = sample3.cpp sample4_SOURCES = sample4.cpp sample5_SOURCES = sample5.cpp noinst_HEADERS = EXTRA_DIST = makefile.g95 examples.ide MAINTAINERCLEANFILES = Makefile.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../xbase/xbconfig.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I../xbase CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ sample1_OBJECTS = sample1.o sample1_LDADD = $(LDADD) sample1_DEPENDENCIES = sample1_LDFLAGS = sample2_OBJECTS = sample2.o sample2_LDADD = $(LDADD) sample2_DEPENDENCIES = sample2_LDFLAGS = sample3_OBJECTS = sample3.o sample3_LDADD = $(LDADD) sample3_DEPENDENCIES = sample3_LDFLAGS = sample4_OBJECTS = sample4.o sample4_LDADD = $(LDADD) sample4_DEPENDENCIES = sample4_LDFLAGS = sample5_OBJECTS = sample5.o sample5_LDADD = $(LDADD) sample5_DEPENDENCIES = sample5_LDFLAGS = exfilter_OBJECTS = exfilter.o exfilter_LDADD = $(LDADD) exfilter_DEPENDENCIES = exfilter_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ HEADERS = $(noinst_HEADERS) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(sample1_SOURCES) $(sample2_SOURCES) $(sample3_SOURCES) $(sample4_SOURCES) $(sample5_SOURCES) $(exfilter_SOURCES) OBJECTS = $(sample1_OBJECTS) $(sample2_OBJECTS) $(sample3_OBJECTS) $(sample4_OBJECTS) $(sample5_OBJECTS) $(exfilter_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cpp .lo .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps examples/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstPROGRAMS: clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: sample1: $(sample1_OBJECTS) $(sample1_DEPENDENCIES) @rm -f sample1 $(CXXLINK) $(sample1_LDFLAGS) $(sample1_OBJECTS) $(sample1_LDADD) $(LIBS) sample2: $(sample2_OBJECTS) $(sample2_DEPENDENCIES) @rm -f sample2 $(CXXLINK) $(sample2_LDFLAGS) $(sample2_OBJECTS) $(sample2_LDADD) $(LIBS) sample3: $(sample3_OBJECTS) $(sample3_DEPENDENCIES) @rm -f sample3 $(CXXLINK) $(sample3_LDFLAGS) $(sample3_OBJECTS) $(sample3_LDADD) $(LIBS) sample4: $(sample4_OBJECTS) $(sample4_DEPENDENCIES) @rm -f sample4 $(CXXLINK) $(sample4_LDFLAGS) $(sample4_OBJECTS) $(sample4_LDADD) $(LIBS) sample5: $(sample5_OBJECTS) $(sample5_DEPENDENCIES) @rm -f sample5 $(CXXLINK) $(sample5_LDFLAGS) $(sample5_OBJECTS) $(sample5_LDADD) $(LIBS) exfilter: $(exfilter_OBJECTS) $(exfilter_DEPENDENCIES) @rm -f exfilter $(CXXLINK) $(exfilter_LDFLAGS) $(exfilter_OBJECTS) $(exfilter_LDADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< .cpp.lo: $(LTCXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = examples distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done exfilter.o: exfilter.cpp sample1.o: sample1.cpp sample2.o: sample2.cpp sample3.o: sample3.cpp sample4.o: sample4.cpp sample5.o: sample5.cpp info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(PROGRAMS) $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-noinstPROGRAMS distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xbase-2.0.0/examples/Makefile.am0000644000000000000000000000102307203046146012112 INCLUDES= -I$(topdir) $(all_includes) LDADD = -L$(topdir)/xbase/.libs -lxbase # for shadow passwords override the value INSTALL_PROGRAM = @INSTALL@ noinst_PROGRAMS = sample1 sample2 sample3 sample4 sample5 \ exfilter exfilter_SOURCES = exfilter.cpp sample1_SOURCES = sample1.cpp sample2_SOURCES = sample2.cpp sample3_SOURCES = sample3.cpp sample4_SOURCES = sample4.cpp sample5_SOURCES = sample5.cpp noinst_HEADERS = EXTRA_DIST = \ makefile.g95 \ examples.ide MAINTAINERCLEANFILES = Makefile.in xbase-2.0.0/examples/sample1.cpp0000644000000000000000000000720007164426564012143 /* $Id: sample1.cpp,v 1.6 2000/09/27 17:25:08 dbryson Exp $ Xbase project source code This program creates a sample database and four indexes Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 11/29/98 - Version 1.8 upgrade */ #include /* set the stack large for dos compiles */ #ifdef __XBDOS #include extern unsigned _stklen = 100000; #endif int main() { xbSchema MyRecord[] = { { "FIRSTNAME", XB_CHAR_FLD, 15, 0 }, { "LASTNAME", XB_CHAR_FLD, 20, 0 }, { "BIRTHDATE", XB_DATE_FLD, 8, 0 }, { "AMOUNT", XB_NUMERIC_FLD, 9, 2 }, { "SWITCH", XB_LOGICAL_FLD, 1, 0 }, { "FLOAT1", XB_FLOAT_FLD, 9, 2 }, { "FLOAT2", XB_FLOAT_FLD, 9, 1 }, { "FLOAT3", XB_FLOAT_FLD, 9, 2 }, { "FLOAT4", XB_FLOAT_FLD, 9, 3 }, { "MEMO1", XB_MEMO_FLD, 10, 0 }, { "ZIPCODE", XB_NUMERIC_FLD, 5, 0 }, { "",0,0,0 } }; /* define the classes */ xbXBase x; /* initialize xbase */ xbDbf MyFile( &x ); /* class for table */ xbNdx MyIndex1( &MyFile ); /* class for index 1 */ xbNdx MyIndex2( &MyFile ); /* class for index 2 */ xbNdx MyIndex3( &MyFile ); /* class for index 3 */ xbNdx MyIndex4( &MyFile ); /* class for index 4 */ xbShort rc; MyFile.SetVersion( 4 ); /* create dbase IV style files */ if(( rc = MyFile.CreateDatabase( "MYFILE.DBF", MyRecord, XB_OVERLAY )) != XB_NO_ERROR ) cout << "\nError creating database = " << rc << "\n"; else { /* define a simple index */ if(( rc = MyIndex1.CreateIndex( "MYINDEX1.NDX", "LASTNAME", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) cout << "\nError creating index 1 = " << rc << "\n"; /* define a multi-field index "LASTNAME FIRSTNAME" */ if(( rc = MyIndex2.CreateIndex( "MYINDEX2.NDX", "LASTNAME+FIRSTNAME", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) cout << "\nError creating index 2 = " << rc << "\n"; /* define a multi-field index "LASTNAMEFIRSTNAME" */ if(( rc = MyIndex3.CreateIndex( "MYINDEX3.NDX", "LASTNAME-FIRSTNAME", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) cout << "\nError creating index 3 = " << rc << "\n"; /* define a numeric index "ZIPCODE" */ if(( rc = MyIndex4.CreateIndex( "MYINDEX4.NDX", "ZIPCODE", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) cout << "\nError creating index 4 = " << rc << "\n"; } MyFile.CloseDatabase(); /* Close database and associated indexes */ return 0; } xbase-2.0.0/examples/sample2.cpp0000644000000000000000000001526407203047440012137 /* $Id: sample2.cpp,v 1.8 2000/11/10 19:40:16 dbryson Exp $ Xbase project source code This sample program updates the database created by the sample1 program This program demonstrates the use of the following functions/methods OpenDatabase, GetFieldNo, BlankRecord, AppendRecord, PutField and CloseDatabase Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 11/29/98 - Version 1.8 upgrade V 1.9.1 8/18/99 - Modifications to xbDate class */ #include /* set the stack large for dos compiles */ #ifdef __XBDOS #include extern unsigned _stklen = 100000; #endif int main() { xbShort lname, fname, birthdate, amount, sw, f1, f2, f3, f4, m1, rc, z; xbFloat f; xbXBase x; xbDbf MyFile( &x ); xbNdx MyIndex1( &MyFile ); xbNdx MyIndex2( &MyFile ); xbNdx MyIndex3( &MyFile ); xbNdx MyIndex4( &MyFile ); xbDate d; if(( rc = MyFile.OpenDatabase( "MYFILE.DBF" )) != XB_NO_ERROR ) cout << "\nError opening MYFILE.DBF rc=" << rc; if(( rc = MyIndex1.OpenIndex( "MYINDEX1.NDX" )) != XB_NO_ERROR ) cout << "\nError opening index1 rc=" << rc; if(( rc = MyIndex2.OpenIndex( "MYINDEX2.NDX" )) != XB_NO_ERROR ) cout << "\nError opening index2 rc=" << rc; if(( rc = MyIndex3.OpenIndex( "MYINDEX3.NDX" )) != XB_NO_ERROR ) cout << "\nError opening index3 rc=" << rc; if(( rc = MyIndex4.OpenIndex( "MYINDEX4.NDX" )) != XB_NO_ERROR ) cout << "\nError opening index4 rc=" << rc; lname = MyFile.GetFieldNo( "LASTNAME" ); fname = MyFile.GetFieldNo( "FIRSTNAME" ); birthdate = MyFile.GetFieldNo( "BIRTHDATE" ); amount = MyFile.GetFieldNo( "AMOUNT" ); sw = MyFile.GetFieldNo( "SWITCH" ); f1 = MyFile.GetFieldNo( "FLOAT1" ); f2 = MyFile.GetFieldNo( "FLOAT2" ); f3 = MyFile.GetFieldNo( "FLOAT3" ); f4 = MyFile.GetFieldNo( "FLOAT4" ); m1 = MyFile.GetFieldNo( "MEMO1" ); z = MyFile.GetFieldNo( "ZIPCODE" ); cout << "\nLast Name Id = " << lname; cout << "\nFirst Name Id = " << fname; cout << "\nBirthdate Id = " << birthdate; cout << "\nAmount Id = " << amount; cout << "\nSwitch Id = " << sw; cout << "\nFloat 1 Id = " << f1; cout << "\nFloat 2 Id = " << f2; cout << "\nFloat 3 Id = " << f3; cout << "\nFloat 4 Id = " << f4; #ifdef XB_MEMO_FIELDS cout << "\nMemo1 Id = " << m1; #endif cout << "\nZipcode Id = " << z << "\n"; /* build record one */ MyFile.BlankRecord(); /* blank out the record buffer */ MyFile.PutField( lname, "Queue" ); /* a name */ MyFile.PutField( fname, "Suzy" ); /* a name */ MyFile.PutField( birthdate, d.Sysdate()); /* a date */ MyFile.PutField( amount, "99.99" ); /* an amount */ MyFile.PutField( sw, "Y" ); /* a switch */ f = 1.466f; MyFile.PutFloatField( f1, f ); MyFile.PutFloatField( "FLOAT2", f ); MyFile.PutField( f3, "1" ); MyFile.PutField( f4, "1" ); MyFile.PutField( z, "76262" ); if(( rc = MyFile.AppendRecord()) != XB_NO_ERROR ) /* write it */ cout << "\nError " << rc << " appending data record."; /* build record two */ MyFile.BlankRecord(); /* blank out the record buffer */ MyFile.PutField( lname, "Bob" ); /* a name */ MyFile.PutField( fname, "Billy" ); /* a name */ MyFile.PutField( birthdate, "19970304" ); /* a date */ MyFile.PutField( amount, "88.88" ); /* an amount */ MyFile.PutField( sw, "N" ); /* a switch */ f = -2.1f; MyFile.PutFloatField( f1, f ); MyFile.PutFloatField( "FLOAT2", -2.1f ); MyFile.PutField( f1, "-2.1" ); MyFile.PutField( f2, "-2.1" ); MyFile.PutField( f3, "-2.1" ); MyFile.PutField( f4, "-2.1" ); MyFile.PutField( z, "76261" ); #ifdef XB_MEMO_FIELDS MyFile.UpdateMemoData( m1, 20, "Sample memo field 2", F_SETLKW ); #endif if(( rc = MyFile.AppendRecord()) != XB_NO_ERROR ) /* write it */ cout << "\nError " << rc << " appending data record."; /* build record three */ MyFile.BlankRecord(); /* blank out the record buffer */ MyFile.PutField( lname, "Slippery" ); /* a name */ MyFile.PutField( fname, "Sam" ); /* a name */ MyFile.PutField( birthdate, "19970406" ); /* a date */ MyFile.PutField( amount, "77.77" ); /* an amount */ MyFile.PutField( sw, "T" ); /* a switch */ f = 3.21f; MyFile.PutFloatField( f1, f ); MyFile.PutFloatField( "FLOAT2", 3.21f ); MyFile.PutField( f1, "3.21" ); MyFile.PutField( f2, "3.21" ); MyFile.PutField( f3, "3.21" ); MyFile.PutField( f4, "3.21" ); MyFile.PutField( z, "76263" ); #ifdef XB_MEMO_FIELDS MyFile.UpdateMemoData( m1, 20, "Sample memo field 3", F_SETLKW ); #endif if(( rc = MyFile.AppendRecord()) != XB_NO_ERROR ) /* write it */ cout << "\nError " << rc << " appending data record."; /* build record four */ MyFile.BlankRecord(); /* blank out the record buffer */ MyFile.PutField( lname, "Lucas" ); /* a name */ MyFile.PutField( fname, "George" ); /* a name */ MyFile.PutField( birthdate, "19470406" ); /* a date */ MyFile.PutField( amount, "77.77" ); /* an amount */ MyFile.PutField( sw, "T" ); /* a switch */ f = 4.321f; MyFile.PutFloatField( f1, f ); MyFile.PutFloatField( "FLOAT2", 4.321f ); MyFile.PutField( f1, "4.321" ); MyFile.PutField( f2, "4.321" ); MyFile.PutField( f3, "4.321" ); MyFile.PutField( f4, "4.321" ); MyFile.PutField( z, "76260" ); #ifdef XB_MEMO_FIELDS MyFile.UpdateMemoData( m1, 20, "Sample memo field 4", F_SETLKW ); #endif if(( rc = MyFile.AppendRecord()) != XB_NO_ERROR ) /* write it */ cout << "\nError " << rc << " appending data record."; MyFile.CloseDatabase(); /* close database */ return 0; } xbase-2.0.0/examples/sample3.cpp0000644000000000000000000001113407164426564012146 /* $Id: sample3.cpp,v 1.6 2000/09/27 17:25:08 dbryson Exp $ Xbase project source code This sample program reads the database created and updated by the sample1 and sample2 program This program demonstrates the use of the following functions/methods OpenDatabase, GetFieldNo, GetRecord, GetLastRecord, GetFirstRecord, GetNextRecord, GetPrevRecord, NoOfRecords and CloseDatabase, FieldCount Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.7.4c 10/26/98 - Added some memo field logic V 1.8 11/29/98 - Version 1.8 upgrade */ #include /* set the stack large for dos compiles */ #ifdef __XBDOS #include extern unsigned _stklen = 100000; #endif int main() { char buf[40]; xbShort rc,i; xbShort lname, fname, birthdate, amount, sw, f1, memo; xbULong recs; char *p; xbFloat f; xbXBase x; xbDbf MyFile( &x ); MyFile.OpenDatabase( "MYFILE.DBF" ); lname = MyFile.GetFieldNo( "LASTNAME" ); fname = MyFile.GetFieldNo( "FIRSTNAME" ); birthdate = MyFile.GetFieldNo( "BIRTHDATE" ); amount = MyFile.GetFieldNo( "AMOUNT" ); sw = MyFile.GetFieldNo( "SWITCH" ); f1 = MyFile.GetFieldNo( "FLOAT1" ); memo = MyFile.GetFieldNo( "MEMO1" ); cout << "\nThere are " << MyFile.FieldCount() << " fields in the file"; recs = MyFile.NoOfRecords(); cout << "There are " << recs << " records in the file." << endl; cout << "\nLASTNAME is type: " << MyFile.GetFieldType( lname ) << " length: " << MyFile.GetFieldLen( lname ); cout << "\nFIRSTNAME is type: " << MyFile.GetFieldType( fname ) << " length: " << MyFile.GetFieldLen( fname ); cout << "\nBIRTHDATE is type: " << MyFile.GetFieldType( birthdate ) << " length: " << MyFile.GetFieldLen( birthdate ); cout << "\nAMOUNT is type: " << MyFile.GetFieldType( amount ) << " length: " << MyFile.GetFieldLen( amount ); cout << "\nSWITCH is type: " << MyFile.GetFieldType( sw ) << " length: " << MyFile.GetFieldLen( sw ) << "\n\n"; cout << "Sample GetRecord" << endl; MyFile.GetRecord( 1L ); MyFile.GetField( lname, buf ); cout << "Name 1 = " << buf << endl; cout << "Name 1 = " << MyFile.GetStringField( lname ) << endl; f = MyFile.GetFloatField( f1 ); cout << "FLOAT1 = " << f << endl; f = MyFile.GetFloatField( "FLOAT2" ); cout << "FLOAT2 = " << f << endl; cout << "Sample GetRecordBuf" << endl; p = MyFile.GetRecordBuf(); /* pointer to record buffer */ for( i = 0; i < 49; i++ ) cout << *p++; /* display the buffer */ cout << "\n\nLoop through forwards..." << endl; rc = MyFile.GetFirstRecord(); while( rc == XB_NO_ERROR ) { MyFile.GetField( lname, buf ); cout << MyFile.GetCurRecNo(); cout << " Name = " << buf << endl; rc = MyFile.GetNextRecord(); #ifdef XB_MEMO_FIELDS if( MyFile.MemoFieldExists( memo )) cout << "Memo field MEMO1 len = " << MyFile.GetMemoFieldLen(memo) << endl; #endif } cout << "\n\nSample PutRecord" << endl << endl; MyFile.PutField( lname, "Stantonbob" ); MyFile.PutField( lname, "Sally" ); MyFile.PutRecord( MyFile.GetCurRecNo() ); cout << "\nLoop through backwards.." << endl; rc = MyFile.GetLastRecord(); while( rc == XB_NO_ERROR ) { // MyFile.GetField( lname, buf ); cout << "Last Name = " << MyFile.GetStringField( lname ) << endl; cout << "Logical Field = " << MyFile.GetLogicalField( "SWITCH" ) << endl; rc = MyFile.GetPrevRecord(); } cout << endl; MyFile.CloseDatabase(); /* close database */ return 0; } xbase-2.0.0/examples/sample4.cpp0000644000000000000000000000655007164426564012155 /* $Id: sample4.cpp,v 1.6 2000/09/27 17:25:08 dbryson Exp $ Xbase project source code This sample program reads the database created and updated by the sample1 and sample2 program This program demonstrates the use of the following functions/methods DeleteRecord, UndeleteRecord, RecordDeleted Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 11/29/98 - Version 1.8 upgrade */ #include #ifdef __XBDOS #include extern unsigned _stklen = 100000; #endif int main() { xbShort rc; xbXBase x; xbDbf MyFile( &x ); xbNdx MyIndex1( &MyFile ); xbNdx MyIndex2( &MyFile ); xbNdx MyIndex3( &MyFile ); xbNdx MyIndex4( &MyFile ); if(( rc = MyFile.OpenDatabase( "MYFILE.DBF" )) != XB_NO_ERROR ) { cout << "\nError opening file rc = " << rc << "\n"; exit(1); } if(( rc = MyIndex1.OpenIndex( "MYINDEX1.NDX" )) != XB_NO_ERROR ) { cout << "\nError opening index1 rc = " << rc << "\n"; exit(1); } if(( rc = MyIndex2.OpenIndex( "MYINDEX2.NDX" )) != XB_NO_ERROR ) { cout << "\nError opening index2 rc = " << rc << "\n"; exit(1); } if(( rc = MyIndex3.OpenIndex( "MYINDEX3.NDX" )) != XB_NO_ERROR ) { cout << "\nError opening index3 rc = " << rc << "\n"; exit(1); } if(( rc = MyIndex4.OpenIndex( "MYINDEX4.NDX" )) != XB_NO_ERROR ) { cout << "\nError opening index4 rc = " << rc << "\n"; exit(1); } cout << "Sample GetRecord\n"; MyFile.ExclusiveLock( F_SETLKW ); /* lock the files for our exclusive use */ MyFile.GetRecord( 2L ); MyFile.DeleteRecord(); if( MyFile.RecordDeleted() ) cout << "Record is deleted...\n"; else cout << "Record is not deleted...\n"; /* to undelete a record the following commented code could be used MyFile.UndeleteRecord(); if( MyFile.RecordDeleted() ) cout << "Record is deleted...\n"; else cout << "Record is not deleted...\n"; */ /* to permanently remove deleted records from the file, pack the database */ if(( rc = MyFile.PackDatabase( F_SETLKW )) != XB_NO_ERROR ) cout << "\nError packing database rc = " << rc; else cout << "\nDatabase packed.\n"; MyFile.ExclusiveUnlock(); /* unlock the files */ MyFile.CloseDatabase(); /* close database */ return 0; } xbase-2.0.0/examples/sample5.cpp0000644000000000000000000000477107164426564012161 /* $Id: sample5.cpp,v 1.5 2000/09/27 17:25:08 dbryson Exp $ Xbase project source code Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 1/29/99 - V1.8 upgrade */ #include /* set the stack large for dos compiles */ #ifdef __XBDOS #include extern unsigned _stklen = 100000; #endif int main() { xbShort rc; /* return code */ xbXBase x; xbDbf d( &x ); xbNdx i1( &d ); xbNdx i2( &d ); xbNdx i3( &d ); xbNdx i4( &d ); rc = d.OpenDatabase( "MYFILE" ); cout << "OpenDatabase rc = " << rc << "\n"; rc = i1.OpenIndex( "MYINDEX1" ); cout << "OpenIndex 1 rc = " << rc << "\n"; rc = i2.OpenIndex( "MYINDEX2" ); cout << "OpenIndex 2 rc = " << rc << "\n"; rc = i3.OpenIndex( "MYINDEX3" ); cout << "OpenIndex 3 rc = " << rc << "\n"; rc = i4.OpenIndex( "MYINDEX4" ); cout << "OpenIndex 4 rc = " << rc << "\n"; rc = i1.FindKey( "Queue" ); /* alpha search */ cout << "Find Key rc = " << rc << "\n"; rc = i4.FindKey( (xbDouble) 77.77 ); /* numeric search */ cout << "Find Key rc = " << rc << "\n"; rc = i1.GetFirstKey(); cout << "GetFirstKey rc = " << rc << "\n"; rc = i1.GetNextKey(); cout << "GetNextKey rc = " << rc << "\n"; rc = i1.GetLastKey(); cout << "GetLastKey rc = " << rc << "\n"; rc = i1.GetPrevKey(); cout << "GetPrevKey rc = " << rc << "\n"; d.CloseDatabase(); return 0; } xbase-2.0.0/examples/exfilter.cpp0000644000000000000000000000442507164426564012431 /* exfilter.cpp Xbase project source code This program demonstrates the usage of the xbFilter class Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 4/1/98 - Added expression support V 1.8.0a 1/29/99 - V1.8 upgrade */ #include int main() { #if defined(XB_FILTERS) xbShort rc; xbXBase x; xbDbf d( &x ); xbNdx i( &d ); cout << "exfilter program executing" << endl; if(( rc = d.OpenDatabase( "MYFILE.DBF" )) != XB_NO_ERROR ){ cout << "Error opening database" << endl; return 1; } if(( rc = i.OpenIndex( "MYINDEX1.NDX" )) != XB_NO_ERROR ){ cout << "Error opening index" << endl; return 2; } xbFilter f1( &d, 0, "FLOAT1>1" ); /* use filter 1 w/o index */ rc = f1.GetFirstFilterRec(); while( rc == XB_NO_ERROR ){ cout << "Filter 1 Found Record " << d.GetCurRecNo() << endl; rc = f1.GetNextFilterRec(); } xbFilter f2( &d, &i, "FLOAT1>1" ); /* use filter 2 w/ index */ rc = f2.GetLastFilterRec(); while( rc == XB_NO_ERROR ){ cout << "Filter 2 Found Record " << d.GetCurRecNo() << endl; rc = f2.GetPrevFilterRec(); } d.CloseDatabase(); #else cout << "XB_FILTERS not compiled into library" << endl; #endif return 0; } xbase-2.0.0/examples/makefile.g950000644000000000000000000000413307203046606012167 # This file is part of the XBase libraries # Copyright (C) 2000 Derry Bryson # # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # xdb.sourceforge.net # # Mingw32/Cygwin make file CPPFLAGS = -I.. # uncomment the following to generate debug code #DEBUG = -g # Note, if linking to the dll, you need to define XBUSINGDLL CXXFLAGS = -O2 $(DEBUG) -DXBUSINGDLL --pipe -Wall -fvtable-thunks #CXXFLAGS = -O2 $(DEBUG) -Wall --pipe -fvtable-thunks CFLAGS = -02 $(DEBUG) -DXBUSINGDLL -Wall --pipe #CFLAGS = -02 $(DEBUG) -Wall --pipe LDFLAGS = -L../xbase LIBS = -lxbasedll -lstdc++ #LIBS = -lxbase all : sample1.exe sample2.exe sample3.exe sample4.exe sample5.exe exfilter.exe sample1.exe : sample1.o $(CXX) -o $@ $(CXXFLAGS) sample1.o $(LDFLAGS) $(LIBS) sample2.exe : sample2.o $(CXX) -o $@ $(CXXFLAGS) sample2.o $(LDFLAGS) $(LIBS) sample3.exe : sample3.o $(CXX) -o $@ $(CXXFLAGS) sample3.o $(LDFLAGS) $(LIBS) sample4.exe : sample4.o $(CXX) -o $@ $(CXXFLAGS) sample4.o $(LDFLAGS) $(LIBS) sample5.exe : sample5.o $(CXX) -o $@ $(CXXFLAGS) sample5.o $(LDFLAGS) $(LIBS) exfilter.exe : exfilter.o $(CXX) -o $@ $(CXXFLAGS) exfilter.o $(LDFLAGS) $(LIBS) clean : -rm *.o *.exe xbase-2.0.0/examples/examples.ide0000644000000000000000000014504607203052712012371 Borland C++ Project File ²º¾úΆĠb,$0â,BŒkß8°  ÉÖññ²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõ÷øùúûüýþÿ                         °±ö     " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ   Ž   ‘ ’ “ ” • – — ˜ ™ š › œ  ž  ! Ÿ   èŽ$ AppE&xpert...莰DoDoèŽ ±examples莲.莳.def莴.rtf莵 .ha莶.hrc获.rhI莸.inc莹.asi莺.obj莻#.lib莼.resèŽ(½StripAutoDependsèŽ,¾Remove &AutoDependsèŽ@¿)Remove all [AutoDepend] nodes from a nodeèŽÀ.cppèŽÁ.rcSèŽÂ.exeèŽÃ.dllèŽÄ.c¬èŽÅ.casèŽ$Æ &C CompiležèŽÇ.asmèŽ$Èš AppExpertDllèŽÉ$TASMèŽ Ê$IMPLIB~èŽ<Ë"$NOSWAP $CAP MSG(HC312MSG) $EDNAMEèŽÌ.hlpèŽÍ.hpjèŽ Î cpp/cpp32èŽ\ÏD$NOSWAP $CAP MSG(BORL2MSG) +$RSP(-I$INC -D1;$DEF -o$OUTNAME) $EDNAMEèŽÐ.i”èŽÑ$ARGSèŽ ÒT$EDNAME†èŽÓ.kb~èŽÔ.dlgèŽÕ.txtèŽÖ.sppèŽ(×AppExpertDll.cXèŽ4Ø$SAVE ALL $TD $EXENAME $ARGNèŽ(Ù&Turbo DebuggerAèŽ<Ú%Turbo Debugger on current target nodeèŽ,Û$TD -l $EXENAME $ARGèŽÜb.exeèŽ4Ý-m"goto_line $LINE" $EDNAMEèŽ Þ$OUTNAMEèŽ ßgrep.comèŽLà3-n+ $NOSWAP$CAP MSG(GREP2MSG)$PROMPT void $SELNODES×èŽ áws32.exeèŽ â OwlCovertèŽ$ã owlcvt.exe´èŽ(äConvertOWL1SourceèŽLå3+$RSP($OWLCVT) $SELNODES $CAP MSG(BORL2MSG) $NOSWAP¡èŽLæ4Convert currently selected nodes from OWL 1 to OWL 2èŽ$ç regist32.exeèŽ,è$TARGET -RegServerrèŽDé,Register the current target as an OLE serverèŽ,ê$TARGET -UnregServerèŽ0ë&Unregister OLE ServerKèŽHì.Unregister the current target as an OLE server?èŽí.prjèŽ$î RunScriptFileèŽ,ï&Load and Run ScriptèŽ4ðLoad and run a cScript fileèŽ4ñHelp_Compiler 32bit hcrtf.exeèŽ ò hcrtf.exeèŽ$ó CompileHLP32èŽ<ô%/xn $NOSWAP $CAP MSG(GENERIC) $EDNAMEèŽLõ2Compile help project node .hpj to Windows 4.0 .hlpÝèŽ,ö sample1.exes.exe4‡èŽ4÷Create an AppExpert project¹èŽ øLRescanèŽ$ùK idOutputPathèŽTúK:Rescan the header files to recreate the AppExpert database£èŽûK.apxèŽ(üRC_File_Editor‡èŽ$ý EditResourceèŽ(þEdit &ResourcesõèŽ$ÿ Edit resourceèŽ .fntèŽ, Bitmap_File_EditorèŽ( EditBitmapFileèŽ$  Edit &BitmapèŽ$  Edit bitmapèŽ .bmpèŽ .rleèŽ, Cursor_File_EditorÑèŽ( EditCursorFileÆèŽ$  Edit &CursorèŽ( Edit cursor fileèŽ .curèŽ( Icon_File_EditorèŽ$  EditIconFileèŽ$  Edit &IconèŽ( Edit icon file†èŽ .icoèŽ( Res_File_EditorâèŽ, EditBinaryResources èŽ0 Edit &Binary Resources èŽ .drvèŽ .vbxèŽ .cplèŽ .fonèŽ( ASFN:sample1.exe5èŽ tex58èŽ$  c0x32.objxeèŽ$  import32.libèŽ   cw32i.libèŽ$  sample1.cpp[èŽ( exfilter.exe.exe èŽ0 ASFN:..\xbase\xbased.lib7èŽ0! ASFN:exfilter.exe.exe16/ èŽ0" C:\BC5\INCLUDE\string.h¥èŽ0# C:\BC5\INCLUDE\_defs.h™èŽ0$ C:\BC5\INCLUDE\stddef.hèŽ0% C:\BC5\INCLUDE\_null.hèŽ0& C:\BC5\INCLUDE\windows.hèŽ8' C:\BC5\INCLUDE\win32\windows.hièŽ0( C:\BC5\INCLUDE\excpt.h[èŽ0) C:\BC5\INCLUDE\stdarg.hOèŽ0* C:\BC5\INCLUDE\windef.h9èŽ0+ C:\BC5\INCLUDE\winnt.h-èŽ4, C:\BC5\INCLUDE\win32\winnt.hèŽ0- C:\BC5\INCLUDE\ctype.hèŽ0. C:\BC5\INCLUDE\pshpack4.hèŽ0/ C:\BC5\INCLUDE\poppack.h èŽ00 C:\BC5\INCLUDE\pshpack1.hèŽ01 C:\BC5\INCLUDE\winbase.hèŽ82 C:\BC5\INCLUDE\win32\winbase.hïèŽ03 C:\BC5\INCLUDE\winerror.hèŽ04 C:\BC5\INCLUDE\wingdi.hCèŽ45 C:\BC5\INCLUDE\win32\wingdi.hèŽ06 C:\BC5\INCLUDE\pshpack2.hèŽ07 C:\BC5\INCLUDE\winuser.hèŽ88 C:\BC5\INCLUDE\win32\winuser.hœèŽ09 C:\BC5\INCLUDE\winnls.hŽèŽ4: C:\BC5\INCLUDE\win32\winnls.hèŽ0; C:\BC5\INCLUDE\wincon.huèŽ4< C:\BC5\INCLUDE\win32\wincon.hèŽ0= C:\BC5\INCLUDE\winver.h\èŽ4> C:\BC5\INCLUDE\win32\winver.hèŽ0? C:\BC5\INCLUDE\winreg.hCèŽ4@ C:\BC5\INCLUDE\win32\winreg.hèŽ0A C:\BC5\INCLUDE\winnetwk.hèŽ8B C:\BC5\INCLUDE\win32\winnetwk.hèŽ0C C:\BC5\INCLUDE\cderr.hèŽ4D C:\BC5\INCLUDE\win32\cderr.hèŽ,E C:\BC5\INCLUDE\dde.h èŽ4F C:\BC5\INCLUDE\win32\dde.h èŽ0G C:\BC5\INCLUDE\ddeml.hèŽ4H C:\BC5\INCLUDE\win32\ddeml.hèŽ,I C:\BC5\INCLUDE\dlgs.hèŽ4J C:\BC5\INCLUDE\win32\dlgs.hÒèŽ0K C:\BC5\INCLUDE\lzexpand.hèŽ8L C:\BC5\INCLUDE\win32\lzexpand.hJèŽ0M C:\BC5\INCLUDE\mmsystem.hèŽ,N C:\BC5\INCLUDE\nb30.hèŽ4O C:\BC5\INCLUDE\win32\nb30.h0èŽ,P C:\BC5\INCLUDE\rpc.hèŽ4Q C:\BC5\INCLUDE\win32\rpc.hèŽ0R C:\BC5\INCLUDE\rpcdce.h èŽ4S C:\BC5\INCLUDE\win32\rpcdce.hèŽ0T C:\BC5\INCLUDE\rpcdcep.h èŽ8U C:\BC5\INCLUDE\win32\rpcdcep.hýèŽ0V C:\BC5\INCLUDE\rpcnsi.hðèŽ4W C:\BC5\INCLUDE\win32\rpcnsi.hèŽ0X C:\BC5\INCLUDE\rpcnterr.hèŽ8Y C:\BC5\INCLUDE\win32\rpcnterr.hËèŽ0Z C:\BC5\INCLUDE\shellapi.hèŽ8[ C:\BC5\INCLUDE\win32\shellapi.h¼èŽ0\ C:\BC5\INCLUDE\winperf.hèŽ8] C:\BC5\INCLUDE\win32\winperf.hP èŽ0^ C:\BC5\INCLUDE\winsock.h èŽ0_ C:\BC5\INCLUDE\commdlg.h èŽ8` C:\BC5\INCLUDE\win32\commdlg.h* èŽ0a C:\BC5\INCLUDE\winspool.hèŽ8b C:\BC5\INCLUDE\win32\winspool.h©èŽ0c C:\BC5\INCLUDE\prsht.h›èŽ0d C:\BC5\INCLUDE\pshpack8.hèŽ,e C:\BC5\INCLUDE\ole2.hèŽ4f C:\BC5\INCLUDE\win32\ole2.hèŽ0g C:\BC5\INCLUDE\objbase.h èŽ0h C:\BC5\INCLUDE\rpcndr.hM èŽ4i C:\BC5\INCLUDE\win32\rpcndr.hèŽ0j C:\BC5\INCLUDE\rpcnsip.h èŽ8k C:\BC5\INCLUDE\win32\rpcnsip.h( èŽ0l C:\BC5\INCLUDE\stdlib.h èŽ0m C:\BC5\INCLUDE\wtypes.h§èŽ0n C:\BC5\INCLUDE\unknwn.h›èŽ4o C:\BC5\INCLUDE\win32\unknwn.hèŽ0p C:\BC5\INCLUDE\objidl.hxèŽ4q C:\BC5\INCLUDE\win32\objidl.hèŽ0r C:\BC5\INCLUDE\cguid.h_èŽ4s C:\BC5\INCLUDE\win32\cguid.hèŽ0t C:\BC5\INCLUDE\oleauto.hèŽ0u C:\BC5\INCLUDE\oaidl.h:èŽ0v C:\BC5\INCLUDE\oleidl.h.èŽ4w C:\BC5\INCLUDE\win32\oleidl.hèŽ0x C:\BC5\INCLUDE\winsvc.hèŽ4y C:\BC5\INCLUDE\win32\winsvc.hèŽ4z C:\BC5\INCLUDE\win32\mcx.h‚èŽ4{ C:\BC5\INCLUDE\win32\imm.hm èŽ(| ..\xbase/xtypes.hèŽ0} C:\BC5\INCLUDE\stdio.hV èŽ0~ C:\BC5\INCLUDE\_nfile.hJ èŽ, ..\xbase/retcodes.h> èŽ(€ ..\xbase/xdate.h èŽ0 ..\xbase/xbconfigw32.h) èŽ,‚ ..\xbase/xbstring.h èŽ0ƒ C:\BC5\INCLUDE\iostream.hèŽ(„ ..\xbase/exp.h èŽ(… ..\xbase/xbase.h èŽ(† ..\xbase/xstack.hèŽ(‡ ..\xbase/dbf.hf èŽ(ˆ ..\xbase/index.h èŽ(‰ ..\xbase/ndx.hR èŽ(Š ..\xbase/ntx.hH èŽ,‹ ..\xbase/xbfilter.h> èŽ(Œ ..\xbase/html.h3 èŽ( dAutoDepReference èŽ$Ž  sample2.exe±èŽ( ASFN:sample2.exe8èŽ$  sample2.cpp èŽ0‘ ASFN:..\xbase\xbased.lib9èŽ$’  sample3.exeòèŽ,“ ASFN:sample3.exe10éèŽ4” ASFN:..\xbase\xbased.lib11ÞèŽ$•  sample3.cppÑèŽ$–  sample4.exeÈèŽ,— ASFN:sample4.exe12¿èŽ$˜  sample4.cpp@JèŽ4™ ASFN:..\xbase\xbased.lib136À6èŽ$š  sample5.exeL9èŽ,› ASFN:sample5.exe14Z èŽ$œ  sample5.cppO èŽ4 ASFN:..\xbase\xbased.lib15F èŽ,ž ..\xbase\xbasedll.libèŽ$Ÿ  exfilter.cpp èŽ4  ASFN:..\xbase\xbasedll.lib17,&Bbz–²Îê">Zv’ºæ&B^z–²Îò2NnªÆâ^z–¶Òî & N ‚ ª æ  . b ‚ ¢ î  . R z Æ  6 b ¦ Ò  J f Š ¶ ê >bžêJjŽâþ&Jr–²Þ*Nj†²Úþ&Bj޲ÚöJz–²Îê.Rv–ºâBr¢Ò2jšÊú*^޾îN†¶æJz²âFzªÞBrªÚ:nžÒþ2bšÊö*VŠºîV†ºê" R Š º ò "!R!Š!º!ò!""R"~"²"â"#F#v#®#Þ#$>$r$¢$Ö$%:%j%š%Ê%þ%.&b&–&Ê&ò&"'R'~'¦'Ö'(2(Z(‚(ª(Ò(ú(")J)v)ž)Æ)ê)*6*f*Š*¶*ê*+2+^+‚+¶+Ú+,*,^,Š,®,È=œ;€:ŒkßÈ"gÖÈ"fgÈ"h4gFÈ"jPg@`h$±niÈ"llg è,°ôgO–À²üÞÿý Ö%&ÿ©·ï³¶ ´$½À®ª«âÙá­µ#ü×Û  7-3./"ðõñ‰4*5*6*7*8*9*:*;*<*=*>*?*y*z*¹º»¼úûdþÿ‚vxu|†„b€Šy…k‹ˆ[hefg•c‘’”–—d]^zwŽs{m˜~o‡ƒ}q“n™›œžŸ ¡¢£°§¢s£²¦¤Õ±¥¸¿öõÚ3.10óøú ñͰ™‚ Ð…„@–ÑŒŠ‹ÌÍÎÏÓÔƒÒ ‡•˜ùôòŽ‘’“”—÷Ø× Ö Ú Ø Ù œ›žFt{qöˆù è, Èàg O–L @.C:\BC5\INCLUDE;../ C:\BC5\LIBõ examples.csm3XBUSINGDLLUDE;.." è, É O–t hs§£¢²¦¤d±¥ è, ÊO–THs§£¦¢ è,ËO–$s§ è,ÌO–,  ´Í è,ÍO–,  ´Í è,ÎO–$ Í è,ÏO–,3__DEBUG=2;__TRACE;__WARN è,Ð O– `h,ön … |ig„ O– g„ O– g„  !O–! g„" #O–# g„$ %O–%  è,& ¼g)g„' (O–( O–`)Röò€ôù3_RTLDLL;XBUSINGDLL) ¢ag)"  !#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^ .C:\BC5\INCLUDE;../ C:\BC5\LIB`h$*  ~i `h$+ Bi`h$, €Bi`h$- ªi`h,.ž ú… ‚Big„/ 0O–0  g„$1 2B‡ O–2  O– 3˜\j)Öu„g„$4 5 O–x5dll $S;)… ‰Xj) ¢ag)"  !#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !| x‡^)}  !~  ! x‡^)€ ‰Xj)‚ ýQi)ƒ  !„ ‰Xj)† ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ &Si)Œ ‰Xj)Œ Si)È"6„¬g;h è,7 Lg8O– 8`h,9Ž ú' …ip …g„: ;O–;  è4< ìg=ùO–<=-öò€ôù3_RTLDLL;XBUSINGDLL¥`h$>  ‡i `h$? ˆBi`h$@ ‰Bi`h$A Šªi`h$Bž ‹Big„C DO–D  è,E‘ <gFO– FO– GÆ\j)ïôÄg„H IO–xId€l Â\j)… ‰Xj) ¢ag)"  !#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !| x‡^)}  !~  ! x‡^)€ ‰Xj)‚ ýQi)ƒ  !„ ‰Xj)† ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ &Si)Œ ‰Xj)Œ Si)`h,J’ Z' ir g„K LO–L  è,M“ ˆgNO–<N-öò€ôù3_RTLDLL;XBUSINGDLL¥`h$O  i `h$P Bi`h$Q ‘Bi`h$Rž ’Big„S TO–T  è,U” ´!gVO–Vö`h$W• ”ªiO– X™\j) L“•g„Y ZO–xZdll• $S;)… ‰Xj) ¢ag)"  !#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !| x‡^)}  !~  ! x‡^)€ ‰Xj)‚ ýQi)ƒ  !„ ‰Xj)† ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ &Si)Œ ‰Xj)Œ Si)`h,[– ¦)' •it •g„\ ]O–]  è,^— (&g_O–<_-öò€ôù3_RTLDLL;XBUSINGDLLBUS`h$`  —i `h$a ˜Bi`h$b ™Bi`h$c˜ šªi`h$dž ›Big„e fO–f  è,g™ x)ghO–höO– i™\j)S°ƒg„j kO–xkdll˜ $S;)… ‰Xj) ¢ag)"  !#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !| x‡^)}  !~  ! x‡^)€ ‰Xj)‚ ýQi)ƒ  !„ ‰Xj)† ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ &Si)Œ ‰Xj)Œ Si)`h,lš æ#' iv g„m nO–n  è,o› È-gpO–<p-öò€ôù3_RTLDLL;XBUSINGDLL`h$q  Ÿi `h$r  Bi`h$s ¡Bi`h$tœ ¢ªi`h$už £Big„v wO–w  è,x 1gyO–yöO– zš\j) pd¥g„{ |O–x|dllœ $S;)… ‰Xj) ¢ag)"  !#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !| x‡^)}  !~  ! x‡^)€ ‰Xj)‚ ýQi)ƒ  !„ ‰Xj)† ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ &Si)Œ ‰Xj)Œ Si)`h$} ¥ig„~ O–  è,€! `5gO–L?öò€ôù3_RTLDLL;XBUSINGDLL`h$‚  §i `h$ƒ ¨Bi`h$„ ©Bi`h,…Ÿ F;¬ªªiîª`h$†ž DLL;«Big„‡ ˆO–ˆ  è,‰  È6gŠO– ŠO– ‹š\j)häb­g„Œ O–pdllŸ $S;)… ‰Xj) ¢ag)"  !#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !| x‡^)}  !~  ! x‡^)€ ‰Xj)‚ ýQi)ƒ  !„ ‰Xj)† ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ &Si)Œ ‰Xj)4Plˆ¬Èô´à, X Ì ø L x œ È ô L x œ È ô , X t Œ ¨ À Ü ô (D\ˆ¤¼@dˆ¬Øô 0HhŒ LX„ ¸ì(Lp”¸Üø<Hh„ü(D\ˆÄ è !0!T!p!ˆ!´!Ä!è!"$"œ%È%ä%ü%(&d(ˆ(¬(Ð(ô()4)L)x)ˆ)¨)Ä)<-h-„-œ-È-0(0L0p0”0¸0Ô0ì01(1H1d1Ü45545`5¬5Ð5ô56D6h6„6œ6È6Ô6ô67Œ(lœŒkßo i4U$²úÿÿÿ²4U$,þÿÿÿðÒ-ÌàT.þÿÿÿ-/ F! ÌàT0þÿÿÿ-1 .!ÌàT2þÿÿÿ-3 /!ÌàT4þÿÿÿ-5"ÌàT½þÿÿÿ-¾¿(F!4U$9þÿÿÿÐ&-ÌàT ;þÿÿÿ-<=gF#$ ÌàT >þÿÿÿ-Æ@hF#' ÌàT Aþÿÿÿ-BCiF$(ÌàT Dþÿÿÿ-EF`F$)ÌàT Gþÿÿÿ-HIkF#* ÌàTJþÿÿÿ-KLjF#+ 4U$Mþÿÿÿp+Ò/-ÌàTOþÿÿÿ-PQa-",ÌàTRþÿÿÿ-STb-"04U$Uþÿÿÿ¨ß2-ÌàTWþÿÿÿ-XYQFS14U$_þÿÿÿò4-ÌàTaþÿÿÿ-bcc/"34U$iþÿÿÿì»Î7jÌàTkþÿÿÿjÉlmeF#5 4U$nþÿÿÿ¬Â9oÌàTpþÿÿÿoÊqrd/$84U${þÿÿÿ„äó<|ÌàT}þÿÿÿ|Ë~lF$:4U$dþÿÿÿ@ëò>ÎÌàTfþÿÿÿÎÏghmF$=4U$€ýÿÿÿèáñ@-ÌàT‚ýÿÿÿ-у„-Ìhƒ?ÌàT …ýÿÿÿ-ц‡‘-Ìh„A4U$!ˆýÿÿÿ îG-ÌàT"Šýÿÿÿ-Ò‹Œ0F˜h!…B4U$#ýÿÿÿJ-ÌàT$ýÿÿÿ-‘A h#†H4U$%’ýÿÿÿ€‘õL-ÌàT&“ýÿÿÿ-ØÙÚ’1ˆ h%‡KÌàT'•ýÿÿÿ-Û–—’ˆ h%ˆM4U$(˜ýÿÿÿ€îðOÜÌàT)™ýÿÿÿÜš›FT h(‰NÌàT*œýÿÿÿÜÝšžFT h(ŠPÌàT+ŸýÿÿÿÜÒš¡FT h(‹Q4U$,©ýÿÿÿ©SªÌàT-«ýÿÿÿªÞ¬­t h,ŒR4U$.³üÿÿÿdJïTßÌàT/´üÿÿÿß൶ .4U$0·üÿÿÿDèôUáÌàT1¸üÿÿÿṺ 04U$2âþÿÿÿØ—ÁWãÌàT3äþÿÿÿãåÀæF$2V4U$4Âþÿÿÿ<÷ôYçÌàT5ÂþÿÿÿçèÃé-$4X4U$6Åþÿÿÿ8ù[çÌàT7Åþÿÿÿçêëì-$6Z4U$8Îýÿÿÿh¼Þ^-ÌàT9Îýÿÿÿ-ÒÏ Dh8\4U$:îþÿÿÿ [Ù`-ÌàT;îþÿÿÿ-ïðÀF$:_4U$<ñþÿÿÿÀNÛbòÌàT=óþÿÿÿòô~õF$<a4U$>ýÿÿÿ€œßd-ÌàT?ýÿÿÿ-Ò÷¡¬h>“c4U$@®ýÿÿÿøÔÙf-ÌàTA®ýÿÿÿ-Ò±²€$h@¨e4U$Bøþÿÿÿ\Øh-ÌàTCøþÿÿÿ-ù7ú$œhB©gi!4U$Düýÿÿÿ ^Òk-ÌàTEýýÿÿÿ-ÒþÿZFhD–i4U$F ýÿÿÿ o-ÌàTG ýÿÿÿ-Ò  [FŒhF—l4U$H ýÿÿÿ„Ýr-ÌàTI ýÿÿÿ-Ò  \FhH˜p4U$J ýÿÿÿÔßâu-ÌàTK ýÿÿÿ-Ò  ]F|hJ™s4U$L ýÿÿÿáâ{-ÌàTM ýÿÿÿ-Ò ÿ^-ôhLšv(LpÄlÀ8Œà4ˆÜ0T¨ü t˜ìdˆÜTxÌðD˜¼ 4 ˆ ¬ T x Ì t ˜ ì  d ˆ Ü T x Ì ð Dh¼à4X¬Ð$HœÀ8Œ°(| ôî| & VŒkßÐ@ä ɶ))      !"#$%&'()*^4¼h"^4$ÉÛ-HhATh^4^4 ˜‡Âhh9lh^4³ ¼h"^4´^4µ¼h"^4 ¶^4 ·¼h"^4 ¸^4 ¹^4 º h^4»X͘h^4¼hM^4ÀX0â¼h"8h ^4Á 8hE^4 ?à!ðhTh^4Ã"hM^4Ä#¼h" ^4Å% ^4Ç6¼h"^4ȘΠ.HhATh^4Ì^4Í;¼h"^4Ð^4ÓC¼h"^4ÔD^4ÕE¼h"^4ÖF¼h";^4×I^4 í]hh9^4!û^4"  j^4# m°hG^4$ n°hG^4% q(hI^4& t hK^4' w^4( x^4) y^4* zÒ:n¢Ö >r¦ÚBvªÞFz®âJ~²æN‚¶êR†ºî"VоòPi&ŒŒkßTƒØÈg Éf   &7<EMU^gox€‰&d(ÒÎŒkß0h ˆg ɦ%%*+,-.9>?@ABJOPQRW[`abcdlqrstu}‚ƒ„…†(Àb(ü p ŒŒkß(lkh¬Döÿÿÿˆgn O– h¬Döÿÿÿ¼l , g›}O– h¬Döÿÿÿg*O– h¬Döÿÿÿ @g+O– h¬D  öÿÿÿ dg,O– h¬D  öÿÿÿHg3ˆg-h¬D  öÿÿÿ@l  ¬g.œƒO– h¬DöÿÿÿlXg9ž†O– h¬Döÿÿÿ(g>O– h¬DöÿÿÿLg?O– h¬Döÿÿÿpg@O– h¬DöÿÿÿHgG”gAh¬Döÿÿÿdl!$ügJ Žh¬DöÿÿÿXl¸gBŸŒO– O– h¬DöÿÿÿÄ gOO– h¬Döÿÿÿè gPO– h¬Döÿÿÿ  !gQO– h¬D!!öÿÿÿ¤l"#0!gR¡“O– "h¬D##öÿÿÿè!gXÄ!gWh¬D$$öÿÿÿ8l%.-œ%g[¢–O– %h¬D&&öÿÿÿ'$(d(g`O– 'h¬D((öÿÿÿ)$*ˆ(gaO– )h¬D**öÿÿÿ+$¬(gbO– +h¬D,,öÿÿÿˆ)gi$&Ð(gch¬D--öÿÿÿ l098<-gl¤žh¬D..öÿÿÿl/$,ô(gd£œO– /O– 0h¬D11öÿÿÿ2-30gqO– 2h¬D33öÿÿÿ4-5(0grO– 4h¬D55öÿÿÿ6-L0gsO– 6h¬D77öÿÿÿ(1gz-1p0gth¬D88öÿÿÿà l;DÜ4g}¦¦h¬D99öÿÿÿÔ l:-7”0gu¥¤O– :O– ;h¬D<<öÿÿÿ=8>¬5g‚O– =h¬D>>öÿÿÿ?8@Ð5gƒO– ?h¬D@@öÿÿÿA8ô5g„O– Ah¬DBBöÿÿÿÔ6g‹8<6g…h¬DDDöÿÿÿd lE8BD6g†§¬O– E(lx¼È \h¬¸ü@Lœàì0<€ŒÐXdp´ÀT`¤°ô8Dˆ”Øä(4x¼ \h¬¸ü L Ô à ì 0 < € Œ Ð Ü d ÿ—62ŒkßlÞ™ ɰc :6Œkß É °c 62Œkßà)Ü É  ¼ž ²®ŒkßL>ä É’ !#%(,.02468:<>@BDFHJL¬¶ :6Œkß É W„ JFŒkß É* ")*+W„62Œkß ÉVFBŒkßh>ä É&¬¶JFŒkß É*    W„b^Œkß ÉB      "$)*+W„62Œkß ÉW„:6Œkß É"W„62Œkß ÉW„62Œkß ÉW„:6Œkß É"¬¶>:Œkß É W„62Œkß ÉW„B>ŒkßÈ› É"W„:6Œkß ÉM¬¶:6Œkß ÉW„62Œkß ÉW„>:ŒkßüÞ‰ É9?¬¶JFŒkß É*W„b^Œkß¦Ý ÉB     ")*+3W„ NJŒkß É. ")*+EW„!ZVŒkßtËš É:!  $&'57MW„"RNŒkß É2"$57MW„#b^Œkß ÉB#      ")*+¬¶$B>Œkß É"$W„%:6Œkß É%  V&JFŒkß„>ä É*&     ¬¶'>:Œkß É'¬¶(>:Œkß É(¬¶)>:Œkß É)¬¶*>:Œkß É*¬¶+>:Œkß É+¬¶,B>Œkß É",W„-^ZŒkߨš› É>-  $&'57?ACW„.JFŒkß¡Ý É*.57?ACV/:6Œkß >ä É/¬¶062Œkß É0¬¶162Œkß É1V262Œkß¼>ä É2¬¶362Œkß É3V462Œkߨ>ä É4¬¶562Œkß É5W„6FBŒkß É&6")*+V762Œkßô>ä É7¬¶8>:Œkß É8V962Œkß?ä É9¬¶:62Œkß É:W„;NJŒkß É.;")*+-=V<62Œkß,?ä É<¬¶=:6Œkß É=V>62ŒkßH?ä É>¬¶?:6ŒkßÔ\ä É?V@:6Œkßd?ä É@ ¬¶A:6Œkß´«ä ÉA¬¶BfbŒkßH^ä ÉFB  W„C62Œkß ÉC"W„D62Œkß ÉD"W„E62Œkß ÉE"W„F:6Œkß ÉF";VG62Œk߀?ä ÉG"¬¶HFBŒkß­ä É&HW„I62Œkß ÉI$VJ62Œkßœ?ä ÉJ$¬¶K:6ŒkßÔ_ä ÉKVL:6Œk߸?ä ÉL&'¬¶M:6Œkß°®ä ÉM¬¶NNJŒkߌaä É.NVO>:ŒkßÔ?ä ÉO)*+¬¶PNJŒkßP°ä É.P¬¶QNJŒkßDcä É.Q¬¶R62Œkßð±ä ÉRVS62Œkßð?ä ÉS-VT62Œkß @ä ÉT/VU62Œkß(@ä ÉU1¬¶V62Œkß ÉVVW62ŒkßD@ä ÉW3¬¶XB>Œkß É"XVY62Œkß`@ä ÉY5¬¶ZB>Œkß É"ZV[62Œkß|@ä É[7¬¶\:6Œkß`¢Ý É\ W„]62Œkß É]9V^62Œkߘ@ä É^9¬¶_62Œkß É_V`62Œkß´@ä É`;¬¶a62Œkß ÉaVb62Œkß<\ˆ Éb=¬¶c>:Œkß³ä ÉcVd62Œkß8Ÿ Éd?¬¶e:6Œkßüdä ÉeVf62Œk߀Ÿ ÉfA¬¶g:6Œkß ÉgVh62ŒkßÈŸ ÉhC¬¶i:6Œkß0µä Éi"W„j62Œkß ÉjEVk62Œkß  ÉkE¬¶l:6Œkß¼µä Él#$W„m62Œkß ÉmGW„n62Œkß ÉnGVo62ŒkßX  ÉoG¬¶p62Œkßdwä Ép%W„q62Œkß ÉqIVr62Œkß   ÉrI¬¶s62Œkß É És&W„t62Œkß ÉtKVu62Œkßè  ÉuK¬¶vNJŒkß·ä É.v'()*W„w62Œkß ÉwMW„x62Œkß ÉxMW„y62Œkß ÉyMW„z62Œkß ÉzMV{62Œkß0¡ É{Mÿ—|:6Œkߨßâ É|$°c}62Œkß$MÝ É}&ÿ—~62ŒkßÔ á É~ÿ—62ŒkßxAÝ Éÿ—€62Œk߀$ É€ ÿ—:6Œkßôjã É 4ÿ—‚:6Œkßœ{â É‚ 1°cƒ62ŒkßXKñ Ƀ7È=„<8ŒkßO– „qq $S;)"  !#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !| x‡^)}  !~  ! x‡^)€ ‰Xj) ¢ag)‚ ýQi)ƒ  !„ ‰Xj)… ‰Xj)† ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ &Si)Œ ‰Xj) Â\j)• $S;)˜ $S;)œ $S;)Ÿ $S;)ÿ—…:6ŒkßÐÛ É…:°c†62ŒkßÌP™ Ɇ<ÿ—‡62ŒkßÞΠɇÿ—ˆ62Œkß¼Š× Ɉÿ—‰62Œk߸¿Î ɉÿ—Š:6ŒkߌpÝ ÉŠHÿ—‹:6ŒkßH‘Ô É‹C°cŒ62ŒkßhJî ÉŒEÿ—:6Œkß°í› ÉK°cŽ62ŒkßDÙÜ ÉŽMÿ—62Œkß4Ñ­ Éÿ—62Œkßh1² Éÿ—‘62Œkß$¡ É‘ÿ—’:6Œkß”ý  É’!S°c“62ŒkßPð× É“Uÿ—”:6Œkßœ…´ É”#Yÿ—•:6Œkߘïš É•$\°c–62ŒkߨO¥ É–^ÿ——62Œkß P¥ É—&ÿ—˜62Œkß`!ä ɘ(ÿ—™62Œk߈¦ É™*ÿ—š:6Œkß´ïš Éš,jÿ—›:6Œkߨ!ä É›.e°cœ62Œkß@(ä Éœgÿ—:6Œk߸(ä É-m°cž62Œkß /ä Éžoÿ—Ÿ62Œkߘ/ä ÉŸ1ÿ— 62ŒkßÐïš É 3ÿ—¡62Œkߦ É¡5ÿ—¢:6Œkß0ä É¢7{ÿ—£:6Œkߦ É£9v°c¤62Œkßx6ä ɤxÿ—¥:6Œkßð6ä É¥8~°c¦62ŒkßX=ä ɦ€ÿ—§62ŒkßÐ=ä ɧ<ÿ—¨62Œkßìïš É¨>ÿ—©62Œk߈ Ý É©@ÿ—ª:6Œkßì=ä ɪBŒÿ—«:6Œkß¡Ý É«D‡°c¬62Œkßðš ɬ‰8…  œŒkßg6¼|®,$0P0œ;ìkô| p‰ŠÒÒŠü Ζ6—:>—6t—²&˜:`˜Jª˜6à˜F&™Jp™bÒ™6š:Bš6xš6®š:èš>&›6\›Bž›:Ø›:œ6Hœ>†œJМb2N€ZÚR,žbŽžBО: ŸJTŸ>’Ÿ>П> >L >Š BÌ ^*¡Jt¡:®¡6ä¡6¢6P¢6†¢6¼¢6ò¢F8£6n£>¬£6â£6¤Nf¤6œ¤:Ö¤6 ¥:F¥:€¥:º¥f ¦6V¦6Œ¦6¦:ü¦62§Fx§6®§6ä§:¨:X¨:’¨Nà¨>©Nl©Nº©6ð©6&ª6\ª6’ª6Ȫ6þªB@«6v«B¸«6î«:(¬6^¬6”¬6ʬ6­66­6l­>ª­6à­:®6P®:Š®6À®:ú®60¯6f¯: ¯6Ö¯6 °6B°6x°6®°6ä°6±6P±6†±NÔ±6 ²6@²6v²6¬²6â²:³6R³6ˆ³6¾³6ô³:.´:h´6ž´<Ú»:¼6J¼6€¼6¶¼6ì¼:&½:`½6–½:н6¾6<¾6r¾6¨¾:â¾6¿:R¿:Œ¿6¿6ø¿6.À6dÀ:žÀ:ØÀ6Á:HÁ6~Á6´Á6êÁ6 Â:ZÂ:”Â6ÊÂ:Ã6:Ã6pÃ6¦Ã6ÜÃ:Ä:PÄ6 xbase-2.0.0/bin/0000777000000000000000000000000007316217173007105 5xbase-2.0.0/bin/Makefile.in0000644000000000000000000003147407316217173011077 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ GLINC = @GLINC@ GLLIB = @GLLIB@ LD = @LD@ LIBDL = @LIBDL@ LIBJPEG = @LIBJPEG@ LIBNSL = @LIBNSL@ LIBOBJS = @LIBOBJS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ NM = @NM@ PACKAGE = @PACKAGE@ PAMINC = @PAMINC@ PAMLIBPATHS = @PAMLIBPATHS@ PAMLIBS = @PAMLIBS@ RANLIB = @RANLIB@ TVPROGS = @TVPROGS@ VERSION = @VERSION@ XPMINC = @XPMINC@ XPMLIB = @XPMLIB@ XSUBDIRS = @XSUBDIRS@ X_INCLUDES = @X_INCLUDES@ X_LDFLAGS = @X_LDFLAGS@ doxygen = @doxygen@ topdir = @topdir@ x_includes = @x_includes@ x_libraries = @x_libraries@ INCLUDES = -I$(topdir) $(all_includes) LDADD = -L$(topdir)/xbase/.libs -lxbase INSTALL_PROGRAM = @INSTALL@ bin_PROGRAMS = checkndx copydbf dbfxtrct deletall dumphdr dumprecs packdbf reindex undelall zap dbfutil1 noinst_PROGRAMS = dumpdbt checkndx_SOURCES = checkndx.cpp copydbf_SOURCES = copydbf.cpp dbfxtrct_SOURCES = dbfxtrct.cpp dbfutil1_SOURCES = dbfutil1.cpp deletall_SOURCES = deletall.cpp dumpdbt_SOURCES = dumpdbt.cpp dumphdr_SOURCES = dumphdr.cpp dumprecs_SOURCES = dumprecs.cpp packdbf_SOURCES = packdbf.cpp reindex_SOURCES = reindex.cpp undelall_SOURCES = undelall.cpp zap_SOURCES = zap.cpp noinst_HEADERS = EXTRA_DIST = makefile.g95 bin.ide MAINTAINERCLEANFILES = Makefile.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../xbase/xbconfig.h CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I../xbase CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ checkndx_OBJECTS = checkndx.o checkndx_LDADD = $(LDADD) checkndx_DEPENDENCIES = checkndx_LDFLAGS = copydbf_OBJECTS = copydbf.o copydbf_LDADD = $(LDADD) copydbf_DEPENDENCIES = copydbf_LDFLAGS = dbfxtrct_OBJECTS = dbfxtrct.o dbfxtrct_LDADD = $(LDADD) dbfxtrct_DEPENDENCIES = dbfxtrct_LDFLAGS = deletall_OBJECTS = deletall.o deletall_LDADD = $(LDADD) deletall_DEPENDENCIES = deletall_LDFLAGS = dumphdr_OBJECTS = dumphdr.o dumphdr_LDADD = $(LDADD) dumphdr_DEPENDENCIES = dumphdr_LDFLAGS = dumprecs_OBJECTS = dumprecs.o dumprecs_LDADD = $(LDADD) dumprecs_DEPENDENCIES = dumprecs_LDFLAGS = packdbf_OBJECTS = packdbf.o packdbf_LDADD = $(LDADD) packdbf_DEPENDENCIES = packdbf_LDFLAGS = reindex_OBJECTS = reindex.o reindex_LDADD = $(LDADD) reindex_DEPENDENCIES = reindex_LDFLAGS = undelall_OBJECTS = undelall.o undelall_LDADD = $(LDADD) undelall_DEPENDENCIES = undelall_LDFLAGS = zap_OBJECTS = zap.o zap_LDADD = $(LDADD) zap_DEPENDENCIES = zap_LDFLAGS = dbfutil1_OBJECTS = dbfutil1.o dbfutil1_LDADD = $(LDADD) dbfutil1_DEPENDENCIES = dbfutil1_LDFLAGS = dumpdbt_OBJECTS = dumpdbt.o dumpdbt_LDADD = $(LDADD) dumpdbt_DEPENDENCIES = dumpdbt_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ HEADERS = $(noinst_HEADERS) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(checkndx_SOURCES) $(copydbf_SOURCES) $(dbfxtrct_SOURCES) $(deletall_SOURCES) $(dumphdr_SOURCES) $(dumprecs_SOURCES) $(packdbf_SOURCES) $(reindex_SOURCES) $(undelall_SOURCES) $(zap_SOURCES) $(dbfutil1_SOURCES) $(dumpdbt_SOURCES) OBJECTS = $(checkndx_OBJECTS) $(copydbf_OBJECTS) $(dbfxtrct_OBJECTS) $(deletall_OBJECTS) $(dumphdr_OBJECTS) $(dumprecs_OBJECTS) $(packdbf_OBJECTS) $(reindex_OBJECTS) $(undelall_OBJECTS) $(zap_OBJECTS) $(dbfutil1_OBJECTS) $(dumpdbt_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cpp .lo .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps bin/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done mostlyclean-noinstPROGRAMS: clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: checkndx: $(checkndx_OBJECTS) $(checkndx_DEPENDENCIES) @rm -f checkndx $(CXXLINK) $(checkndx_LDFLAGS) $(checkndx_OBJECTS) $(checkndx_LDADD) $(LIBS) copydbf: $(copydbf_OBJECTS) $(copydbf_DEPENDENCIES) @rm -f copydbf $(CXXLINK) $(copydbf_LDFLAGS) $(copydbf_OBJECTS) $(copydbf_LDADD) $(LIBS) dbfxtrct: $(dbfxtrct_OBJECTS) $(dbfxtrct_DEPENDENCIES) @rm -f dbfxtrct $(CXXLINK) $(dbfxtrct_LDFLAGS) $(dbfxtrct_OBJECTS) $(dbfxtrct_LDADD) $(LIBS) deletall: $(deletall_OBJECTS) $(deletall_DEPENDENCIES) @rm -f deletall $(CXXLINK) $(deletall_LDFLAGS) $(deletall_OBJECTS) $(deletall_LDADD) $(LIBS) dumphdr: $(dumphdr_OBJECTS) $(dumphdr_DEPENDENCIES) @rm -f dumphdr $(CXXLINK) $(dumphdr_LDFLAGS) $(dumphdr_OBJECTS) $(dumphdr_LDADD) $(LIBS) dumprecs: $(dumprecs_OBJECTS) $(dumprecs_DEPENDENCIES) @rm -f dumprecs $(CXXLINK) $(dumprecs_LDFLAGS) $(dumprecs_OBJECTS) $(dumprecs_LDADD) $(LIBS) packdbf: $(packdbf_OBJECTS) $(packdbf_DEPENDENCIES) @rm -f packdbf $(CXXLINK) $(packdbf_LDFLAGS) $(packdbf_OBJECTS) $(packdbf_LDADD) $(LIBS) reindex: $(reindex_OBJECTS) $(reindex_DEPENDENCIES) @rm -f reindex $(CXXLINK) $(reindex_LDFLAGS) $(reindex_OBJECTS) $(reindex_LDADD) $(LIBS) undelall: $(undelall_OBJECTS) $(undelall_DEPENDENCIES) @rm -f undelall $(CXXLINK) $(undelall_LDFLAGS) $(undelall_OBJECTS) $(undelall_LDADD) $(LIBS) zap: $(zap_OBJECTS) $(zap_DEPENDENCIES) @rm -f zap $(CXXLINK) $(zap_LDFLAGS) $(zap_OBJECTS) $(zap_LDADD) $(LIBS) dbfutil1: $(dbfutil1_OBJECTS) $(dbfutil1_DEPENDENCIES) @rm -f dbfutil1 $(CXXLINK) $(dbfutil1_LDFLAGS) $(dbfutil1_OBJECTS) $(dbfutil1_LDADD) $(LIBS) dumpdbt: $(dumpdbt_OBJECTS) $(dumpdbt_DEPENDENCIES) @rm -f dumpdbt $(CXXLINK) $(dumpdbt_LDFLAGS) $(dumpdbt_OBJECTS) $(dumpdbt_LDADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< .cpp.lo: $(LTCXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = bin distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done checkndx.o: checkndx.cpp copydbf.o: copydbf.cpp dbfutil1.o: dbfutil1.cpp dbfxtrct.o: dbfxtrct.cpp deletall.o: deletall.cpp dumpdbt.o: dumpdbt.cpp dumphdr.o: dumphdr.cpp dumprecs.o: dumprecs.cpp packdbf.o: packdbf.cpp reindex.o: reindex.cpp undelall.o: undelall.cpp zap.o: zap.cpp info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \ mostlyclean-compile mostlyclean-libtool \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \ clean-libtool clean-tags clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-noinstPROGRAMS \ distclean-compile distclean-libtool distclean-tags \ distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-noinstPROGRAMS \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xbase-2.0.0/bin/Makefile.am0000644000000000000000000000135607203046325011054 INCLUDES= -I$(topdir) $(all_includes) LDADD = -L$(topdir)/xbase/.libs -lxbase INSTALL_PROGRAM = @INSTALL@ bin_PROGRAMS = checkndx copydbf dbfxtrct deletall dumphdr dumprecs packdbf \ reindex undelall zap dbfutil1 noinst_PROGRAMS = dumpdbt checkndx_SOURCES = checkndx.cpp copydbf_SOURCES = copydbf.cpp dbfxtrct_SOURCES = dbfxtrct.cpp dbfutil1_SOURCES = dbfutil1.cpp deletall_SOURCES = deletall.cpp dumpdbt_SOURCES = dumpdbt.cpp dumphdr_SOURCES = dumphdr.cpp dumprecs_SOURCES = dumprecs.cpp packdbf_SOURCES = packdbf.cpp reindex_SOURCES = reindex.cpp undelall_SOURCES = undelall.cpp zap_SOURCES = zap.cpp noinst_HEADERS = EXTRA_DIST = \ makefile.g95 \ bin.ide MAINTAINERCLEANFILES = Makefile.in xbase-2.0.0/bin/checkndx.cpp0000644000000000000000000000407407217450134011315 /* $Id: checkndx.cpp,v 1.8 2000/12/18 17:58:52 dbryson Exp $ Xbase project source code Copyright (C) 1997 Startech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo file support V 1.6a 5/1/98 - Added expression suppport V 1.8 11/29/98 - Version 1.8 upgrade */ #include "xbase/xbase.h" int main(int ac,char** av) { #ifdef XBASE_DEBUG xbXBase x; xbDbf d( &x ); xbNdx i( &d ); xbShort rc; if( 3 != ac ){ cout << "\nUsage: checkndx dbf_file index_file\n"; return 1; } if(( rc = d.OpenDatabase( av[1] )) != XB_NO_ERROR ) { cout << "\nCould not open file " << av[1] << " rc = " << rc << "\n"; return 2; } if(( rc = i.OpenIndex( av[2] )) != XB_NO_ERROR ) { cout << "\nCould not open file " << av[2] << " rc = " << rc << "\n"; return 3; } cout << "\nRunning...\n"; rc = i.CheckIndexIntegrity( 1 ); cout << "\nNdx integrity check = " << rc << "\n"; i.DumpHdrNode(); d.CloseDatabase(); #else cout << "\nXBASE_DEBUG is not compiled in\n"; #endif return 0; } xbase-2.0.0/bin/copydbf.cpp0000644000000000000000000000411707164426563011164 /* $Id: copydbf.cpp,v 1.6 2000/09/27 17:25:07 dbryson Exp $ Xbase project source code This sample program copies the structure of one dbf to another dbf file Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net */ #include int main(int ac,char** av) { if (3 != ac) { cout << "\nUsage: copydbf filename1 filename2\n" "This program copies the structure of one dbf file to another\n"; return 1; } char* sfilename = av[1]; char* tfilename = av[2]; xbXBase x; xbDbf MyFile( &x ); xbShort rc = MyFile.OpenDatabase( sfilename ); if( rc != XB_NO_ERROR ) { cout << "Could not open file " << sfilename << " Error = " << rc << "\n"; return 2; } // OverlaySwitch = 0; /* dont overlay existing file if it exists */ xbShort OverlaySwitch = 1; /* overlay existing file if it exists */ if(( rc = MyFile.CopyDbfStructure( tfilename, OverlaySwitch )) != XB_NO_ERROR ) { cout << "Could not copy file " << tfilename << " Error = " << rc << "\n"; return 3; } MyFile.CloseDatabase(); /* close database */ return 0; } xbase-2.0.0/bin/dbfxtrct.cpp0000644000000000000000000001143007203043261011332 /* Xbase project source code This program extracts data from a dbf data file and puts it in a comma delimited output file, suitable for input into an awk or perl script This program excludes all memo fields Copyright (C) 1997 Startech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.8 4/15/99 - Initial creation of this program */ #include "xbase/xbase.h" /*************************************************************************/ void Usage(); void Usage() { cout << "\nUsage: dbfxtrct -iDATABASE.DBF -sINDEX.N[TD]X -f -F -dMM/DD/YY\n"; cout << "\nWhere DATABASE.DBF is the name of the database file to dump\n"; cout << "INDEX.NTX or .NDX is an optional index sort paramater\n"; cout << "-f optional field name list in first record\n"; cout << "-F optional field name and attributes in first record\n"; cout << "MM/DD/YY is an optional output date format for any date fields\n"; cout << "\nThis program creates output suitable for awk and perl scripts\n"; cout << "\nThis program does not support memo fields (yet).\n"; } /*************************************************************************/ int main(int ac,char** av) { xbXBase x; xbDbf d( &x ); xbShort rc, FieldOption = 0; xbIndex *ix = 0; xbNdx z(&d); char *dbfname = NULL; char *ixname = NULL; char *p; char buf[200]; /* Get the input paramaters -i input datafile name -s optional sort index name -f optional field names in record one -F optional field names and attributes in record one -d date format */ for( int i = 1; i < ac; i++ ) { p = av[i]; if( *p != '-' ){ cout << "Invalid paramater " << *p << endl; Usage(); return 1; } p++; if( *p == 'i' ) dbfname = ++p; else if( *p == 's' ) ixname = ++p; else if( *p == 'f' ) FieldOption = 1; else if( *p == 'F' ) FieldOption = 2; else if( *p == 'd' ) x.SetDefaultDateFormat( ++p ); else{ cout << "Invalid paramater " << *p << endl; Usage(); return 1; } } /* if missing params, display a usage message and exit */ if( !dbfname ){ Usage(); return 1; } /* open the database file */ if(( rc = d.OpenDatabase( dbfname )) != XB_NO_ERROR ) { cout << "\nCould not open file " << dbfname << " rc = " << rc << "\n"; return 2; } /* if an index was specified, open the index file */ if( ixname ){ #ifdef XB_INDEX_NTX if( strstr( ixname, "NTX" )) ix = new xbNtx( &d ); #endif #ifdef XB_INDEX_NDX if( strstr( ixname, "NDX" )) ix = new xbNdx( &d ); #endif if( !ix ){ cout << "Unknown index type. .NTX and .NDX index file support only\n"; return 3; } if(( rc = ix->OpenIndex( ixname )) != XB_NO_ERROR ) { cout << "\nCould not open index " << ixname << " rc = " << rc << "\n"; return 4; } } /* if -f or -F paramater, dump the header information */ if( FieldOption ){ for( xbLong l = 0; l < d.FieldCount(); l++ ){ if( l ) cout << ","; cout << d.GetFieldName(l); if( FieldOption == 2 ){ cout << "|" << d.GetFieldType(l) << "|" << d.GetFieldLen(l); cout << "|" << d.GetFieldDecimal(l); } } cout << endl; } /* if an index used, then loop thru each record, based on index, else dump in dbf sort order */ if( ixname ) rc = ix->GetFirstKey(); else rc = d.GetFirstRecord(); while( rc == XB_NO_ERROR ){ for( xbLong l = 0; l < d.FieldCount(); l++ ){ if( l ) cout << ","; strcpy( buf, x.LTRIM( d.GetStringField( l ))); if( d.GetFieldType( l ) == 'D' ) cout << x.DTOC( buf ); else cout << x.TRIM( buf ); } if( ixname ) rc = ix->GetNextKey(); else rc = d.GetNextRecord(); cout << endl; } /* close everything */ d.CloseDatabase(); return 0; } xbase-2.0.0/bin/deletall.cpp0000644000000000000000000000372407164426563011327 /* $Id: deletall.cpp,v 1.6 2000/09/27 17:25:07 dbryson Exp $ Xbase project source code This sample program deletes all records in an Xbase DBF file Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.8 11/29/98 - Version 1.8 upgrade */ #include int main(int ac,char** av) { if (ac <= 1) { cout << "\nUsage: deletall filename...\n" ; return 1; } for (int i=1; i " << filename; cout << " Return Code = " << rc; } MyFile.CloseDatabase(); /* close database */ cout << "\nDone...\n\n"; } return 0; } xbase-2.0.0/bin/dumphdr.cpp0000644000000000000000000000363407164426563011204 /* $Id: dumphdr.cpp,v 1.6 2000/09/27 17:25:07 dbryson Exp $ This sample program dumps an Xbase header record Xbase project source code Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 11/29/98 - Version 1.8 upgrade */ #include int main( int ac, char ** av ) { #ifdef XBASE_DEBUG xbShort rc; xbXBase x; if( ac <= 1 ) { cout << "\nUsage: dumphdr filename...\n"; return 1; } for( int i = 1; i < ac; ++i ){ char * filename = av[i]; xbDbf MyFile( &x ); if(( rc = MyFile.OpenDatabase( filename )) != 0 ) { cout << "Could not open file rc = " << rc << " file = " << filename << "\n"; return 0; } MyFile.DumpHeader( 3 ); MyFile.CloseDatabase(); } #else cout << "\nXBASE_DEBUG is not compiled in\n"; #endif return 0; } xbase-2.0.0/bin/dumprecs.cpp0000644000000000000000000000447007164426563011362 /* $Id: dumprecs.cpp,v 1.6 2000/09/27 17:25:07 dbryson Exp $ Xbase project source code This sample program dumps Xbase records Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.7.4d 23/11/98 - Added exceptions support V 1.8 11/29/98 - Version 1.8 upgrade */ #include #ifdef HAVE_EXCEPTIONS #include #endif int main(int ac,char** av) { if (ac <= 1) { cout << "\nUsage: dumprecs filename...\n" ; return 1; } for (int i=1; i int main(int ac,char** av) { if (ac <= 1) { cout << "\nUsage: packdbf filename...\n" "\nThis program does not automatically reindex any NDX indexes." "\nUse the reindex program to reindex any indexes associated" "\nwith the database, or build your own program which executes " "\nthe PackDatabase() method after opening all the index files " "\nassociated with the database.\n\n" ; return 1; } for (int i=1; i " << filename; cout << " Return Code = " << rc; } MyFile.CloseDatabase(); /* close database */ cout << "\nPack Database complete...\n\n"; } return 0; } xbase-2.0.0/bin/reindex.cpp0000644000000000000000000000470507234452607011173 /* $Id: reindex.cpp,v 1.7 2001/01/27 04:58:47 dbryson Exp $ Xbase project source code This sample program packs an Xbase DBF file Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 11/29/98 - Version 1.8 upgrade */ #include static void showStatus(xbLong itemNum, xbLong numItems) { printf("indexing record %ld of %ld\r", itemNum, numItems); fflush(stdout); } int main(int ac,char** av) { if (3 != ac) { cout << "\nUsage: reindex dbf_file ndx_file\n" ; return 1; } char* filename = av[1]; char* filename2 = av[2]; xbXBase x; xbDbf MyFile( &x ); xbNdx MyIndex( &MyFile ); if( MyFile.OpenDatabase( filename )) { cout << "Could not open file " << filename << "\n"; return 0; } if( MyIndex.OpenIndex( filename2 )) { cout << "Could not open index file " << filename2 << "\n"; return 0; } xbShort rc = MyIndex.ReIndex(showStatus); printf("\n"); if( rc != XB_NO_ERROR ) { cout << "\nError reindexing index ==> " << filename2; cout << " Return Code = " << rc; } /* or if(( rc = MyFile.RebuildAllIndicis()) != XB_NO_ERROR ) { cout << "\nError reindexing..."; cout << "\nReturn Code = " << rc; } */ MyFile.CloseDatabase(); /* close database */ return 0; } xbase-2.0.0/bin/undelall.cpp0000644000000000000000000000446307164426563011342 /* $Id: undelall.cpp,v 1.6 2000/09/27 17:25:07 dbryson Exp $ Xbase project source code This sample program zaps an Xbase DBF file Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.8 11/29/98 - Version 1.8 upgrade */ #include int main(int ac,char** av) { if (ac <= 1) { cout << "\nUsage: undelall filename...\n" "\nThis program does not automatically reindex any NDX indexes." "\nUse the reindex program to reindex any indexes associated" "\nwith the database, or build your own program which executes " "\nthe PackDatabase() method after opening all the index files " "\nassociated with the database.\n\n" ; return 1; } for (int i=1; i " << filename; cout << " Return Code = " << rc; } MyFile.CloseDatabase(); /* close database */ cout << "\nUndelete all records complete...\n\n"; } return 0; } xbase-2.0.0/bin/zap.cpp0000644000000000000000000000436607164426563010336 /* $Id: zap.cpp,v 1.6 2000/09/27 17:25:07 dbryson Exp $ Xbase project source code This sample program zaps an Xbase DBF file Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.8 11/29/98 - Version 1.8 upgrade */ #include int main(int ac,char** av) { if (ac <= 1) { cout << "\nUsage: zap filename...\n" "\nThis program does not automatically reindex any indices." "\nUse the reindex program to reindex any indexes associated" "\nwith the database, or build your own program which executes " "\nthe PackDatabase() method after opening all the index files " "\nassociated with the database.\n\n" ; return 1; } for (int i=1; i " << filename; cout << " Return Code = " << rc; } MyFile.CloseDatabase(); /* close database */ cout << "\nZap Database complete...\n\n"; } return 0; } xbase-2.0.0/bin/dbfutil1.cpp0000644000000000000000000004254307164426563011255 /* $Id: dbfutil1.cpp,v 1.6 2000/09/27 17:25:07 dbryson Exp $ dbf utility program This is a generic XBase menu program for executing XBase functions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net */ #include xbXBase x; xbDbf d( &x ); xbIndex *ix; class MyClass { public: MyClass() {}; void OpenFile(); void CloseFile(); void ConvertDatabase(); void ReindexDatabase(); void DeleteMemoField(); void UpdateMemoField(); void ShowFieldInfo(); void ShowFieldData(); void UpdateFieldData(); void PutRecord(); void GetRecord(); void DumpDbtHeader(); void BlankRecord(); void FindMemoBlocks(); void GetMemoBlocks(); void FileStats(); void MainMenu(); void FileMenu(); void RecordMenu(); void FieldMenu(); void IndexMenu(); void DebugMenu(); void OpenIndex(); void CloseIndex(); void FindKey(); void GetFirstKey(); void GetLastKey(); void GetNextKey(); void GetPrevKey(); void Reindex(); void DumpIndexNodes(); }; /************************************************************************/ void MyClass::DumpIndexNodes() { xbLong NodeCnt = ix->GetTotalNodes(); cout << "For NDX indices, output placed in xbase.log" << endl; cout << "total nodes = " << NodeCnt << endl; ix->DumpHdrNode(); if( NodeCnt > 1 ) for( xbLong l = 1L; l <= NodeCnt-1; l++ ) ix->DumpNodeRec( l ); } /************************************************************************/ void MyClass::OpenIndex() { int rc = 0; char Filename[51]; cout << "Enter index name: "; cin >> Filename; if( strstr( Filename, "NDX" ) || strstr( Filename, "ndx" )){ ix = new xbNdx( &d ); rc = ix->OpenIndex( Filename ); } else if( strstr( Filename, "NTX" ) || strstr( Filename, "ntx" )){ ix = new xbNtx( &d ); rc = ix->OpenIndex( Filename ); } else { cout << "Invalid index name. Needs file extension. index.ndx or index.ntx" << endl; return; } cout << "Return code " << rc << endl; } /************************************************************************/ void MyClass::FindKey() { char KeyBuf[101]; memset( KeyBuf, 0x00, 101 ); cout << "This function only works for character keys (so far).."<> KeyBuf; cout << "Return code " << ix->FindKey( KeyBuf ) << endl; } /************************************************************************/ void MyClass::GetNextKey() { cout << "Return code " << ix->GetNextKey() << endl; } /************************************************************************/ void MyClass::GetPrevKey() { cout << "Return code " << ix->GetPrevKey() << endl; } /************************************************************************/ void MyClass::GetFirstKey() { cout << "Return code " << ix->GetFirstKey() << endl; } /************************************************************************/ void MyClass::GetLastKey() { cout << "Return code " << ix->GetLastKey() << endl; } /************************************************************************/ void MyClass::CloseIndex() { cout << "Return code " << ix->CloseIndex() << endl; } /************************************************************************/ /* stats */ void MyClass::FileStats() { cout << "Number of records = " << d.NoOfRecords() << endl; cout << "Number of fields = " << d.FieldCount() << endl; cout << "Database Status = " << d.GetDbfStatus() << endl; cout << "Record Length = " << d.GetRecordLen() << endl; cout << "Memo Fields Present = " << d.MemoFieldsPresent() << endl; cout << "Current Record No = " << d.GetCurRecNo() << endl; } /************************************************************************/ /* open database */ void MyClass::OpenFile() { int rc; char filename[50]; cout << "Enter database file name: "; cin >> filename; rc = d.OpenDatabase( filename ); cout << "Return Code " << rc << endl; } /************************************************************************/ /* close database */ void MyClass::CloseFile() { int rc; rc = d.CloseDatabase(); cout << "Return Code " << rc << endl; } /************************************************************************/ /* convefrt database */ void MyClass::ConvertDatabase() { int rc; xbShort FieldNo; xbLong len, FieldCnt; xbDbf d2( &x ); char *MemoFieldBuf = NULL; xbLong MemoFieldLen = 0L; cout << "Warning - check your results!!" << endl << endl; char filename[50]; cout << "Enter database file name to convert to: "; cin >> filename; if(( rc = d2.OpenDatabase( filename )) != XB_NO_ERROR ){ cout << "Error " << rc << " opening database" << endl; return; } rc = d.GetFirstRecord(); FieldCnt = d.FieldCount(); cout << "Database has " << FieldCnt << " fields to convert" << endl; while( rc == XB_NO_ERROR ) { d2.BlankRecord(); for( xbShort i = 0; i < FieldCnt; i++ ) { if(( FieldNo = d2.GetFieldNo( d.GetFieldName( i ))) == -1 ) cout << "Error converting field " << d.GetFieldName( i ) << endl; else { if( d.GetFieldType( i ) != d2.GetFieldType( FieldNo )) cout << "Error - different field types " << d.GetFieldName(i); else { if( d.GetFieldType( i ) == 'M' ) { #ifdef XB_MEMO_FIELDS len = d.GetMemoFieldLen( i ); if( len > MemoFieldLen ) { if( MemoFieldLen > 0 ) delete MemoFieldBuf; MemoFieldBuf = new char[len]; MemoFieldLen = len; } d.GetMemoField( i, len, MemoFieldBuf, F_SETLKW ); d2.UpdateMemoData( FieldNo, len, MemoFieldBuf, F_SETLKW ); #else cout << "Memo fields not converted XB_MEMO_FIELDS not compiled in\n"; #endif } else{ if( d.GetFieldType(i) == 'N' ){ cout << "const code compile prob..." << endl; // d2.PutField( FieldNo, x.LTRIM( d.GetField( i ))); } else d2.PutField( FieldNo, d.GetField(i)); } } } } rc = d.GetNextRecord(); d2.AppendRecord(); } if( MemoFieldLen > 0 ) delete MemoFieldBuf; d2.CloseDatabase(); } /************************************************************************/ void MyClass::ShowFieldInfo() { cout << "Number Name Type Len Decs" << endl; for( int i = 0; i < d.FieldCount(); i++ ){ printf( "%d %-10s %c %5d %d\n", i, d.GetFieldName(i), d.GetFieldType(i), d.GetFieldLen(i), d.GetFieldDecimal(i) ); if(((i+1)%15) == 0 ){ cout << "Press a key to continue" << endl; getchar(); cout << "Number Name Type Len Decs" << endl; } } cout << "Press a key to continue" << endl; getchar(); } /************************************************************************/ void MyClass::ShowFieldData() { cout << "Name Data" << endl; for( int i = 0; i < d.FieldCount(); i++ ){ printf( "%-10s = %s\n", d.GetFieldName(i), d.GetStringField(i)); if(((i+1)%15) == 0 ){ cout << "Press a key to continue" << endl; getchar(); cout << "Name Data" << endl; } } cout << "Press a key to continue" << endl; getchar(); } /************************************************************************/ void MyClass::UpdateFieldData() { char dbuf[100]; int rc, fn; cout << "Enter Field Number to update (first field is 0): " << endl; cin >> fn; cout << "Enter Field Data" << endl; cin >> dbuf; rc = d.PutField( fn, dbuf ); cout << "Return Code " << rc << endl; } /************************************************************************/ /* open database */ void MyClass::ReindexDatabase() { xbNdx n(&d); int rc; char filename[50]; cout << "Enter index file name: "; cin >> filename; if(( rc = n.OpenIndex( filename )) != XB_NO_ERROR ){ cout << "Error " << rc << " Opening index" << endl; return; } if(( rc = n.ReIndex()) != XB_NO_ERROR ) cout << "Error " << rc << " Reindexing database" << endl; } /************************************************************************/ void MyClass::GetRecord() { int rc; xbLong RecNo; cout << "Enter record number: "; cin >> RecNo; rc = d.GetRecord( RecNo ); cout << "Return Code = " << rc << endl; } /************************************************************************/ void MyClass::UpdateMemoField() { #ifdef XB_MEMO_FIELDS xbShort fn,rc; xbLong len; char bufchar[2]; char *buf; cout << "Enter Field Number: " << endl; cin >> fn; if( fn < 0 || fn > d.FieldCount()){ cout << "Invalid Field Number" << endl; return; } if( d.GetFieldType( fn ) != 'M' ){ cout << "Field " << fn << " is not a memo field" << endl; cout << "Field Name = " << d.GetFieldName( fn ) << " type= "; cout << d.GetFieldType( fn ) << endl; return; } cout << "Enter length of memo data:" << endl; cin >> len; cout << "Enter character to populate memo data:" << endl; cin >> bufchar; buf = new char[len]; memset( buf, bufchar[0], len ); rc = d.UpdateMemoData( fn, len, buf, F_SETLKW ); cout << "Return Code = " << rc << endl; #else cout << "\nXB_MEMO_FIELDS is not compiled in\n"; #endif } /************************************************************************/ void MyClass::DeleteMemoField() { #ifdef XB_MEMO_FIELDS xbShort fn,rc; cout << "Enter Field Number: " << endl; cin >> fn; if( fn < 0 || fn > d.FieldCount()){ cout << "Invalid Field Number" << endl; return; } if( d.GetFieldType( fn ) != 'M' ){ cout << "Field " << fn << " is not a memo field" << endl; cout << "Field Name = " << d.GetFieldName( fn ) << " type= "; cout << d.GetFieldType( fn ) << endl; return; } rc = d.UpdateMemoData( fn, 0, 0, F_SETLKW ); cout << "Return Code = " << rc << endl; #else cout << "\nXB_MEMO_FIELDS is not compiled in\n"; #endif } /************************************************************************/ #ifdef XBASE_DEBUG void MyClass::DumpDbtHeader() { int rc = 0; #ifdef XB_MEMO_FIELDS #ifdef XBASE_DEBUG /* FIXME? Gary, do you mean header or free page list? */ /* - This was a hack to peek in the file for debugging purposes probably not to useful for anything else - Gary */ rc = d.DumpMemoFreeChain(); cout << "\nFuncion Return Code = " << rc << endl; #else cout << "\nXBASE_DEBUG is not compiled in\n"; #endif #else cout << "\nXB_MEMO_FIELDS is not compiled in\n"; #endif } /************************************************************************/ void MyClass::GetMemoBlocks() { #ifdef XB_MEMO_FIELDS xbLong BlocksNeeded, Location, PrevNode; int rc; cout << "Enter number of blocks: " << endl; cin >> BlocksNeeded; cout << "Enter starting location: " << endl; cin >> Location; cout << "Enter previous node: " << endl; cin >> PrevNode; rc = d.GetBlockSetFromChain( BlocksNeeded, Location, PrevNode ); cout << "Return code = " << rc << endl; #else cout << "\nXB_MEMO_FIELDS is not compiled in\n"; #endif } /************************************************************************/ void MyClass::FindMemoBlocks() { #ifdef XB_MEMO_FIELDS xbLong BlocksNeeded, Location, PrevNode; int rc; cout << "Enter number of blocks: " << endl; cin >> BlocksNeeded; rc = d.FindBlockSetInChain( BlocksNeeded, 0, Location, PrevNode ); cout << "Return code = " << rc << endl; cout << "Location = " << Location << endl; cout << "Previous Node = " << PrevNode << endl; #else cout << "\nXB_MEMO_FIELDS is not compiled in\n"; #endif } #endif // XBASE_DEBUG /************************************************************************/ void MyClass::IndexMenu() { int option = 0; while( option != 99 ) { cout << endl << endl << "NDX and NTX Index Menu" << endl; cout << "This program only supports one index at a time" << endl; cout << "1 - Open Index" << endl; cout << "2 - Find Key" << endl; cout << "3 - Get First Key" << endl; cout << "4 - Get Last Key" << endl; cout << "5 - Get Previous Key" << endl; cout << "6 - Get Next Key" << endl; cout << "7 - Close Index" << endl; cout << "99 - Exit Menu" << endl; cin >> option; switch( option ){ case 1: OpenIndex(); break; case 2: FindKey(); break; case 3: GetFirstKey(); break; case 4: GetLastKey(); break; case 5: GetPrevKey(); break; case 6: GetNextKey(); break; case 7: CloseIndex(); break; case 99: break; default: cout << "Invalid option" << endl; break; } } } /************************************************************************/ #ifdef XBASE_DEBUG void MyClass::DebugMenu() { int option = 0; while( option != 99 ) { cout << endl << endl << "Debug Menu" << endl; cout << "1 - Dislay DBT Header" << endl; cout << "2 - Find Memo Blocks" << endl; cout << "3 - Get Memo Blocks" << endl; cout << "4 - Dump index node chains to file xbase.dmp" << endl; cout << "99 - Exit Menu" << endl; cin >> option; switch( option ){ case 1: DumpDbtHeader(); break; case 2: FindMemoBlocks(); break; case 3: GetMemoBlocks(); break; case 4: DumpIndexNodes(); break; case 99: break; default: cout << "Invalid option" << endl; break; } } } #endif // XBASE_DEBUG /************************************************************************/ void MyClass::PutRecord() { xbLong l; cout << "Enter Record number for PutRecord()" << endl; cin >> l; int rc = d.PutRecord( l ); cout << "Return Code " << rc << endl; } /************************************************************************/ void MyClass::FieldMenu() { int option = 0; while( option != 99 ) { cout << endl << endl << "Field Menu" << endl; cout << "1 - Delete Memo Field" << endl; cout << "2 - Update Memo Field" << endl; cout << "3 - Show Field Info" << endl; cout << "4 - Show Field Data" << endl; cout << "5 - Update Field Data" << endl; cout << "99 - Exit Menu" << endl; cin >> option; switch( option ){ case 1: DeleteMemoField(); break; case 2: UpdateMemoField(); break; case 3: ShowFieldInfo(); break; case 4: ShowFieldData(); break; case 5: UpdateFieldData(); break; case 99: break; default: cout << "Function not available" << endl; break; } } } /************************************************************************/ void MyClass::RecordMenu() { int option = 0; cout << "File Menu" << endl; while( option != 99 ) { cout << endl << endl << "Record Menu" << endl; cout << "1 - Get Record" << endl; cout << "2 - Blank Record" << endl; cout << "3 - Append Record" << endl; cout << "4 - Put Record" << endl; cout << "99 - Exit Menu" << endl; cin >> option; switch( option ){ case 1: GetRecord(); break; case 4: PutRecord(); break; case 99: break; default: cout << "Invalid option" << endl; break; } } } /************************************************************************/ void MyClass::FileMenu() { int option = 0; while( option != 99 ) { cout << endl << endl << "File Menu" << endl; cout << "1 - Open File" << endl; cout << "2 - Close File" << endl; cout << "3 - File Stats" << endl; cout << "4 - Convert Database" << endl; cout << "99 - Exit Menu" << endl; cin >> option; switch( option ){ case 1: OpenFile(); break; case 2: CloseFile(); break; case 3: FileStats(); break; case 4: ConvertDatabase(); break; case 99: break; default: cout << "Invalid Option" << endl; } } } /************************************************************************/ void MyClass::MainMenu() { int option = 0; cout << endl<< endl << "XBase Utility Program"; while( option != 99 ) { cout << endl << endl << "Main Menu" << endl; cout << "1 - File Menu" << endl; cout << "2 - Record Menu" << endl; cout << "3 - Field Menu" << endl; cout << "4 - Index Menu" << endl; #ifdef XBASE_DEBUG cout << "5 - Debug Menu" << endl; #endif cout << "99 - Exit" << endl; cin >> option; switch( option ){ case 1: FileMenu(); break; case 2: RecordMenu(); break; case 3: FieldMenu(); break; case 4: IndexMenu(); break; #ifdef XBASE_DEBUG case 5: DebugMenu(); break; #endif case 99: cout << "Bye!! - Thanks for using XBase" << endl; break; default: cout << "Invalid function" << endl; break; } } } /************************************************************************/ int main(int, char**) { MyClass m; m.MainMenu(); return 0; } xbase-2.0.0/bin/dumpdbt.cpp0000644000000000000000000000667407164426563011207 /* $Id: dumpdbt.cpp,v 1.6 2000/09/27 17:25:07 dbryson Exp $ Xbase project source code This program is used for debugging the memo file logic Copyright (C) 1997 Startech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/97 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 11/29/98 - Version 1.8 upgrade */ #include int main( int ac, char **av ) { #ifdef XB_MEMO_FIELDS xbXBase x; if( ac <= 1 ){ cout << "\nUsage: dumpdbt filename...\n"; return 1; } for( int i = 1; i < ac; ++i ){ char* filename = av[i]; xbDbf dbf( &x ); if( dbf.OpenDatabase( filename )){ cout << "\nCant open input file " << filename; return 2; } cout << "\n\nFree Block Chain...."; #ifdef XBASE_DEBUG dbf.DumpMemoFreeChain(); cout <<"\nEnd of free block chain\n***********************************"; #else cout << "\nXBASE_DEBUG is not compiled in\n"; #endif /* lock the memo file */ # ifdef XB_LOCKING_ON dbf.LockMemoFile( F_SETLK, F_RDLCK ); # endif /* XB_LOCKING_ON */ if( !dbf.MemoFieldsPresent() ) { cout << "No memo fields exist in " << filename << endl; } else { xbLong BufSize = 0L; char* Buf = NULL; for( xbLong l = 1; l <= dbf.NoOfRecords(); l++ ) { dbf.GetRecord( l ); cout << "\nRecord # " << dbf.GetCurRecNo(); for( int j = 0; j < dbf.FieldCount(); j++ ) { if( dbf.GetFieldType( j ) == 'M' ) { int len = dbf.GetMemoFieldLen( j ); cout << "\nMemo field " << dbf.GetFieldName(j) << " length = " << len; cout << " Head Block = " << dbf.GetLongField( j ) << "\n"; if( len > BufSize ) { if( BufSize ) free( Buf ); if(( Buf = (( char *) malloc( len ))) == NULL ) return XB_NO_MEMORY; BufSize = len; } dbf.GetMemoField( j, len, Buf, F_SETLKW ); for( int i = 0; i < len; i++ ) cout << Buf[i]; } } } /* unlock the memo file */ # ifdef XB_LOCKING_ON dbf.LockMemoFile( F_SETLK, F_UNLCK ); # endif /* XB_LOCKING_ON */ cout << "\n"; dbf.CloseDatabase(); } #else cout << "\nXB_MEMO_FIELDS is not compiled in\n"; #endif } return 0; } xbase-2.0.0/bin/makefile.g950000644000000000000000000000545307203043261011121 # This file is part of the XBase libraries # Copyright (C) 2000 Derry Bryson # # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # xdb.sourceforge.net # # Mingw32/Cygwin make file CPPFLAGS = -I.. # uncomment the following to generate debug code #DEBUG = -g # Note, if linking to the dll, you need to define XBUSINGDLL CXXFLAGS = -O2 $(DEBUG) -DXBUSINGDLL -Wall --pipe -fvtable-thunks #CXXFLAGS = -O2 $(DEBUG) -Wall --pipe -fvtable-thunks CFLAGS = -02 $(DEBUG) -DXBUSINGDLL -Wall --pipe -fvtable-thunks #CFLAGS = -02 $(DEBUG) -Wall --pipe -fvtable-thunks LDFLAGS = --shared -L../xbase LIBS = -lxbasedll -lstdc++ #LIBS = -lxbase PROGRAMS = \ checkndx.exe \ copydbf.exe \ dbfutil1.exe \ dbfxtrct.exe \ deletall.exe \ dumpdbt.exe \ dumphdr.exe \ dumprecs.exe \ packdbf.exe \ reindex.exe \ undelall.exe \ zap.exe all : $(PROGRAMS) checkndx.exe : checkndx.o $(CXX) -o $@ $(CXXFLAGS) checkndx.o $(LDFLAGS) $(LIBS) copydbf.exe : copydbf.o $(CXX) -o $@ $(CXXFLAGS) copydbf.o $(LDFLAGS) $(LIBS) dbfutil1.exe : dbfutil1.o $(CXX) -o $@ $(CXXFLAGS) dbfutil1.o $(LDFLAGS) $(LIBS) dbfxtrct.exe : dbfxtrct.o $(CXX) -o $@ $(CXXFLAGS) dbfxtrct.o $(LDFLAGS) $(LIBS) deletall.exe : deletall.o $(CXX) -o $@ $(CXXFLAGS) deletall.o $(LDFLAGS) $(LIBS) dumpdbt.exe : dumpdbt.o $(CXX) -o $@ $(CXXFLAGS) dumpdbt.o $(LDFLAGS) $(LIBS) dumphdr.exe : dumphdr.o $(CXX) -o $@ $(CXXFLAGS) dumphdr.o $(LDFLAGS) $(LIBS) dumprecs.exe : dumprecs.o $(CXX) -o $@ $(CXXFLAGS) dumprecs.o $(LDFLAGS) $(LIBS) packdbf.exe : packdbf.o $(CXX) -o $@ $(CXXFLAGS) packdbf.o $(LDFLAGS) $(LIBS) reindex.exe : reindex.o $(CXX) -o $@ $(CXXFLAGS) reindex.o $(LDFLAGS) $(LIBS) undelall.exe : undelall.o $(CXX) -o $@ $(CXXFLAGS) undelall.o $(LDFLAGS) $(LIBS) zap.exe : zap.o $(CXX) -o $@ $(CXXFLAGS) zap.o $(LDFLAGS) $(LIBS) clean : -rm *.o *.exe xbase-2.0.0/bin/bin.ide0000644000000000000000000020163607203053167010260 Borland C++ Project File ²º¾úÎ~ü b, 4*1vŒkß؆ É6  ²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõ÷øùúûüýþÿ                         °±       ! # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  ö  ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º èŽ$ AppE&xpert...莰DoDoèŽ$±bin Default莲.莳.def莴.rtf莵 .ha莶.hrc获.rhI莸.inc莹.asi莺.obj莻4.lib莼.resèŽ(½StripAutoDependsèŽ,¾Remove &AutoDependsèŽ@¿)Remove all [AutoDepend] nodes from a nodeèŽÀ.cppèŽÁ.rcSèŽÂ.exeèŽÃ.dllèŽÄ.c¬èŽÅ.casèŽ$Æ &C CompiležèŽÇ.asmèŽ$È  AppExpertDllèŽÉ$TASMèŽ Ê$IMPLIB~èŽ<Ë"$NOSWAP $CAP MSG(HC312MSG) $EDNAMEèŽÌ.hlpèŽÍ.hpjèŽ Î cpp/cpp32èŽ\ÏD$NOSWAP $CAP MSG(BORL2MSG) +$RSP(-I$INC -D1;$DEF -o$OUTNAME) $EDNAMEèŽÐ.i”èŽÑ$ARGSèŽ ÒW$EDNAME†èŽÓ.kb~èŽÔ.dlgèŽÕ.txtèŽÖ.sppèŽ(×AppExpertDll.cXèŽ4Ø$SAVE ALL $TD $EXENAME $ARGNèŽ(Ù&Turbo DebuggerAèŽ<Ú%Turbo Debugger on current target nodeèŽ,Û$TD -l $EXENAME $ARGèŽÜb.exeèŽ4Ý-m"goto_line $LINE" $EDNAMEèŽ Þ$OUTNAMEèŽ ßgrep.comèŽLà3-n+ $NOSWAP$CAP MSG(GREP2MSG)$PROMPT void $SELNODES×èŽ áws32.exeèŽ â OwlCovertèŽ$ã owlcvt.exe´èŽ(äConvertOWL1SourceèŽLå3+$RSP($OWLCVT) $SELNODES $CAP MSG(BORL2MSG) $NOSWAP¡èŽLæ4Convert currently selected nodes from OWL 1 to OWL 2èŽ$ç regist32.exeèŽ,è$TARGET -RegServerrèŽDé,Register the current target as an OLE serverèŽ,ê$TARGET -UnregServerèŽ0ë&Unregister OLE ServerKèŽHì.Unregister the current target as an OLE server?èŽí.prjèŽ$î RunScriptFileèŽ,ï&Load and Run ScriptèŽ4ðLoad and run a cScript fileèŽ4ñHelp_Compiler 32bit hcrtf.exeèŽ ò hcrtf.exeèŽ$ó CompileHLP32èŽ<ô%/xn $NOSWAP $CAP MSG(GENERIC) $EDNAMEèŽLõ2Compile help project node .hpj to Windows 4.0 .hlpÝèŽ(ö checkndx.exeexeèŽ4÷Create an AppExpert project¹èŽ øORescanèŽ$ùN idOutputPathèŽTúN:Rescan the header files to recreate the AppExpert database£èŽûN.apxèŽ(üRC_File_Editor‡èŽ$ý EditResourceèŽ(þEdit &ResourcesõèŽ$ÿ Edit resourceèŽ .fntèŽ, Bitmap_File_EditorèŽ( EditBitmapFileèŽ$  Edit &BitmapèŽ$  Edit bitmapèŽ .bmpèŽ .rleèŽ, Cursor_File_EditorÑèŽ( EditCursorFileÆèŽ$  Edit &CursorèŽ( Edit cursor fileèŽ .curèŽ( Icon_File_EditorèŽ$  EditIconFileèŽ$  Edit &IconèŽ( Edit icon file†èŽ .icoèŽ( Res_File_EditorâèŽ, EditBinaryResources èŽ0 Edit &Binary Resources èŽ .drvèŽ .vbxèŽ .cplèŽ .fonèŽ0 ASFN:dbfxtrct.exe.exe5e4èŽ tex58èŽ   c0x32.objèŽ$  import32.libèŽ   cw32i.libèŽ$  dbfxtrct.cppèŽ,  ..\xbase\xbasedll.libèŽ4 ASFN:..\xbase\xbasedll.lib6†èŽ(! 4AutoDepReferenceèŽ0#  C:\BC5\INCLUDE\string.heèŽ0$  C:\BC5\INCLUDE\_defs.hYèŽ0%  C:\BC5\INCLUDE\stddef.hMèŽ0&  C:\BC5\INCLUDE\_null.h7èŽ0'  C:\BC5\INCLUDE\windows.hèŽ8(  C:\BC5\INCLUDE\win32\windows.hèŽ0)  C:\BC5\INCLUDE\excpt.hèŽ0*  C:\BC5\INCLUDE\stdarg.hèŽ0+  C:\BC5\INCLUDE\windef.h èŽ0,  C:\BC5\INCLUDE\winnt.h èŽ4-  C:\BC5\INCLUDE\win32\winnt.hèŽ0.  C:\BC5\INCLUDE\ctype.hòèŽ0/  C:\BC5\INCLUDE\pshpack4.hèŽ00  C:\BC5\INCLUDE\poppack.hèŽ01  C:\BC5\INCLUDE\pshpack1.hèŽ02  C:\BC5\INCLUDE\winbase.hèŽ83  C:\BC5\INCLUDE\win32\winbase.hžèŽ04  C:\BC5\INCLUDE\winerror.hèŽ05  C:\BC5\INCLUDE\wingdi.h„èŽ46  C:\BC5\INCLUDE\win32\wingdi.hèŽ07  C:\BC5\INCLUDE\pshpack2.hèŽ08  C:\BC5\INCLUDE\winuser.hèŽ89  C:\BC5\INCLUDE\win32\winuser.hSèŽ0:  C:\BC5\INCLUDE\winnls.hÐèŽ4;  C:\BC5\INCLUDE\win32\winnls.hèŽ0<  C:\BC5\INCLUDE\wincon.hEèŽ4=  C:\BC5\INCLUDE\win32\wincon.hèŽ0>  C:\BC5\INCLUDE\winver.h,èŽ4?  C:\BC5\INCLUDE\win32\winver.hèŽ0@  C:\BC5\INCLUDE\winreg.hèŽ4A  C:\BC5\INCLUDE\win32\winreg.hèŽ0B  C:\BC5\INCLUDE\winnetwk.hèŽ8C  C:\BC5\INCLUDE\win32\winnetwk.h èŽ0D  C:\BC5\INCLUDE\cderr.hÚèŽ4E  C:\BC5\INCLUDE\win32\cderr.h èŽ,F  C:\BC5\INCLUDE\dde.h èŽ4G  C:\BC5\INCLUDE\win32\dde.h èŽ0H  C:\BC5\INCLUDE\ddeml.h¥èŽ4I  C:\BC5\INCLUDE\win32\ddeml.hèŽ,J  C:\BC5\INCLUDE\dlgs.hèŽ4K  C:\BC5\INCLUDE\win32\dlgs.hèŽ0L  C:\BC5\INCLUDE\lzexpand.hèŽ8M  C:\BC5\INCLUDE\win32\lzexpand.hhèŽ0N  C:\BC5\INCLUDE\mmsystem.hèŽ,O  C:\BC5\INCLUDE\nb30.hèŽ4P  C:\BC5\INCLUDE\win32\nb30.h7 èŽ,Q  C:\BC5\INCLUDE\rpc.h èŽ4R  C:\BC5\INCLUDE\win32\rpc.h èŽ0S  C:\BC5\INCLUDE\rpcdce.h¤èŽ4T  C:\BC5\INCLUDE\win32\rpcdce.hèŽ0U  C:\BC5\INCLUDE\rpcdcep.hèŽ8V  C:\BC5\INCLUDE\win32\rpcdcep.hèŽ0W  C:\BC5\INCLUDE\rpcnsi.hqèŽ4X  C:\BC5\INCLUDE\win32\rpcnsi.hèŽ0Y  C:\BC5\INCLUDE\rpcnterr.hèŽ8Z  C:\BC5\INCLUDE\win32\rpcnterr.hBèŽ0[  C:\BC5\INCLUDE\shellapi.hèŽ8\  C:\BC5\INCLUDE\win32\shellapi.h(èŽ0]  C:\BC5\INCLUDE\winperf.hèŽ8^  C:\BC5\INCLUDE\win32\winperf.hèŽ0_  C:\BC5\INCLUDE\winsock.h èŽ0`  C:\BC5\INCLUDE\commdlg.h èŽ8a  C:\BC5\INCLUDE\win32\commdlg.h èŽ0b  C:\BC5\INCLUDE\winspool.hèŽ8c  C:\BC5\INCLUDE\win32\winspool.hV èŽ0d  C:\BC5\INCLUDE\prsht.hH èŽ0e  C:\BC5\INCLUDE\pshpack8.hèŽ,f  C:\BC5\INCLUDE\ole2.hèŽ4g  C:\BC5\INCLUDE\win32\ole2.h% èŽ0h  C:\BC5\INCLUDE\objbase.hèŽ0i  C:\BC5\INCLUDE\rpcndr.hžèŽ4j  C:\BC5\INCLUDE\win32\rpcndr.hèŽ0k  C:\BC5\INCLUDE\rpcnsip.hèŽ8l  C:\BC5\INCLUDE\win32\rpcnsip.hyèŽ0m  C:\BC5\INCLUDE\stdlib.hkèŽ0n  C:\BC5\INCLUDE\wtypes.h_èŽ0o  C:\BC5\INCLUDE\unknwn.hSèŽ4p  C:\BC5\INCLUDE\win32\unknwn.hèŽ0q  C:\BC5\INCLUDE\objidl.h:èŽ4r  C:\BC5\INCLUDE\win32\objidl.hèŽ0s  C:\BC5\INCLUDE\cguid.h!èŽ4t  C:\BC5\INCLUDE\win32\cguid.hèŽ0u  C:\BC5\INCLUDE\oleauto.hèŽ0v  C:\BC5\INCLUDE\oaidl.h±èŽ0w  C:\BC5\INCLUDE\oleidl.h èŽ4x  C:\BC5\INCLUDE\win32\oleidl.hèŽ0y  C:\BC5\INCLUDE\winsvc.hõèŽ4z  C:\BC5\INCLUDE\win32\winsvc.hèŽ4{  C:\BC5\INCLUDE\win32\mcx.hÜèŽ4|  C:\BC5\INCLUDE\win32\imm.hÏèŽ(}  ..\xbase/xtypes.hèŽ0~  C:\BC5\INCLUDE\stdio.hZèŽ0  C:\BC5\INCLUDE\_nfile.hNèŽ,€  ..\xbase/retcodes.hBèŽ(  ..\xbase/xdate.hèŽ0‚  ..\xbase/xbconfigw32.h7èŽ,ƒ  ..\xbase/xbstring.h+èŽ0„  C:\BC5\INCLUDE\iostream.hèŽ(…  ..\xbase/exp.hèŽ(†  ..\xbase/xbase.hèŽ(‡  ..\xbase/xstack.hèŽ(ˆ  ..\xbase/dbf.h èŽ(‰  ..\xbase/index.h èŽ(Š  ..\xbase/ndx.h èŽ(‹  ..\xbase/ntx.hèŽ,Œ  ..\xbase/xbfilter.hìèŽ(  ..\xbase/html.háèŽ, ASFN:checkndx.exe7 èŽ$  checkndx.cpp èŽ4‘ ASFN:..\xbase\xbasedll.lib8þèŽ$’  copydbf.exeñèŽ(“ ASFN:copydbf.exe9èŽ$”  copydbf.cppÞèŽ4• ASFN:..\xbase\xbasedll.lib10èŽ$–  dbfutil1.exeèŽ,— ASFN:dbfutil1.exe11¿èŽ4˜ ASFN:..\xbase\xbasedll.lib12JèŽ$™  dbfutil1.cpp7èŽ$š  deletall.exe9èŽ,› ASFN:deletall.exe13X èŽ$œ  dumpdbt.exeM èŽ, ASFN:dumpdbt.exe14D èŽ$ž  dumphdr.exe9 èŽ,Ÿ ASFN:dumphdr.exe15 èŽ$   dumprecs.exe èŽ,¡ ASFN:dumprecs.exe16¯èŽ$¢  packdbf.exe¤èŽ,£ ASFN:packdbf.exe17›èŽ$¤  reindex.exeèŽ,¥ ASFN:reindex.exe18‡èŽ$¦  undelall.exeèŽ,§ ASFN:undelall.exe19sèŽ ¨ zap.exehèŽ(© ASFN:zap.exe20èŽ$ª  deletall.cpp èŽ$«  dumpdbt.cpp– èŽ$¬  dumphdr.cppŽ èŽ$­  dumprecs.cppèŽ$®  packdbf.cppŸèŽ$¯  reindex.cpp–èŽ$°  undelall.cppèŽ ± zap.cpp„èŽ4² ASFN:..\xbase\xbasedll.lib21èŽ4³ ASFN:..\xbase\xbasedll.lib22èŽ4´ ASFN:..\xbase\xbasedll.lib23èŽ4µ ASFN:..\xbase\xbasedll.lib24èŽ4¶ ASFN:..\xbase\xbasedll.lib25èŽ4· ASFN:..\xbase\xbasedll.lib26èŽ4¸ ASFN:..\xbase\xbasedll.lib27èŽ4¹ ASFN:..\xbase\xbasedll.lib28èŽ$º  dbfxtrct.exe,b†¢ÆÞú2Nj†¢¾ÚöJЦÂÞú2Vr–²Ò*FfÂÞú 6 R n Š ² æ  J v ’ Æ æ  R r ’ ¶ Þ * v š Æ 6 f ® Ê î N‚¢ÆNvªÊîB^†ªÒö>fŠ®Êæ:^†¢Êî:V~ªÚö.Jz–¶ÚúJ~¦Ö6f–Îþ.^ŽÂò"R‚²êJ~®ÞFzªÞBr¦Ö>ržÒ6b–Æþ.ZŽºîR‚ºê N † ¶ î !V!†!¶!î!"V"†"¶"â"#F#v#ª#Ú#$B$r$¢$Ö$%:%j%ž%Î%þ%.&b&’&Æ&ú&.'V'†'¶'â' (:(f(–(¾(æ()6)^)†)®)Ú)*.*R*†*ª*Ò*ö**+N+z+®+Ò+ö+",F,r,–,Â,æ,-6-b-†-²-Ö-.".J.n.’.¶.Ú.þ."/F/f/š/Î/060j0ž0Ò01È=X"VäŒkßÈ"gÖÈ"fgÈ"h4gFÈ"jPg@`h$±niÈ"llg è,°ôgO–À²üÞÿý Ö%&ÿ©·ï³¶ ´$½À®ª«âÙá­µ#ü×Û  7-3./"ðõñ‰4*5*6*7*8*9*:*;*<*=*>*?*y*z*¹º»¼úûdþÿ‚vxu|†„b€Šy…k‹ˆ[hefg•c‘’”–—d]^zwŽs{m˜~o‡ƒ}q“n™›œžŸ ¡¢£°§¢s£²¦¤Õ±¥¸¿öõÚ3.10óøú ñͰ™‚ Ð…„@–ÑŒŠ‹ÌÍÎÏÓÔƒÒ ‡•˜ùôòŽ‘’“”—÷Ø× Ö Ú Ø Ù œ›žFt{qöˆù è, ȸ[g O–H ;.C:\BC5\INCLUDE;../ C:\BC5\LIBõbin.csm3XBUSINGDLLUDE;.." è, ÉP g O–t hs§£¢²¦¤d±¥ è, Êð gO–THs§£¦¢ è,Ëp gO–$s§ è,ÌÀ gO–,  ´Í è,Í gO–,  ´Í è,Îp gO–$ Í è,ÏÀ gO–,3__DEBUG=2;__TRACE;__WARN è,Ð gm O– `h,º n Ü|ig„ O– g„ O– g„  !O–! g„" #O–# g„$ <g%O–%  è,& ´g)g„' (O–( O–P)Cöò€ôù3_RTLDLL;XBUSINGDLL.C:\BC5\INCLUDE;..`h$*  ~i `h$+ Bi`h$, €Bi`h$- ªi`h$. ‚Big„/ 0O–0  è,1 g2O– 2O– 39^j)µd¿„g„4! `g5O–x5d€l Ëeh)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)È"6(„¬g;h`h,7ö…ih…g„8 <g9O–9  è,: €g;O–<;-öò€ôù3_RTLDLL;XBUSINGDLL`h$<  ‡i `h$= ˆBi`h$> ‰Bi`h$? Šªi`h$@ ‹Big„A BO–B  è,C‘ ÐgDO– DO– E9^j)þDXg„F! gGO–xGd€l ‰Xj)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)`h,H’ ²'ilg„I ØgJO–J  è,K“ gLO–LL?öò€ôù3_RTLDLL;XBUSINGDLL`h$M  i `h$N Bi`h$O ‘Bi`h$P” ’ªi`h$Q “Big„R SO–S  è,T• |gUO– UO– V9^j)ÄÔP•g„W! ÄgXO–xXd€l” $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)`h,Y– Â#•i^•g„Z „#g[O–[  è,\— È#g]O–L]?öò€ôù3_RTLDLL;XBUSINGDLL`h$^  —i `h$_ ˜Bi`h$` ™Bi`h$a šBig„b cO–c  è,d˜ %geO– e`h$f™ œªiO– g:^j)Í"¨ tg„h! p%giO–xid€l™ $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)`h,jš 2ipg„k 0)glO–l  è,m› t)gnO–Ln?öò€ôù3_RTLDLL;XBUSINGDLL`h$o   Ÿi `h$p ´ Ð  Bi`h,q Ž ¡Bi¼ è  @ `h$rœ ¢ig„ s x*gt,O–t  è,u ¼*gvO–Lv?öò€ôù3_RTLDLL;XBUSINGDLL`h$w  ¤i `h$x ¥Bi`h$y ¦Bi`h$zž §ig„{ ´+g|O–|  è,}Ÿ ø+g~O–L~?öò€ôù3_RTLDLL;XBUSINGDLL`h$  ©i `h$€ ªBi`h$ «Bi`h$‚  ¬ig„ƒ ð,g„O–„  è,…¡ 4-g†O–L†?öò€ôù3_RTLDLL;XBUSINGDLL`h&‡  à ®i ¼ `h$ˆ ¯Bi`h$‰ °Bi`h$Š¢ ±ig„‹ ..gŒO–Œ  è,£ r.gŽO–LŽ?öò€ôù3_RTLDLL;XBUSINGDLL`h$  ³i `h$ ´Bi`h$‘ µBi`h$’¤ ¶ig„“ j/g”O–”  è,•¥ ®/g–O–L–?öò€ôù3_RTLDLL;XBUSINGDLL`h$—  ¸i `h$˜ ¹Bi`h$™ ºBi`h$𦠻ig„› ¦0gœO–œ  è,§ ê0gžO–Lž?öò€ôù3_RTLDLL;XBUSINGDLL`h$Ÿ  ½i `h$  ¾Bi`h$¡ ¿Bi`h$¢¨ Àig„£ â1g¤O–¤  è,¥© &2g¦O–L¦?öò€ôù3_RTLDLL;XBUSINGDLL`h$§  Âi `h$¨ ÃBi`h$© ÄBi`h$ªª Ūi`h$«« ƪi`h$¬¬ Ǫi`h$­­ Ȫi`h$®® ɪi`h$¯¯ ʪi`h$°° ˪i`h$±± ̪i`h$² ÍBig„³ ´O–´  è,µ² ‚4g¶O– ¶`h$· ÏBig„¸ ¹O–¹  è,º³ 5g»O– »`h$¼ ÑBig„½ ¾O–¾  è,¿´ ¢5gÀO– À`h$Á ÓBig„ ÃO–à  è,ĵ 26gÅO– Å`h$Æ ÕBig„Ç ÈO–È  è,ɶ Â6gÊO– Ê`h$Ë ×Big„Ì ÍO–Í  è,η R7gÏO– Ï`h$Ð ÙBig„Ñ ÒO–Ò  è,Ó¸ â7gÔO– Ô`h$Õ ÛBig„Ö ×O–×  è,ع r8gÙO– ÙO– Ú:^j)n¬PÝg„Û! º8gÜO–xÜd€lª $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)O– Ý:^j)É~Ýg„Þ! n  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)O– à:^j)7„MÝg„á! "@gâO–xâd€l¬ $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)O– ã;^j)0ŒcÝg„ä! ÖCgåO–xåd€l­ $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)O– æ;^j)rÀVÝg„ç! ŠGgèO–xèd€l® $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)O– é;^j)È\Ýg„ê! >KgëO–xëd€l¯ $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)O– ì<^j)gÔTÝg„í! òNgîO–xîd€l° $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)O– ï<^j)g¸UÝg„ð! ¦RgñO–xñd€l± $S;)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !} x‡^)~  !  !€ x‡^) ‰Xj)ƒ ýQi)„  !… ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ &Si) ‰Xj) ‰Xj)4Plˆ¬Èô´à( T È ô H t ˜ Ä ð  H t ˜ Ä ð  ( T p ˆ ¤ ¼ Ø ð $@X„ ¸,Pt˜¼Øð(HdÜø$@X„Àä,Pt¨Ôà”ÀÜô l´Øü <T€Œ¬È@#l#ˆ# #Ì#$<$`$„$¨$Ä$Ü$%%8%X%t%ì()4)L)x)Ä)è) *8*\*|*”*À* +0+T+x+œ+¸+Ð+ü+H,l,,´,Ø,ô, -8-„-ª-Î-ò-.2.J.v.Â.æ. /./R/n/†/²/þ/"0F0j0Ž0ª0Â0î0:1^1‚1¦1Ê1æ1þ1*2v2š2¾2â23*3N3r3–3º3Þ34&4B4Z4†4’4¶4Ò4ê45"5F5b5z5¦5²5Ö5ò5 666B6f6‚6š6Æ6Ò6ö67*7V7b7†7¢7º7æ7ò7828J8v8‚8¢8¾86þÿÿÿ-Æ@hF#' ÌàT Aþÿÿÿ-BCiF$(ÌàT Dþÿÿÿ-EF`F$)ÌàT Gþÿÿÿ-HIkF#* ÌàTJþÿÿÿ-KLjF#+ 4U$Mþÿÿÿ¼Ð–/-ÌàTOþÿÿÿ-PQa-"0h{,ÌàTRþÿÿÿ-STb-"04U$Uþÿÿÿ¨ß2-ÌàTWþÿÿÿ-XYQFS14U$_þÿÿÿò4-ÌàTaþÿÿÿ-bcc/"34U$iþÿÿÿì»Î7jÌàTkþÿÿÿjÉlmeF#5 4U$nþÿÿÿ¬Â9oÌàTpþÿÿÿoÊqrd/$84U${þÿÿÿ„äó<|ÌàT}þÿÿÿ|Ë~lF$:4U$dþÿÿÿ@ëò>ÎÌàTfþÿÿÿÎÏghmF$=4U$€ýÿÿÿle¡@-ÌàT‚ýÿÿÿ-у„-Ìhƒ?ÌàT …ýÿÿÿ-ц‡‘-Ìh„A4U$!ˆýÿÿÿ îG-ÌàT"Šýÿÿÿ-Ò‹Œ0F˜h!…B4U$#ýÿÿÿJ-ÌàT$ýÿÿÿ-‘A h#†H4U$%’ýÿÿÿp+ÒL-ÌàT&“ýÿÿÿ-ØÙÚ’1ˆ h%‡KÌàT'•ýÿÿÿ-Û–—’ˆ h%ˆM4U$(˜ýÿÿÿ˜‡ÂOÜÌàT)™ýÿÿÿÜš›FT h(‰NÌàT*œýÿÿÿÜÝšžFT h(ŠPÌàT+ŸýÿÿÿÜÒš¡FT h(‹Q4U$,©ýÿÿÿ©SªÌàT-«ýÿÿÿªÞ¬­t h,ŒR4U$.³üÿÿÿdJïTßÌàT/´üÿÿÿß൶ .4U$0·üÿÿÿDèôUáÌàT1¸üÿÿÿṺ 04U$2âþÿÿÿØ—ÁWãÌàT3äþÿÿÿãåÀæF$2V4U$4Âþÿÿÿ<÷ôYçÌàT5ÂþÿÿÿçèÃé-$4X4U$6Åþÿÿÿ8ù[çÌàT7Åþÿÿÿçêëì-$6Z4U$8Îýÿÿÿh¼Þ^-ÌàT9Îýÿÿÿ-ÒÏ Dh8\4U$:îþÿÿÿ [Ù`-ÌàT;îþÿÿÿ-ïðÀF$:_4U$<ñþÿÿÿÀNÛbòÌàT=óþÿÿÿòô~õF$<a4U$>ýÿÿÿ€œßd-ÌàT?ýÿÿÿ-Ò÷¡¬h>“c4U$@®ýÿÿÿøÔÙf-ÌàTA®ýÿÿÿ-Ò±²€$h@´e4U$Bøþÿÿÿ\Øh-ÌàTCøþÿÿÿ-ù7ú$œhBµgi!4U$Düýÿÿÿ ^Òk-ÌàTEýýÿÿÿ-ÒþÿZFhD–i4U$F ýÿÿÿ o-ÌàTG ýÿÿÿ-Ò  [FŒhF—l4U$H ýÿÿÿ„Ýr-ÌàTI ýÿÿÿ-Ò  \FhH˜p4U$J ýÿÿÿ¼|Þu-ÌàTK ýÿÿÿ-Ò  ]F|hJ™s4U$L ýÿÿÿè}Þ{-ÌàTM ýÿÿÿ-Ò ÿ^-ôhLšv(LpÄlÀ8Œà4ˆÜ0T¨ü t˜ìdˆÜTxÌðD˜¼ 4 ˆ ¬ T x Ì t ˜ ì  d ˆ Ü T x Ì ð Dh¼à4X¬Ð$HœÀ8Œ°(| ôî| & VŒkß F¨ ɶ))      !"#$%&'()*^4¼h"^4$ÉÛ-HhATh^4^4 €îðhh9lh^4³ ¼h"^4´^4µ¼h"Äh^4 ¶^4 ·¼h"^4 ¸^4 ¹^4 ºh^4».@ø©h^4¼hM^4ÀX0â¼h"8h ^4Á 8hE^4Â?à!ðhTh^4Ã"hM¨h^4Ä#¼h"Œh ^4Å%Œh ^4Ç6¼h"^4ȘΠ.HhATh^4Ì^4Í;¼h"^4Ð^4ÓC¼h"^4ÔD^4ÕE¼h"^4ÖF¼h";^4×I^4 í]hh9^4!û^4"  j^4# m°hG^4$ n°hG^4% q(hI^4& t hK^4' w^4( x^4) y^4* zÒ:n¢Ö >r¦ÚBvªÞFz®âJ~²æN‚¶êR†ºî"VоòPi&À¼ŒkßPð×Èg É–!!   &1:CKT\dmu}…•¥µº¿ÄÉÎÓØ&d(b^ŒkßTƒØˆg É6II*+,-.7<=>?@HMNOPQY^_`afjopqrwxyz€‚‡ˆ‰Š‘’—˜™šŸ ¡¢§¨©ª«¬­®¯°±²·¼ÁÆËÐÕ(Àb(†hŒkß(lkh¬Döÿÿÿˆgn O– h¬Döÿÿÿ¼l  $ g›}O– h¬Döÿÿÿg*O– h¬Döÿÿÿ (g+O– h¬D  öÿÿÿ Lg,O– h¬D  öÿÿÿ$g3pg-h¬D  öÿÿÿlôg7ž†h¬D  öÿÿÿ„l ”g.œƒO– O– h¬Döÿÿÿ ¼g<O– h¬Döÿÿÿ àg=O– h¬Döÿÿÿ g>O– h¬DöÿÿÿÜgE (g?h¬Döÿÿÿdl#"gH Žh¬DöÿÿÿXl Lg@ŸŒO– O– h¬DöÿÿÿhgMO– h¬DöÿÿÿŒgNO– h¬Döÿÿÿ °gOO– h¬D!!öÿÿÿˆgVÔgPh¬D""öÿÿÿ8l%./<#gY¢–h¬D##öÿÿÿ,l$!øgQ¡”O– $O– %h¬D&&öÿÿÿ'"($g^O– 'h¬D((öÿÿÿ)"*8$g_O– )h¬D**öÿÿÿ+"\$g`O– +h¬D,,öÿÿÿxl-"&€$ga£›O– -h¬D..öÿÿÿ4%gg",%gfh¬D//öÿÿÿ l07è(gj¤žO– 0h¬D11öÿÿÿ2/3À)goO– 2h¬D33öÿÿÿ4/5ä)gpO– 4h¬D55öÿÿÿ6/*gqO– 6h¬D77öÿÿÿL l8?4*gr¥£O– 8h¬D99öÿÿÿ:7;+gwO– :h¬D;;öÿÿÿ<7=,+gxO– <h¬D==öÿÿÿ>7P+gyO– >h¬D??öÿÿÿŒ l@ƒGt+gz¦¨O– @h¬DAAöÿÿÿB?CD,gO– Bh¬DCCöÿÿÿD?Eh,g€O– Dh¬DEEöÿÿÿF?Œ,gO– Fh¬DGGöÿÿÿÌ lH…O°,g‚§­O– Hh¬DIIöÿÿÿJGK€-g‡O– Jh¬DKKöÿÿÿLGM¦-gˆO– Lh¬DMMöÿÿÿNGÊ-g‰O– Nh¬DOOöÿÿÿ lP‡Wî-gЍ²O– Ph¬DQQöÿÿÿROS¾.gO– Rh¬DSSöÿÿÿTOUâ.gO– Th¬DUUöÿÿÿVO/g‘O– Vh¬DWWöÿÿÿLlX‰_*/g’©·O– Xh¬DYYöÿÿÿZW[ú/g—O– Zh¬D[[öÿÿÿ\W]0g˜O– \h¬D]]öÿÿÿ^WB0g™O– ^h¬D__öÿÿÿŒl`‹gf0gšª¼O– `h¬Daaöÿÿÿb_c61gŸO– bh¬Dccöÿÿÿd_eZ1g O– dh¬Deeöÿÿÿf_~1g¡O– fh¬DggöÿÿÿÌlh¢1g¢«ÁO– hh¬Diiöÿÿÿjgkr2g§O– jh¬Dkköÿÿÿlgm–2g¨O– lh¬Dmmöÿÿÿngº2g©O– nh¬Dooöÿÿÿ~8gÚ/1Þ2gªh¬Dqqöÿÿÿ26gưÖO– ˆh¬D‰‰öÿÿÿ¼lŠWyÎ6g˱ØO– Šh¬D‹‹öÿÿÿ lŒ_{^7gвÚO– Œh¬Döÿÿÿ\lŽg}î7gÕ³ÜO– Ž(lx¼È \h¬¸ü@„œàì0<€ŒÐXdp´ÀT`¤è,8Dˆ”Øä(4x„È \h¬¸ü L X œ ¨ ì ø < H Œ ˜ Ü è , 8 | ˆ Ì Ø  ( l x ¼ È  \ h ¬ ¸ ü LXœ¨ìø<HŒ˜Üè,8|ˆÌØ(lx¼È P”Ø`¤è,8|ˆÌØ(lx¼È \ÿ—62Œkß0h  ɰc :6Œkß É °c 62ŒkßlÞ™ É  ¼ž ²®Œkߘøâ É’ !#%(,.02468:<>@BDFHJL¬¶ :6Œkß É W„ JFŒkß É* ")*+W„62Œkß ÉVFBŒkߘú³ É&¬¶JFŒkß É*    W„b^Œkß ÉB      "$)*+W„62Œkß ÉW„:6Œkß É"W„62Œkß ÉW„62Œkß ÉW„:6Œkß É"¬¶>:Œkß É W„62Œkß ÉW„B>Œkߨßâ É"W„:6Œkß ÉM¬¶:6Œkß ÉW„62Œkß ÉW„>:Œkߤ·ˆ É9?¬¶JFŒkß É*W„b^Œkßp…ã ÉB     ")*+3W„ NJŒkß É. ")*+EW„!ZVŒkß4Zã É:!  $&'57MW„"RNŒkß É2"$57MW„#b^Œkß ÉB#      ")*+¬¶$B>ŒkßäN¥ É"$W„%:6Œkß É%  V&JFŒkß8@¨ É*&     ¬¶'>:Œkß É'¬¶(>:Œkß É(¬¶)>:Œkß É)¬¶*>:Œkß É*¬¶+>:Œkß É+¬¶,B>Œkߌ:« É",W„-^ZŒkߘµ É>-  $&'57?ACW„.JFŒk߈ã É*.57?ACV/:6Œk߀@¨ É/¬¶062Œkß É0¬¶162Œkß É1V262ŒkßÈ@¨ É2¬¶362Œkß É3V462ŒkßA¨ É4¬¶562Œkß É5W„6FBŒkß É&6")*+V762ŒkßXA¨ É7¬¶8>:Œkß É8V962Œkß A¨ É9¬¶:62Œkß É:W„;NJŒkß É.;")*+-=V<62ŒkßèA¨ É<¬¶=:6Œkß É=V>62Œkß0B¨ É>¬¶?:6Œkß8’ É?V@:6ŒkßxB¨ É@ ¬¶A:6Œkß_á ÉA¬¶BfbŒkßDNÿ ÉFB  W„C62Œkß ÉC"W„D62Œkß ÉD"W„E62Œkß ÉE"W„F:6Œkß ÉF";VG62ŒkßÀB¨ ÉG"¬¶HFBŒk߀’ É&HW„I62Œkß ÉI$VJ62ŒkßC¨ ÉJ$¬¶K:6ŒkßX͘ ÉKVL:6ŒkßPC¨ ÉL&'¬¶M:6Œkß8’ ÉM¬¶NNJŒkßÜ’ É.NVO>:ŒkߘC¨ ÉO)*+¬¶PNJŒk߀’ É.P¬¶QNJŒkß$’ É.Q¬¶R62ŒkßÈ’ ÉRVS62ŒkßàC¨ ÉS-VT62Œkß(D¨ ÉT/VU62ŒkßpD¨ ÉU1¬¶V62Œkß ÉVVW62Œk߸D¨ ÉW3¬¶XB>Œkß É"XVY62ŒkßE¨ ÉY5¬¶ZB>Œkß É"ZV[62ŒkßHE¨ É[7¬¶\:6Œkßä€ã É\ W„]62Œkß É]9V^62ŒkßE¨ É^9¬¶_62Œkß É_V`62ŒkߨE¨ É`;¬¶a62Œkß ÉaVb62Œkß$MÝ Éb=¬¶c>:Œkßl’ ÉcVd62ŒkßÄ’µ Éd?¬¶e:6Œkß’ ÉeVf62Œkß “µ ÉfA¬¶g:6Œkß ÉgVh62ŒkßT“µ ÉhC¬¶i:6Œkß´’ Éi"W„j62Œkß ÉjEVk62Œkßœ“µ ÉkE¬¶l:6ŒkßX’ Él#$W„m62Œkß ÉmGW„n62Œkß ÉnGVo62Œkß䓵 ÉoG¬¶p62Œkßü’ Ép%W„q62Œkß ÉqIVr62Œkß,”µ ÉrI¬¶s62Œkß ’ És&W„t62Œkß ÉtKVu62Œkßt”µ ÉuK¬¶vNJŒkßD’ É.v'()*W„w62Œkß ÉwMW„x62Œkß ÉxMW„y62Œkß ÉyMW„z62Œkß ÉzMV{62Œkß¼”µ É{Mÿ—|:6Œkßà)Ü É|$°c}62ŒkßÔ á É}&ÿ—~62ŒkßxAÝ É~ÿ—62Œk߀$ Éÿ—€62Œkßôjã É€ ÿ—:6Œkßœ{â É 4ÿ—‚:6ŒkßXKñ É‚ /°cƒ62ŒkßÐÛ Éƒ1È=„œ˜ŒkßO–€„tww #  $  %  &  '  (  )  *  +  ,  -  .  /  0  1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?  @  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _  `  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z  {  |  }  ~    €   ‚  ƒ  „  …  †  ‡  ˆ  ‰  Š  ‹  Œ   ” ™ ª « ¬ ­ ® ¯ ° ± ÿ—…:6ŒkßÌP™ É… 8°c†62ŒkßÞΠɆ:ÿ—‡62Œkß¼Š× ɇÿ—ˆ62Œk߸¿Î Ɉÿ—‰62ŒkߌpÝ É‰ÿ—Š:6ŒkßH‘Ô ÉŠFÿ—‹:6ŒkßhJî É‹A°cŒ62Œkß°í› ÉŒCÿ—:6ŒkßDÙÜ ÉI°cŽ62Œkß4Ñ­ ÉŽKÿ—62Œkßh1² Éÿ—62Œkß$¡ Éÿ—‘62Œkß”ý  É‘ÿ—’:6Œkßœ…´ É’!Wÿ—“:6Œkßú³ É“#R°c”62Œkßìäâ É”Tÿ—•:6Œkßdåâ É•"Z°c–62Œkß´æâ É–\ÿ——62Œkß,çâ É—&ÿ—˜62Œkß<;¨ ɘ(ÿ—™62Œkß|ú³ É™*ÿ—š:6Œkߤçâ Éš,b°c›62ŒkßÀçâ É›dÿ—œ:6Œkß8èâ Éœ.hÿ—:6Œkß°èâ É/k°cž62ŒkßÌèâ Éžmÿ—Ÿ62ŒkßDéâ ÉŸ1ÿ— 62Œkß´;¨ É 3ÿ—¡62Œkß`éâ É¡5ÿ—¢:6Œkß,<¨ É¢7s°c£62ŒkßH<¨ É£uÿ—¤62ŒkßÀ<¨ ɤ9ÿ—¥62Œk߈٠ É¥;ÿ—¦62ŒkßÜ<¨ ɦ=ÿ—§:6ŒkßÚ  ɧ?{°c¨62ŒkßÚ  ɨ}ÿ—©62Œkߔڠ É©Aÿ—ª62Œkߨéâ ɪCÿ—«62Œkß°Ú  É«Eÿ—¬:6ŒkßPêâ ɬGƒ°c­62Œkßlêâ É­…ÿ—®62Œkßäêâ É®Iÿ—¯62ŒkßT=¨ ɯKÿ—°62Œkßëâ ɰMÿ—±:6ŒkßÌ=¨ ɱO‹°c²62Œkßè=¨ ɲÿ—³62Œkß`>¨ ɳQÿ—´62Œkß(Û  É´Sÿ—µ62Œkß|>¨ ɵUÿ—¶:6Œkß Û  ɶW“°c·62Œkß¼Û  É·•ÿ—¸62Œkß4Ü  ɸYÿ—¹62Œkßxëâ ɹ[ÿ—º62ŒkßPÜ  ɺ]ÿ—»:6Œkßðëâ É»_›°c¼62Œkß ìâ ɼÿ—½62Œkß„ìâ ɽaÿ—¾62Œkßô>¨ ɾcÿ—¿62Œkß ìâ É¿eÿ—À:6Œkßl?¨ ÉÀg£°cÁ62Œk߈?¨ ÉÁ¥ÿ—Â62Œkß@¨ ÉÂiÿ—Ã62ŒkßÈÜ  ÉÃkÿ—Ä62Œkß@¨ ÉÄmÿ—Å:6Œkß@Ý  ÉÅoÛÿ—Æ:6Œkß¼ìâ ÉÆqÞÿ—Ç:6Œkß`íâ ÉÇsáÿ—È:6Œkßîâ ÉÈuäÿ—É:6Œkߨîâ ÉÉwçÿ—Ê:6ŒkßLïâ ÉÊyêÿ—Ë:6Œkßðïâ ÉË{íÿ—Ì:6Œkß”ðâ ÉÌ}ðÿ—Í:6Œkß8ñâ Éͳ°cÎ62Œk߀ñâ Éεÿ—Ï:6Œkß$òâ Éϸ°cÐ62Œkßlòâ Éкÿ—Ñ:6Œkßóâ Éу½°cÒ62ŒkßXóâ ÉÒ¿ÿ—Ó:6Œkßüóâ ÉӅ°cÔ62ŒkßDôâ ÉÔÄÿ—Õ:6Œkßèôâ ÉՇǰcÖ62Œkß0õâ ÉÖÉÿ—×:6ŒkßÔõâ É׉̰cØ62Œkßöâ ÉØÎÿ—Ù:6ŒkßÀöâ ÉًѰcÚ62Œkß÷â ÉÚÓÿ—Û:6Œk߬÷â ÉÛÖ°cÜ62Œkßô÷â ÉÜØ8…  Œkߨg6¼üÞ, 4Ì4XҌڠ| VªÀ«bx¬†þÃ64Ä:nÄ6¤Ä²VÅ:ÅJÚÅ6ÆFVÆJ ÆbÇ68Ç:rÇ6¨Ç6ÞÇ:È>VÈ6ŒÈBÎÈ:É:BÉ6xÉ>¶ÉJÊbbÊN°ÊZ ËR\Ëb¾ËBÌ::ÌJ„Ì>ÂÌ>Í>>Í>|Í>ºÍBüÍ^ZÎJ¤Î:ÞÎ6Ï6JÏ6€Ï6¶Ï6ìÏ6"ÐFhÐ6žÐ>ÜÐ6Ñ6HÑN–Ñ6ÌÑ:Ò6<Ò:vÒ:°Ò:êÒfPÓ6†Ó6¼Ó6òÓ:,Ô6bÔF¨Ô6ÞÔ6Õ:NÕ:ˆÕ:ÂÕNÖ>NÖNœÖNêÖ6 ×6V×6Œ×6Â×6ø×6.ØBpØ6¦ØBèØ6Ù:XÙ6ŽÙ6ÄÙ6úÙ60Ú6fÚ6œÚ>ÚÚ6Û:JÛ6€Û:ºÛ6ðÛ:*Ü6`Ü6–Ü:ÐÜ6Ý6<Ý6rÝ6¨Ý6ÞÝ6Þ6JÞ6€Þ6¶ÞNß6:ß6pß6¦ß6Üß6à:Là6‚à6¸à6îà6$á:^á:˜á6Îáœjé:¤é6Úé6ê6Fê6|ê:¶ê:ðê6&ë:`ë6–ë6Ìë6ì68ì:rì:¬ì6âì:í6Rí6ˆí6¾í6ôí:.î6dî:žî:Øî6ï6Dï6zï6°ï:êï6 ð6Vð6Œð6Âð:üð62ñ6hñ6žñ6Ôñ:ò6Dò6zò6°ò6æò: ó6Vó6Œó6Âó6øó:2ô6hô6žô6Ôô6 õ:Dõ6zõ6°õ6æõ6ö:Vö6Œö6Âö6øö6.÷:h÷:¢÷:Ü÷:ø:Pø:Šø:Äø:þø:8ù6nù:¨ù6Þù:ú6Nú:ˆú6¾ú:øú6.û:hû6žû:Øû6ü:Hü6 xbase-2.0.0/html/0000777000000000000000000000000007316217174007302 5xbase-2.0.0/html/Makefile.in0000644000000000000000000001445507316217174011274 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # This file is part of the XBase libraries # Copyright (C) 1998,1999 Vitaly Fedrushkov # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # This library 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 # Library General Public License for more details. # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. If not, # write to the Free Software Foundation, Inc., or see # http://www.gnu.org/. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ GLINC = @GLINC@ GLLIB = @GLLIB@ LD = @LD@ LIBDL = @LIBDL@ LIBJPEG = @LIBJPEG@ LIBNSL = @LIBNSL@ LIBOBJS = @LIBOBJS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ NM = @NM@ PACKAGE = @PACKAGE@ PAMINC = @PAMINC@ PAMLIBPATHS = @PAMLIBPATHS@ PAMLIBS = @PAMLIBS@ RANLIB = @RANLIB@ TVPROGS = @TVPROGS@ VERSION = @VERSION@ XPMINC = @XPMINC@ XPMLIB = @XPMLIB@ XSUBDIRS = @XSUBDIRS@ X_INCLUDES = @X_INCLUDES@ X_LDFLAGS = @X_LDFLAGS@ doxygen = @doxygen@ topdir = @topdir@ x_includes = @x_includes@ x_libraries = @x_libraries@ EXTRA_DIST = COPYING.LIB Xb2cpp.html cvsdoc xbase.html xbase.jpg xbase_a1.html xbase_a2.html xbase_apps.html xbase_bib.html xbase_c1.html xbase_c10.html xbase_c11.html xbase_c12.html xbase_c13.html xbase_c14.html xbase_c15.html xbase_c16.html xbase_c17.html xbase_c18.html xbase_c19.html xbase_c2.html xbase_c3.html xbase_c4.html xbase_c5.html xbase_c6.html xbase_c8.html xbase_c9.html xbase_download.html xbase_help.html xbase_links.html xbase_locking.html xbase_mail.html xbase_order.html xbase_port.html xbase_preamble.html xbase_probs.html xbase_toc.html zipflow.gif MAINTAINERCLEANFILES = Makefile.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../xbase/xbconfig.h CONFIG_CLEAN_FILES = DIST_COMMON = COPYING.LIB ChangeLog Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps html/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = html distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xbase-2.0.0/html/COPYING.LIB0000644000000000000000000005577407115376576010711 NOTE! The LGPL below is copyrighted by the Free Software Foundation, but the instance of code that it refers to (the XBase libraries) are copyrighted by the authors who actually wrote it. --------------------------------------------------------------------------- GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS xbase-2.0.0/html/ChangeLog0000644000000000000000000002272607115376601010777 1999-02-11 Vitaly V Fedrushkov * Makefile.am (EXTRA_DIST): COPYING.LIB instead of COPYING.GPL 1999-02-08 Vitaly V Fedrushkov * html/Makefile.am: new file; HTML docs are now subject to `make dist` * Makefile.am (SUBDIRS): html added * configure.in: html/Makefile added 1999-02-08 Bob Cotton dbf.cpp fields.cpp - Added a configurable instance variable, EofChar. Defaults to "\x0D\x1A". - Added SetEofChar() - Added Clipper .NTX support. - Abstracted all referneces from ndx to index. - Added support for Clipper and FoxPro character fields longer then 255 characters. Determined by a char field and a decimal field > 0. - Added LongFieldLen to Schema to represent this. - Fix for incrementing CurRec on an AppendRecord(). - Fix in dump record to handle large fields exp.cpp and expfunc.cpp - Added DESCEND(). Only works for dates. - Added DTOS(). Date to string. - Added RECNO() returns the current record number. - Added 2 and 3 parameter versions of STR() - Added STRZERO() - Small expression parsing fix expproc.cpp - Added support for quoted strings in expressions. ndx.cpp - Changed NodeLink to NdxNodeLink - Moved common instance variables to index.cpp xbase.cpp - Added GetULong(), PutUShort(), PutULong(). Not sure if they're necessary. New Files index.cpp Index Base class for ndx and ntx classes index.h ntx.cpp Clipper NTX class. ntx.h To Do: - Some methods are almost identical in ntx.cpp and ndx.cpp. These could be moved to index.cpp. 1999-02-05 Vitaly V Fedrushkov * xbase/lock.cpp (LockIndex): unrenamed symbol Some HAVE_EXCEPTIONS cleanup: * xbase/dbf.cpp (CreateDatabase, OpenDatabase, AddNdxToIxList): xb_memory_error applied (GetNextRecord, GetPrevRecord): xb_eof_error applied * xbase/expproc.cpp (ProcessOperator): xb_memory_error applied * xbase/memo.cpp (CreateMemoFile): xb_memory_error applied * xbase/ndx.cpp (UncloneNodeChain, CreateIndex, AddKey): xb_memory_error applied (GetNextKey, GetPrevKey): xb_eof_error applied * xbase/xbase.cpp: xbexcept.h included unconditionally (AddDbfToDbfList): xb_memory_error applied * xbase/xbexcept.h: xbStrError() prototype * xbase/xbexcept.cpp (xbStrError): moved outside HAVE_EXCEPTIONS. It is useful anyway. egcs warnings fixes: * xbase/xbase.h (xbXBase::xbXBase): Redundant scope qualifier removed * xbase/xstack.h (xbStack::xbStack): Redundant scope qualifier removed * xbase/exp.h(class xbExpn): Token( void ) removed. Not seen anywhere else. 1999-02-02 Vitaly V Fedrushkov * html/Makefile.am: new file; HTML docs are now subject to `make dist` * Makefile.am (SUBDIRS): html added * configure.in: html/Makefile added 1999-02-01 Vitaly V Fedrushkov DTOS() function from Clipper added: * xbase/expfunc.cpp (DTOS): new function (ProcessFunction): DTOS() function added * xbase/exp.h: DTOS() function added This Page Last Updated 2/2/99 Format of page changed 2/2/99 to try to match GNU format If you make changes/updates to the library, please note them in here with the date, your name and email address. 2/2/99 - V1.8.0a 1999-01-29 Vitaly V Fedrushkov * xbase/Makefile.am (include_HEADERS): xbconfig.h was missing * xbase/exp.cpp (IsSeparator): was misspelled * xbase/lock.cpp (LockIndex): SEEK_ERROR renamed * xbase/ndx.h: NO_ERROR renamed * xbase/dbf.h: NO_ERROR renamed * bin/Xb2cpp.pl: NO_ERROR renamed * xbase/exp.h (struct FuncDtl): renamed to xbFuncDtl * xbase/exp.cpp (xbExpn): FuncDtl renamed * xbase/xdate.h (FMT_XXXX): renamed to XB_FMT_XXXX * xbase/dbf.cpp: FMT_XXXX renamed * xbase/xdate.cpp: FMT_XXXX renamed * xbase/expfunc.cpp (DAY, DOW): FMT_XXXX renamed * examples/testdate.cpp (main): FMT_XXXX renamed * xbase/ndx.h (NDX_NODE_SIZE): renamed to XB_NDX_NODE_SIZE * xbase/ndx.cpp: NDX_NODE_SIZE renamed * xbase/lock.cpp (LockIndex): NDX_NODE_SIZE renamed * xbase/options.h: protective define renamed to __XB_OPTIONS_H__ * xbase/ndx.h: protective define renamed to __XB_NDX_H__ * xbase/retcodes.h: protective define renamed to __XB_RETCODES_H__ (XB_OK): alias to XB_NO_ERROR * AUTHORS: Bob Cotton's email was misspelled - old style ChangeLog follows - Exception support - Denis Pershin - autoconf and automake support - Denis Pershin - fix to TRIM - Michael Bedward - added xbString support - several authors - fix to CreateDatabase for memo field size - always = 10 - Added method xbXBase::DisplayError() 10/27/98 - V1.7.4d - Continued modifications to use const where applicable - Fixes to memo fields - Dbase IV version - always end with 0x1a, 0x1a - Dbase III version - header not updated by BDE-compatability fix - Fixed library to compile when MEMO_FIELDS unvalued - Look at DBF file to determine version, not DBT file 10/26/98 - V1.7.4c - Added fix to NDX module for big endian machines - Updated PackDatabase routine to not lock non-existent memo files - Updated PackDatabase routine to create temp files in same directory as file to be packed - Converted gcvt calls to sprintf calls for enhanced portability - Renamed types.h to xtypes.h for compatibility reasons - Renamed stack.h to xstakc.h for compatibility reasons - Added fix to NDX which was related to NDX not updated on revise - Added additional expression function RECNO() - Installed portability fix in PutFloatField - autoconf support added - Denis Pershin - updates to us const CHAR * where possible - Denis Pershin 6/9/98 - V1.7.4b - Added methods DBF::CalcCheckSum(), HTML::PrintEncodedChar and PrintEncodedString() - Fixed bug in HTML::DeleteEscChars - Fixed memory leak encountered when closing database - General code cleanup - Fix to CopyDbfStructure - Changed date defines WEEK,MONTH and YEAR to FMT_WEEK,FMT_MONTH and FMT_YEAR due to conflicts with the expression logic - Changed define type in CreateDatabase - Changed define type XFLOAT to FLOAT - Alpha release of expression logic routines 6/3/98 - V1.7.3 - Added methods DBF::Zap(), DBF::DeleteAllRecords(), DBF::UndeleteAllRecords(), DBF::RebuildAllIndices() and DBF::CopyDbfStructure() 5/25/98 - V1.7.1 - Fix in NDX::GetPrevRecord when skipping previous to first record - Added support for Big Endian computers (Intel is Little Endian) - renamed HTML::EndPage to HTML::EndHtmlPage - modified HTML::StartHtmlPage to include and title - Added methods DBF::ValidLogicalData and DBF::ValidNumericData - Add Dbase III compatible memo field support 4/15/98 - V1.6b - Numeric key index support - Added field methods GetDoubleField and PutDoubleField - removed ';' from #endif statements in memo.cc and dbf.cc - renamed all .cc files to .cpp files - included notes for compiling with OpenVMS - thanks Jourquin - added record locking enhancements - thanks Michael 4/1/98 - V1.6a - Included beta version for expression support - Multi-field Index Key support - New XBASE Global Level Class for all date and expression functions - Support for non Linux platforms w/ makefiles - Fixed reported bugs - Changed define DEBUG to XBASE_DEBUG due to conflicts when using Xbase DBMS with other libraries - Added "return 0" to the end of SplitLeafNode() in ndx.cc - Fixed SIGSEGV core dump prob when creating index - Changed Status to DbfStatus in dbf.cc and dbf.h to avoid a conflist with Solaris function Status() - Made io.h includes conditional only for DOS compiles in ndx.cc and dbf.cc - Modified version byte in DBF file header to be 83 is memo fields 1/2/98 - V1.5 - Added Dbase IV memo field support - Added field method FieldCount() - Added field method GetFieldName() - Fixed bug in PackDatabase method 12/7/97 - V1.2b - Fixed an unbalanced if statement in the fields.cc logic. 11/20/97 - V1.2 - Updated and added several new methods to the HTML/CGI class. 10/28/97 - V1.05 - Added date method to determine last day of month for given date - Modified PutField method to handle decimal points - Added field methods GetFloatField - Added field methods PutFloatField - Modified PutField method to handle decimal points with floats - Added additional logic to DateIsValid method 10/23/97 - V 1.02 - Added method PackDatabase - Added method ReIndex - Added method KeyExists - Cleaned up ndx.cc source code - Modified header logic to only update counters, not entire node - Added logic to look for last matching key on non-unique indexes to reduce number of node splits 10/15/97 - Release of V 1.0 - Basic DBF and NDX release xbase-2.0.0/html/Makefile.am0000644000000000000000000000332107115376601011247 ## Process this file with automake to produce Makefile.in ## # This file is part of the XBase libraries # Copyright (C) 1998,1999 Vitaly Fedrushkov # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # This library 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 # Library General Public License for more details. # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. If not, # write to the Free Software Foundation, Inc., or see # http://www.gnu.org/. EXTRA_DIST = COPYING.LIB Xb2cpp.html cvsdoc xbase.html xbase.jpg \ xbase_a1.html xbase_a2.html xbase_apps.html xbase_bib.html \ xbase_c1.html xbase_c10.html xbase_c11.html xbase_c12.html \ xbase_c13.html xbase_c14.html xbase_c15.html xbase_c16.html \ xbase_c17.html xbase_c18.html xbase_c19.html xbase_c2.html \ xbase_c3.html xbase_c4.html xbase_c5.html xbase_c6.html xbase_c8.html \ xbase_c9.html xbase_download.html xbase_help.html xbase_links.html \ xbase_locking.html xbase_mail.html xbase_order.html xbase_port.html \ xbase_preamble.html xbase_probs.html xbase_toc.html zipflow.gif ## Uncomment these to have docs installed by `make install`: ## htmldir = $(prefix)/doc/$(PACKAGE)-$(VERSION)/html ## html_DATA = $(EXTRA_DIST) MAINTAINERCLEANFILES = Makefile.in xbase-2.0.0/html/Xb2cpp.html0000644000000000000000000000746107115376603011252 Xbase to Xbase DBMS C++ Converter

    Xbase to Xbase DBMS C++ Converter

    Program

    Xb2cpp.pl V0.1 26-11-98

    Author

    Hubertus Kehl, kehl@informatik.tu-muenchen.de, kehlh@hotmail.com
    Please send suggestions, bug reports, patches, etc. one of these email adresses.

    Language

    Perl 5.0

    Purpose

    Convert Dbase, Clipper, FOXPRO Source Code to XBASE C++ Code for use with Gary Kunkel's XBASE DBMS Library

    Output

    .cpp File and .h File

    Arguments

    1st arg = filename

    Remarks

    The script tries to keep track of the databases used in different workareas. But the flow through your program cannot be determined, so in some cases you have to help the script a bit by giving additional info.

    Three special comments have been designed to add this info:

    * XB2CPP(SelectedArea)
    or  * XB2CPP(SelectedArea,Workarea1,Alias1,Wa2,Al2...)
    or  * XB2CPP(SelA,WA1,Al1[Total1, Active1],Wa2, Al2[Tot2,Act2])

    e.g. * XB2CPP(3,3,ZP,2,PL) will inform the script for example at the beginning of a PROCEDURE that a database with Alias ZP is opened in workarea 3 and a database with alias PL is opened in workarea2 and when calling this procedure always workarea 3 is selected.

    The third alternative of this statement makes it possible to define the number of open indices and which one is the active index, as given by a previous SET INDEX TO or USE and SET ORDER TO statements. The script cannot know, which procedures, statements have been executed before and opened indices.... So * XB2CPP(2,2,ZP[2,1]) will inform the script about an open database alias ZP in workarea 2 which is currently selected and has two open indices where the first one is the active one.

    Hints

    1. Always give an ALIAS in USE-Statements this is needed for generation of the Database Classnames
    2. Give the above described additional infos where necessary.
    3. Use ALIASes in Expressions with database fields, this helps the script in knowing where database references are.
    4. Replace the XXX in PutXXXField or GetXXXField manually the script is not able to determine variable or field types. The code for getting a Textfield (GetField) must also be corrected. Xbase DBMS Syntax requires the buffer as second parameter, the string will not be returned ! You may use a C++ String wrapper for this job.
    5. PROCEDURES that will operate on two different databases where some statements are used for both cannot be converted The script needs to know everytime on which database the statements are operating. Either duplicate such procedures, (one for each database), or write a generic C++ routine with pointers to databases.
    6. Don't assume any compilable or even working C++ source code as output. The ambigous DBASE language, which lacks type and variable definitions is one reason for this. This script only will help you for about 10-30% of the conversion. The rest (which remained uppercase) has to be done manually :)

    Copyright

    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation (version 2 of the License)

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.


    Hubertus Kehl,29-11-1998
    xbase-2.0.0/html/cvsdoc0000644000000000000000000000462107115376604010426 These are the instructions for using CVS to access the current Xbase source 1. CVS Signons There are two types of signons for the xbase library. a) Guest access - has read only access to the library b) User access - has both read and write access to the library For guest access, the userid is cvsguest and the password is download. For user access, contact the server administrator at for the username and password. 2. Login to CVS server: cvs -d :pserver:username@stargazer.startech.keller.tx.us:/usr/local/cvsroot login you will be asked: CVS password: Enter your password here. If it is OK, you will see file .cvspass in your home directory. You should keep it from anyone's eyes. You can (must?) remove it later using 'cvs logout' or by hand. 3. Check out source tree (xbase): cvs -d :pserver:username@stargazer.startech.keller.tx.us:/usr/local/cvsroot checkout xbase From now on, you work the same as if repository is local. 4. Instead of specifying '-d :pserver:username@server.host/path/to/cvsroot' each time, you can set CVSROOT variable to that value: ------------------------------------------------------------------------ For those of you who have never used a cvs server to access sources, here's a short run down of how to do it: 1) Obtain sources from http://download.cyclic.com/pub/ 2) Compile and install the client. ./configure --disable-server will disable the server 3) Once installed, set your CVSROOT environment to: :pserver:cvsguest@stargazer.startech.keller.tx.us:/usr/local/cvsroot For sh, bash and ksh users, execute the following commands: CVSROOT=:pserver:cvsguest@stargazer.startech.keller.tx.us:/usr/local/cvsroot export CVSROOT You may want to stick these commands in your .profile or .bash_profile. For C shell users (csh, tcsh), execute the following commands: setenv CVSROOT=:pserver:cvsguest@stargazer.startech.keller.tx.us:/usr/local/cvsroot You may want to stick this command in your .cshrc or .login file. 4) From here, login in to the server with cvs login 5) Now get the source cvs checkout xbase 6) Now you can log out cvs logout ------------------------------------------------------------------------------- These instructructions were started by Willy@snowyowl.csu.ac.ru and updated by Gary Kunkel gkunkel@startech.keller.tx.us xbase-2.0.0/html/xbase.html0000644000000000000000000000775307115376606011225 Xbase DBMS v1.8.0b

    Xbase DBMS
    Last Updated 2/20/99
    Version 1.8.0b

    Welcome to Xbase DBMS. Xbase DBMS is a collection of specifications, programs, utilities and a C++ class library for manipulating Xbase type datafiles and indices which has been developed and produced by many people from around the world using the internet. This project was formerly known as Xbase for Linux, but as I have recieved input from several people who are compiling this on platforms other than Linux, I have renamed it to Xbase DBMS. The main development of this library however, remains on the Linux platform utilizing the GCC public domain C/C++ compiler.

    XBase DBMS currently includes routines to support multi-user access for .DBF databases, fields, Dbase III and IV memo fields (variable length fields), dates, record and file locking and (.NDX) indices. As of release 1.7.4, Xbase is compatible with dBASE III data, index and memo fields and also has support for some dBASE IV features.

    New with release 1.8.0

  • Unix automake/autoconf support - thanks to Denis Pershin
  • Exception Processing - Thanks to Denis Pershin
  • The beginnings of a Turbo Vision Interface - thanks to Vitaly Fedrushkov
  • Renamed classes to avoid naming conflicts with other libraries
  • Support for string class - thanks to Hubertus Kehl and Denis Pershin

    There is also an HTML user interface class which works well with the Apache Web Server. Future releases will support filters, enhanced .MDX index files, transaction support, a client server configuration, secure data options and other enhancements requested by anyone using this library.

    If you are looking for database libraries in general, or need access to Xbase files in particular, give Xbase DBMS a try. If you are a C programmer and new to C++ object oriented programming, Xbase for Linux is easy to learn and will help transition you to the world of object oriented programming. If you have never programmed in "C/C++" before, this library should provide complete enough examples to get you started programming in "C/C++" with confidence.


    Table Of Contents

    Xbase DBMS Manual

    Experimental Documentation Created by Doc++

    Sample Programs and Applications

    Makefiles for Various Platforms

    Download Xbase Library

    Help With the Xbase Project

    Report bugs and suggest enhancements

    Order Xbase Products

    Whats New - Change List and Planned Enhancements

    Licensing Information

    Other Xbase related links

    Bibliography

    Xbase Mailing Lists

    Xbase Mail Archives


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase.jpg0000644000000000000000000001442507115376610011026 ÿØÿàJFIFÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ¬½"ÿÄÿÄD !1AQa"q#23BR‘“Ñ$Ub±V‚¡ÁÓCSTr’”ðÿÄÿÄ+!1AQ"aq2‘±Ñ¡ÁðÿÚ ?¿éJP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JPlÛ+·!¸—yVÙLì¶ã*ÐQôPô®dËá·%Cº\ç¤÷o%å8=A®Ä­a‰ÀÌlÚç |Ãm9®­¯ÈŠŽ<2?ñ¹ßÎ4üðÈÿÆç8×ÎMŽOÅo²-WÊ]i_*¼–Ÿ"+O@n¿<2?ñ¹ßÎ5`pÆÅ•gó_[¹Â-º6ƒŽ¥ÒJ”TUKW¯ÙÏ!f4û•…çU'O2 üJº€¼1Ìq¬nãµ:l¾sµ*SÅg~Þ•º¥()JUŸqLžkNÞ1›ì¶m\4¯IXº}ȩ̂z‰×Ÿæ ­H]þzT“¢ |ÿhYwûÁ;ù•‹˜";yÝB%9Ëü­k!B“qšÔ8l­é¨%@Ù&€ÞÿhYwûÁ;ù• Æfñ3-––mW+“ˆ'JyKÓi÷*«Gà=²V'dèø©Çæ1‚¾íÇÔÕÅ[|tLJ¶HÐCi €a8ÍõòÝo.sÑqÇ´§Ù#Ò¥¥¥)@)JP R””¥âŸXÍì*[Jn±’UÎÜÞ©>ƹTW¡Jv,–ÔÛÍ(¡hPÑW|ÕÇüs Êm,“%´ÿ{iñ§öþ¢€ç*Ê·\%Z®,O†êšÂÂдžÄV-(Ôáöi7ÆYžÙJe Iköý JëŒxoœHÁòfå‚¥Ax†å5¾…>¿Q]l{ŒfDp8ÃÈ BÇb ‘JR€ÑÏÌ,Ì–=:äÛI¨ ŽÊР P>¹A%$NÉÐÆñ3ì®.#‰Ìžû€<¤ã£}V²:kýj¨ûCÙ%¶/ˆ‹ Ȉ¤EqÔ6¯ÁPRQÙt‡ãÑßJªoYNCŸ»h·Hç’ôfQ¤ ©Ju@k[$•›>»5Å$ú”thaÂ}»"4VW"d—:%#eJ'©®ªá— àápÛ›1 ‘yq?;§¨kªŸë_œ*á‹U´Lœ„;x};Zõ¿~Èÿ­Y5Ò"”¥§Éò{^#czïwÂŽßD¥=VêÏd y¨èÿI¶I.Ç"_ 6ûqesò!ô€±Êµ ìGtŸ:ç&ß'qŠÍcŒ¥ÔÂ-PXKqùÜIغ@;WTÜTǘ×FbÖlø…ªÚÃ|ˆ‹-º ©=²‘Ø©[Qêz«¹®{–õÜîž¶néJWN R””¥¥)@+åhK© HR4AìE}R€äþ1ðíXìÜ`4¯É3Jt:4¿4ÿJ¬+º²+,šÅ&Õ=°¶_N¶GTŸ"=Åq†YŒÍÄr6™¨!M+h^º8% IW¯x‹ð’+t{î;†âÏáWì}•QUöÓ®0òie!AIRNˆ#΀ïÊUyÂn 7šc©fK€]a¤!ô“ÕcÉcëXÜ]âCxu À€âUx”’ýhÿÒ€®xó™Å™tV?nð–ñާ{+a>‡]?…B± ‹ü8ʬ™ ØâL-) kœ¡C®¹‡E'iWMo·0ÙÖDŒ\.ÜrkÊV&HCnGJÜ@)Ô‚¥$õ;þ5)vÆŒµÂ[ÊJѧÜÔ„‡ZO2H:O^ u¬9™oPrèÞ™²ª%r{|¥Ç(éjW:ÅâìâZ¥"×vm=R§|;ÙBZZwèA=€ë¼„}¢®° x7|]-\ÀJÒ¤­M¶èñÇ"‡2>ïœs+æåÑ i®úìýOìÌÒ®QꎂªÿŒ™dÌGvDzœè‚‡‚ÊKèY.']y€I×Q¢Aë­ÀçÜ[¿¼ÌˆÎÛìÑÔ‚ž_ ¤§`Ÿ™IwÀOoNÇ^u€1Ì’÷<¹˜d_•!x¥ã\á©d(l €Þ¹ºrŽÛQo¨cÔžä›]‘mx¶ØøZûð~pïj½Û$N .cäIûÀò<¶R”5²µùwQï k¦bÇDX­0€”$”h{š¤#Ü“:³²¥È+—S-”MIÑIì4ÙúUÛüÁEHÄzùõ;ïµsÓî´)ϾüyeÙpUü‘辻쌊R•´Â)JP R””¥¥)@*·ãŒÃ2â6?*BI[D®'Í&¬ŠP´)·…¤¥i: ÷¾jâã¦l—Î( jÕiä¤tmÏèj 7x®SpÄ/]mËÔ…~¤ù´xg‡Îâ6Nþ_’;ó%*ìêÇ`?Ê*“«ÜC+ŸæõÉí@–¯¹ZFœ>_C@N¾Ðò™…‚DŽÒØmùrÐÑF“ζP•(òƒÔ°ÞÈí°<ôawÛÜœÍj`@v[!±¼ã(h„€:ò«©:'È÷­ÿÚ%ö#ÜðÇä´ŽÛÒãe<Ái‚F¼ö*5ŸÃf凪DEÇXah’Ÿ‡mÅx‰ÑDôÖ•Í¿A^7¨Æú¡8ü­½ýú–š®ÉÁò—„ÿ“ÎÍÄ»dõøW¨•i'ÁmÆÈé­«CG©î4ïS6ôÌðĈϸQRR¨hÖÊTƒ±½Ê¥ k›êÞáÕè\ìˇ%¸þ,T%Å6¿™²/á=Ç)‡Mw;¬~£é±¢?žuÔч™;¥ðìåý‘#¿d±¸¨~â·ÑâVÛÚç_®# ßSôõ]?Å[žQmtåKŒ…¨tó#[þ¢Ì/*¼d2T• Åae¨éi[G(éÌŸýÚßïÈV¾Én7kÜ80K΀²“Õ(î£û’ ýÕ¯Ó(ªŸ‰|võ·ô(¿6Û,öTøíÂ,¬ås`Ú±ëô– w8R[Qil$3âó¨¨s6~Û®˜³;û,9.Ã}¤¼Ã…œÈXæZè}sg.1bc_”GSÓžD¸’”¤…ué䑯ó{WBál=Ç£ÈiÆ_jÙ6âJT…’ õš«½!·¶µË׿­•ú‡{wã÷ØÞR”¯PÀ)JP R””¥¥)@)J‡ñ;‡ƒc딵%s1™ßU+Ôû #Ç<ÞßkÇ\ÇRÛrgÍOÌ…u §ö¿¥seÆÏp´ˆæ|Gc‰ ‡Z+N¹’|ÅZ<1çq,{&¿•= ·|G¿üeù${ »øƒÂÍq¥AäCrØNâ:¹<¾†€ãýJŠ’BØ#ʲ®vÙV{“öù­¤0²…¤ùX”û\›ã ŸÄgÉm¬‚+ÐÞx«•E=:=v’¤ž‡\ÛÑ TK¼Ü­7Wp¬¡—Ò´n:[~@@lrþ[ÚT… rë¡Ø`WöKÌÜ~ñéÒ܆’P}tGe·q·bÿg9&Kig W2J›Y)ÙèÉÔVvtMgÉdžEnü}’Ê­uKÜŠ_/Ä$Y®n;2×mX.6[sÆð€0Q¦¼‰òó$Úp®,y—8%IŽ˜å’à|5ó•$èß ;×n›î7'À2Wo–ÕD’è\èÚHCqÒµ- ÔTv£½ìý=jcá½ÿ—#ÿ¦Ý|þW¨[ å‹j[齿ëýžµ8µJJèKe æ}EÕväÁSŽ$J‡‚®›Øpé:שöïÒ§¶+t|‘t¹MÁ`þ†X ê+#[ÙØÙ#§Ô'u7”ú!G\‰k\v®gŒÒ ’t:*Úâ×’ÇŠWŽ[yÅ.7‡Ì”)½£D N¶ BBˆê5WS}þ¤ÕrÒ‚ë­óôüø+²ª±¾/môÞÿ~Æo °kŸ2e¹8Rí /îPèÚd©*èÚR­í w;çc©æ#¥«öËthÛðâÅi ²ŽbyPFÏS zȯ ŒTRŒV’<¦Û{b”¥Hà¥)@)JP R””¬KÊ%žÜüùÏ%˜Ì¤©kQ 0²l’+c‘t¸:ÓIùSæµy\¶Êoœfâñ¤´¥m^iŽÈ>_þï^yæksâfRÔXhpÄñ<8qGrONcîk£8k‚GÁ±ÄGÒWp|Êtêý‘ì( %’Í ³Æ¶@h7„¤ßÜûšØU)ŸeùM:‰ibè‘çPh%A*PØ'ήºŠ–Ë,©Á&û”×xt/VÓ‘Ûþÿ?~„Ž®·ëõ̽«¿”´”¨’4Aó®Mã.q,ŒÎ†Ù¹Ê+F‡F׿ŸéR++:˜pï:—ƒdMËARá:B$³¾ŠO¯ÔT>”éÅüJТq#KIakK³Š5ÎTžGBÖÊŽ•êJN¿­jóû# Ã[ñR ˜¿¶ÛZ’ƒóÞÊ'™%;Ö»ë¨ÔpÏ;nÝf%|}Ábº´¸Êq$G.$¤©$‚J…·ŽÝ4[Ÿ²ÝEÆC$8ÉŒ ·:ì«©<©s¨ó€Ö<¬:ò4ç¾<qò¬£jÉæì¬îE›Çã¥/\*GÌRùT­$V®‡@$ú×Lâ8¼;‰g€Û`4€^u(å/»¡Ì⺓²Gm Ð ¥8ëí³-Eþùd~$Vâ;ð«}Aµ¥â Ž­ï˜mÏÄuß¡®‡«±è…öC¡]×JéûåÔR”«Š…)JJR€R” ¥xM›Ý ÙsC1ÚO2ÜYÐH ?eJb WeIu-2ÒJ–µr¸ þi<À‚TÕž:Ï"{íoAY\WâÃùl•Ú­.)«3jÑ#¡|úŸoj®¬VÇ/Wè6ÖÁ*’ò[éèO_ùPϰ41åsÚ×vˆiPü)óWï«Ú±m°µÛ#@Ž–c¶–Ò •@sçJ8«kæ $Ÿ/˜UÌÄÛí+vÓÊ[}hç[šó =5Tg›øŽ,Û£Hu¶P@÷V«¢ã0˜±Za¶€€°ÕA.Yªv'\|¢’]rìI£r+v¶ >„â¯Nõë1Ž,`Roå.' WâeÑÚ¥W˜Í̲͎èÛn2°Gîªoƒ³×(•mJ‰iæÔH÷OBRqš]™}TFüiÍ-J?å¥ÞÂÎ7!È—.uÌBŠKIù@ÕjPü2â|H‡“ϕú»xí‹À—zq·H`NXå–×7]Ê5K=3 å]Áµ(wAV¨œw¦öÄ£kŠœ+Q×\þýLÛ•… ÀLøN p*Øá7Woµ»d¼¥Ù;eQN‡êþ•€„QhKž"9×Z­19˜w#㔸žP£äj¨[?d»´oÈÂÇY7òÆi7ãðuÖ=:ýÂEÉ×™ƒÓ¶šC|ê)õ$׽጖$Eȶ\¶ÒUà<ÀßB<ê½Åxž›E¡¨" 49Zq¥òûÔº/1ÇÈK«}‚m½ã]…µÊ<Ë’8UÜÜ*N;ãI>?’Ee¹¿/q¹6ˆ®©®wS¾ˆ×~õ‰Ä;¾i”?hÄe˜1Oßܤ#˜ŸzÈâ½ý´pðªÜúTÔå†Ãž…=Íix9e¼DÕ.ÚüÓ-õ)^*TuÐv«Ô¹öž]”µ‹­m¾ µÊc ¤[oQçHlò"¥Ï`¤õ®Àø¡oÌvÛ!“ðÆÃ‘–)­÷ÃåúÛgò•Uû¸µž§*Mé†^øŸM4Ñ ÷ëS3)JJWÃÅÐÊË B×Ê¢”“î@?é@aÞ/6û µÛ…ÊJŽØÙRaêk•¸™ÅYÙ´¥ÂˆUÌ…|vSžêþ•aæÜ/âFqq/λÙŒ“÷1Q!îDåu>õÿgÃüJÇü÷¿íPýMøG*$>&Zš ” R£Ø(Ž•)ÿgÃüJÇü÷¿íWê>Ι“n%hºY´‚{`ÿ*€éêUon¼äx—8t²ªÚ•-…¾·Šˆ:O(kæèð« 4–¦ÃfTeó²óiqµhŽd‘°tzö48qªZ ñnÛ)$ýËl¯§}³]c7 Laam<ØZH;"«ç8TnûyUÞìf)µí1‹@ Ù?J•Ű?gqbÏ)-ÅR¹¾ äí´ߔޠ{W uZ22{“VŒfá5Õ–ØV·æHÐLð’Û=×.¹ 3IJ­~'ò«2ï†ËÉßm7Û—4ÕÌ"FO*TÌOSRxø–ÈmÄ„ÂaIB…Vâå-¾ÆÈ_jp‹Û—_9û‹%È'ǼýêŒé!g©V»ýER3LyÒA%-¸¤}ÕuV[Ã)W ˜¸ãj‰o’²|U­å¤+c®‚Rtj½WÙß!K…Æî’²v Žºtøu®UÖ‹s¯†T£b–¸Ö¼»{EœT¤÷-¨‘éP„°âÙ[©I(AGÒ¯˜\ËâFu…ܬ¯%ÂIæqÑßþ òÀl¦o3ñÖ7tíHRÝÿ^J…pœžº³F^F6Li»J1iñÑö(æfIޤ©§ÜIIØÒºUÏ䨿]ŠIqa˜9 V¹›u(‘¯o_jõsìåvqEBãokÙ.8GüÑFx”@QTV?°u×Ý$~ï U9¥(ëÚeƲTÚ¥ñt—óøþÍ” ~á}áUÅ B×àIFIÀ0%à}ݧqÙ6e¯Rb¼¥„+¹J¿¡­Žbâ:–m÷©–9–´tÛN9â {m°ï5ŸtáÔG/"õd˜í¦ä:•²Bþ©¤+pÖ‰dfÃ%ÍIkohšÖ‡$»?ámÖâ Êc©Kc[ä@;Rϰë^mÃÊ‹imÛ¬u¥:ˆç›êéYÖ«×§\“1ßÒIxíGØzaWc6”¥(E8•IÃ0©—˜l4ô–Ô„6—(Ú”È?x©]R?h©«“l°ãÑB^•*gŒH%Â@(F‡¡+Pú@bHã~Æ;&^)»Ô„=!e[u[Ñ(ûBNˆ…ÝOj’q‹Oãv|fãcŒÄ¦¯<Îó>ÚΛHFÂR O1çóôíP;Æpÿqk^`±Í€a¹Ž<‘¦ƒzJˆô\»Rµ¡±¯:Ù*Ág1\f<‚ôR@vê =5@J8…ÄGobÛj·Jfþ–ä#ò´4ÊyR €YßS[\ŸˆW¡—þiá–†.W6ЕI‘!J Æ$ì…ë_ª7ø¿X²5Pä[aݾÑ«T>c·4Ëe•l 26ÉÞôµ„žÞ^}j-“Zl·oëÎl—.W.˜J)?:Šˆê ·£×`zØÅ¸‘p7{å—6‡Ù>ÓËqØÜ奲ÚÀ<Ç_2<öwÛ¸¨Äž,ñM¡Ì–ׇEokª’¢§ Aê¡¥¤ëDu #¿SØGãbmOáÞYxÇqi¶´¼Â#Äñ¤¸·ä´mÅü„kE(‰ßQÖ·V®6¥x½¾É‰ãS¦_ŽÛ^Ù”ò¤$«äW1×’{÷`xñk2“‘p†ËrˆÜ4[î΄¾ÚÔ¢òA'H¤) ŸQ®û«O‡û¥¯´B»ßÓ K PåoC”+›¯>»ô}<¶j><Êš¦0ø÷æ’R§fªÒþ@´£˜‘ÛzÙ5Ð$‰˜”–Üm/6—N”è#×­íJR€R” ¥()JJR€R” ^_pKµë‹V\r`þI¶¶e|ÅÒ±Ìz]w ï}5V()J^R¾#áøO â|5x^.ù9õòók®·­ê½i@Vœ5áÝß¾^oùè“.·ËÏ™@$že©)îuÓZùGZ²éJJR€R” ¥()JJR€R” ¥()JÿÙxbase-2.0.0/html/xbase_a1.html0000644000000000000000000001063007115376612011567 Xbase DBMS Appendix A

    Xbase Return Codes

    Page Updated 2/1/99


    Beginning with release 1.8.0a, error processing can be handled using exception processing, or by checking the functions return codes. If you choose exception processing, you will need to compile in the option to do so when you build the library. To see an example of how to use exception processing, examine program dumprecs.cpp.

    If you are not using exception processing, it is generally a good idea to check the method return codes to verify an error hasn't occured. Most Xbase DBMS methods return a SHORT return code value which corresponds to a value in this table.

    Xbase Return Codes

    NumberErrorDescriptionType
    0XB_NO_ERRORSuccessGeneral
    100XB_XBASE_EOFEnd of fileDatabase
    Index
    102XB_NO_MEMORYError when allocating memoryGeneral
    103XB_FILE_EXISTSFile Already ExistsDatabase
    104XB_OPEN_ERRORError when opening fileDatabase
    105XB_WRITE_ERRORError occured when writing to fileDatabase
    Index
    106XB_UNKNOWN_FIELD_TYPEField was not one of:
    XB_CHAR_FLD
    XB_FLOAT_FLD
    XB_NUMERIC_FLD
    XB_DATE_FLD
    XB_LOGICAL_FLD or XB_MEMO_FLD
    Field
    107XB_ALREADY_OPENCan't open the same file twiceDatabase
    Index
    108XB_NOT_XBASECan't open non X-Base file with
    X-Base routines
    Database
    109XB_INVALID_RECORDNot a valid recordDatabase
    110XB_INVALID_OPTIONNot a valid optionGeneral
    112XB_SEEK_ERRORCould not position in fileDatabase
    Index
    114XB_NOT_FOUNDRecord for key not foundIndex
    116XB_INVALID_KEYInvalid key argument givenIndex
    118XB_KEY_NOT_UNIQUETrying to add a duplicate key for an unique indexIndex
    119XB_INVALID_KEY_EXPRESSIONAn invalid key expression givenIndex
    121XB_INVALID_KEY_TYPEInvalid Key TypeIndex
    122XB_INVALID_NODE_NOInternal index error, notify tech supportIndex
    123XB_NODE_FULLInternal index error, notify tech supportIndex
    124XB_INVALID_FIELDNOAttempt to access invalid field numberField
    125XB_INVALID_DATAInvalid data encounteredField
    126XB_NOT_LEAFNODEInternal index error, notify tech supportIndex
    127XB_LOCK_FAILEDLock function failed
    See errno for detail
    Lock
    128XB_CLOSE_ERRORError closing fileDatabase
    Index
    129XB_INVALID_SCHEMAError with schema definition, check decimal pointsDatabase
    130XB_INVALID_NAMEInvalid database nameMemo
    131XB_INVALID_BLOCK_SIZEBlock size is invalid, must be increment of 512Memo
    132XB_INVALID_BLOCK_NOInvalid block number usedMemo
    133XB_NOT_MEMO_FIELDNot a memo fieldMemo
    134XB_NO_MEMO_DATANo memo dataMemo
    135XB_EXP_SYNTAX_ERRORExpression syntax errorExpression
    136XB_PARSE_ERRORParse error in expressionExpression
    137XB_NO_DATANo data for expressionExpression
    140XB_INVALID_FIELDInvalid field in expressionExpression
    141XB_INSUFFICIENT_PARMSInsufficient paramaters for functionExpression
    142XB_INVALID_FUNCTIONInvalid function encounteredExpression



    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_a2.html0000644000000000000000000002210407115376615011572 Xbase DBMS Appendix B

    Xbase DBMS Quick Reference

    Page Updated 2/1/99


    Xbase Quick Reference Method List

    xbShort rc xbDbf::AppendRecord( void )
    void xbDbf::AutoLockOff( void )
    void xbDbf::AutoLockOn( void )
    xbShort rc xbDbf::BlankRecord( void )
    xbLong cs xbDbf::CalcCheckSum( void )
    xbShort rc xbDbf::CloseDatabase( void )
    xbShort rc xbDbf::CopyDbfStructure( char * NewFileName, xbShort Overlay )
    xbShort rc xbDbf::CreateDatabase( char * FileName, xbSchema * RecordLayout, xbShort Overlay )
    xbULong RecNo xbDbf::CurrentRecNo( void )
    xbShort rc xbDbf::DeleteAllRecords( void )
    xbShort rc xbDbf::DeleteRecord( void )
    xbShort rc xbDbf::DumpHeader( xbShort Option )
    xbShort rc xbDbf::DumpRecord( xbULong RecNo )
    xbShort rc xbDbf::ExclusiveLock( xbShort WaitOption )
    xbShort rc xbDbf::ExclusiveUnlock( void )
    xbLong NoOfFields xbDbf::FieldCount( void )
    xbLong RecNo xbDbf::GetCurRecNo( void )
    xbDouble Val xbDbf::GetDoubleField( char * FieldName)
    xbDouble Val xbDbf::GetDoubleField( xbShort FieldNo )
    xbShort rc xbDbf::GetField( xbShort FieldNo, char * FieldName )
    xbShort DecimalCount xbDbf::GetFieldDecimal( xbShort FieldNo )
    xbShort FieldLen xbDbf::GetFieldLen( xbShort FieldNo )
    char * FieldName xbDbf::GetFieldName( xbShort FieldNo )
    xbShort FieldNo xbDbf::GetFieldNo( char * FieldName )
    char Type xbDbf::GetFieldType( xbShort FieldNo )
    xbShort rc xbDbf::GetFirstRecord( void )
    xbFloat FloatVal xbDbf::GetFloatField( char * FieldName )
    xbFloat FloatVal xbDbf::GetFloatField( xbShort FieldNo )
    xbShort rc xbDbf::GetLastRecord( void )
    xbShort Val xbDbf::GetLogicalField( char * FieldName )
    xbShort Val xbDbf::GetLogicalField( xbShort FieldNo )
    xbLong LongVal xbDbf::GetLongField( char * FieldName )
    xbLong LongVal xbDbf::GetLongField( xbShort FieldNo )
    xbShort rc xbDbf::GetMemoField( xbShort FieldNo, xbLong len, char * Buf )
    xbShort rc xbDbf::GetMemoFieldLen( xbShort FieldNo )
    xbShort rc xbDbf::GetNextRecord( void )
    xbShort rc xbDbf::GetPrevRecord( void )
    xbShort rc xbDbf::GetRecord( xbLong RecNo )
    char * BufPtr xbDbf::GetRecordBuf( void )
    xbShort rc xbDbf::LockDatabase( xbShort WaitOption, xbShort LockType, xbLong RecNo )
    xbShort rc xbDbf::MemoFieldExists( xbShort FieldNo )
    xbShort rc xbDbf::MemoFieldsPresent( void )
    xbLong RecCnt xbDbf::NoOfRecords( void )
    xbShort rc xbDbf::OpenDatabase( char * FileName )
    xbShort rc xbDbf::PackDatabase( xbShort WaitOption )
    xbShort rc xbDbf::PutDoubleField( char * FieldName,xbDouble DoubleValue )
    xbShort rc xbDbf::PutDoubleField( xbShort FieldNo,xbDouble DoubleValue )
    xbShort rc xbDbf::PutField( xbShort FieldNo, char * Buf )
    xbShort rc xbDbf::PutFloatField( char * FieldName, xbFloat FloatValue )
    xbShort rc xbDbf::PutFloatField( xbShort FieldNo, xbFloat FloatValue )
    xbShort rc xbDbf::PutLongField( char * FieldName, xbLong LongValue )
    xbShort rc xbDbf::PutLongField( xbShort FieldNo, xbLong LongValue )
    xbShort rc xbDbf::PutRecord( xbLong RecNo )
    xbShort rc xbDbf::RebuildAllIndices( void )
    xbShort rc xbDbf::RecordDeleted( void )
    xbShort rc xbDbf::SetVersion( xbShort Version )
    xbShort rc xbDbf::UndeleteAllRecords( void )
    xbShort rc xbDbf::UndeleteRecord( void )
    xbShort rc xbDbf::UpdateMemoData( xbShort FieldNo, xbLong len, char * Buf, xbShort LockOption )
    xbShort rc xbDbf::ValidLogicalData( xbShort FieldNo )
    xbShort rc xbDbf::ValidNumericData( xbShort FieldNo )
    char * Day xbXBase::CharDayOf( char * Date8 )
    char * Month xbXBase::CharMonthOf( char * Date8 )
    xbShort rc xbXBase::DateIsValid( char * Date8 )
    xbShort Day xbXBase::DayOf( xbShort Format, char * Date8 )
    char * Date xbXBase::FormatDate( char * Format, char * Date8 )
    char * Result xbXBase::GetCharResult( void )
    xbDouble * Result xbXBase::GetDoubleResult( void )
    XB_EXPRESSION * Exp xbXBase::GetExpressionHandle( void )
    char Type xbXBase::GetExpressionResultType( XB_EXPRESSION * )
    xbLong * result xbXBase::GetIntResult( void )
    xbShort rc xbXBase::IsLeapYear( char * Date8 )
    xbLong JulVal xbXBase::JulianDays( char * Date8 )
    char * Date8 xbXBase::JulToDate8( xbLong JulVal )
    xbLong JulVal xbXBase::LastDayOfMonth( char * Date8 )
    xbShort Month xbXBase::MonthOf( char * Date8 )
    xbShort rc xbXBase::ParseExpression( char * exp, xbDbf * d )
    xbShort rc xbXBase::ProcessExpression( XB_EXPRESSION * )
    char * Date8 xbXBase::Sysdate( void )
    xbShort Year xbXBase::YearOf( char * Date8 )
    xbShort rc xbNdx::CheckNdxIntegrity( xbShort Option )
    xbShort rc xbNdx::CloseIndex( void )
    xbShort rc xbNdx::CreateIndex( char * IndexName, char * KeyExpression, xbShort Unique, xbShort Overlay )
    xbShort rc xbNdx::FindKey( char * SearchValue )
    xbShort rc xbNdx::FindKey( xbDouble SearchValue )
    xbShort rc xbNdx::GetFirstKey( void )
    xbShort rc xbNdx::GetLastKey( void )
    xbShort rc xbNdx::GetNextKey( void )
    xbShort rc xbNdx::GetPrevKey( void )
    xbShort rc xbNdx::KeyExists( char * SearchValue )
    xbShort rc xbNdx::KeyExists( xbDouble SearchValue )
    xbShort rc xbNdx::LockIndex( xbShort WaitOption, xbShort LockType )
    xbShort rc xbNdx::OpenIndex( char * IndexName )
    xbShort rc xbNdx::ReIndex( void )
    void xbHtml::BoldOn( void )
    void xbHtml::BoldOff( void )
    void xbHtml::Bullet( void )
    void xbHtml::DumpArray( void )
    void xbHtml::EmphasizeOn( void )
    void xbHtml::EmphasizeOff( void )
    void xbHtml::EndHtmlPage( void )
    xbShort rc xbHtml::GenFormFields( Dbf *d, xbShort Option, char * Title, xbFieldList *fl )
    xbShort ArrayOffset xbHtml::GetArrayNo( char * FieldName )
    char * FieldValue xbHtml::GetData( xbShort ArrayOffset )
    char * FieldValue xbHtml::GetDataForField( char * FieldName )
    char * EnvValue xbHtml::GetEnv( char * EnvString )
    char * CookieString GetCookie( char * CookieName )
    xbShort rc xbHtml::GetMethod( void )
    void xbHtml::HeaderOn( xbShort HeaderLevel )
    void xbHtml::HeaderOff( xbShort HeaderLevel )
    void xbHtml::ItalicOn( void )
    void xbHtml::ItalicOff( void )
    void xbHtml::Newline( void )
    void xbHtml::PrintEncodedChar( char char )
    void xbHtml::PrintEncodedString( char * string )
    xbShort rc xbHtml::PostMethod( void )
    void xbHtml::PrintHtml( char * PrintData )
    void xbHtml::PrintHtml( xbLong PrintData )
    void xbHtml::PrintHtml( xbShort PrintData )
    void xbHtml::StartHtmlPage( void )
    void xbHtml::StartTextPage( void )
    void xbHtml::SetCookie( char *Name, char *Value, char *ExpDate, char *ExpTime, char *TimeZone, char *Path, char *Domain, xbShort Secure );
    xbLong TallyCnt xbHtml::Tally( char * FileName )



    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_apps.html0000644000000000000000000001272407115376616012243 Xbase DBMS Sample Application

    Sample Programs

    Page Updated 2/1/99


    Sample Xbase DBMS programs are located in the xbase/samples and xbase/bin directories.

    X-Base Sample Programs

    ProgramProgram Description
    checkndxThis program checks an NDX file
    copydbfThis program copies a DBF file structure
    deletallThis program marks all records in a DBF file for deletion
    dumphdrThis program opens an Xbase file and prints its header
    dumprecsThis program dumps records for an X-Base file
    packdbfThis program packs a database file
    reindexThis program rebuilds an index
    sample1This program creates an Xbase file MYFILE.DBF
    sample2This program populates file MYFILE.DBF created by program sample1
    sample3This program lists MYFILE.DBF data populated by program sample2
    sample4This program deletes records, undeletes records, locks and packs datafile MYFILE.DBF
    sample5This program demonstrates NDX class usage
    testdateThis program tests the Xbase date methods
    testhtmlThis program tests the Xbase HTML methods
    testhtml.htmlThis form works with the testhtml program
    undelallThis program undeletes all deleted records in a dbf file
    zapThis program removes all records from a DBF file
    MakefileMakefile for building sample programs



    Sample Application

    A sample application has been developed to demonstrate the basic functions of the Xbase library. The application is a basic utility for querying zipcodes and determining a zip code for a given city, or a city for a given zip code. Although a simple application, it demonstrates the following basic Xbase functions:

  • A) How to create databases and indices
  • B) How to populate the databases with data
  • C) How to query the databases and extract information
  • D) How to generate HTML code for displaying the data in a web browser


    The following data flow diagram shows the basic design of this application, what the programs are and do, and how the databases are accessed.




    Xbase Zipcode Sample Programs

    ProgramProgram Description
    creatzipThis program creates the zipcode files
    loadzipsThis program loads the zipcode files
    dumpzipsThis program dumps zipcodes by city
    zipinitThis program updates the stats and requests
    query information via HTML (fow web browser)
    zipinqThis program queries the zip database and
    generates a list of results via HTML (for web browser)
    MakefileMakefile for building sample programs



    Xbase Zipcode Sample Databases and Indexes

    FileDescription
    ZIPCODES.DBFDatabase of zipcodes, city and states
    CITY.NDXIndex of zipcode file by city
    ZIPCODE.NDXIndex of zipcode file by zipcode
    ZIPSTATS.DBFMaintains number of visitors and inquiries


    Testdrive the zipcode application

    Download the zipcode application

    To use the zipcode application, perform the following steps after you download it.

  • cd /usr/xbase
  • mkdir zipcodes
  • cp /home/of/zipcodes.tar.gz /usr/xbase/zipcodes
  • unzip zipcodes.tar.gz
  • tar -xvf zipcodes.tar
  • Enjoy!!
    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_bib.html0000644000000000000000000000347407115376620012031 Xbase DBMS Bibliography

    Xbase DBMS Bibliography

    Page Updated 2/1/99


    Bachman, Erik
    Xbase File Format Description / Erik Bachman, Roskilde, Denmark: Clickety Click Software, 1996-1998, 44 pages

    Loomis, Mary:
    The Database Book, Macmillan Publishing Company, 1987, New York, New York: ISBN 0-02-371760-2

    Dorfman, Len:
    Building C Libraries, Windcrest, 1990, Blue Ridge Summit, PA: ISBN 0-8306-3418-5

    Eckel, Bruce:
    Using C++, Osborne, McGraw-Hill, 1990, Berkeley, CA: ISBN 0-07-881522-3

    Aho, Alfred: Hopcroft, John: Ullman, Jeffrey:
    Data Structures and Algorithms, Addison-Wesley Publishing, 1983, Reading Massachusetts: ISBN 0-201-00023-7

    Stevens, Al:
    C Database Development, MIS Press, 1991, Portland Oregon: ISBN 1-55828-136-3

    Pressman, Roger:
    Software Engineering: A Practitioner's Approach, McGraw-Hill, 1982, New York ISBN 0-07-050781-3

    Chou, George Tsu-der:
    2nd Edition dBase III Plus Handbook: Que Corporation, 1986, Indianapolis, Indiana ISBN 0-88022-269-7

    Krumm, Rob:
    Understanding and Using dBase II & III, Brady Communications Company, Inc, 1985, Bowie MD ISBN 0-89303-917-9

    Hursch, Jack: Hursch, Carulyn:
    dBase IV Essentials, Windcrest, 1988, Blue Ridge Summit, PA ISBN 0-8306-9616-4

    Borland:
    Turbo C++, Programmer's Guide, Borland International, 1990, Scotts Valley CA

    Borland:
    Turbo C++, Library Reference, Borland International 1990, Scotts Valley CA

    The Draft Standard C++ Library by P.J. Plauger, Prentice Hall, New Jersey, 1995.

    H.M Dietel/P.J. Deitel: C++ How To Program, Prentice Hall, Englewod Cliffs, New Jersey 07632

    xbase-2.0.0/html/xbase_c1.html0000644000000000000000000004155307115376625011605 Xbase DBMS Chapter 1

    Getting Started

    Chapter Updated 1/29/99


    Overview

    The term Xbase is often used used to describe the format of the original DBase (.DBF) files. Many vendors support the industry standard Xbase file format and are committed to this technology for many years to come, thus insuring continued support.

    Xbase DBMS is a set of documentation and C++ routines for accessing Xbase style databases and indicis from C/C++ programs on a variety of computing platforms.

    The main purpose of the routines is to provide reliable and economical programming tools to programmers for reading, writing and updating DBF databases, indices and memo fields.



    System Requirements

    To use Xbase DBMS, the following items are needed:

    A computer and C/C++ compiler.

    The original source code is developed on a Linux platform with the GCC public domain C/C++ compiler. Documenation for GCC products and tools can be found at www.isys.net/susehilf/index_e.html

    The examples and steps here describe how to load this library in a Linux/Unix or Dos/Windows environment. If you would like to contribute specific steps for loading the Xbase DBMS in your environment, please send them to me and I will include them in the next release.

    Xbase DBMS has been successfully ported and runs on Linux, Sun Solaris, OpenVMS, FreeBSD, OS2 and DOS/Windows (Using the large memory model).

    Makefiles for Various Platforms


    Classes and User Interface

    There are six classes in the Xbase library which are available for use in a typical Xbase application program.




    Xbase Classes - Version 1.8.0 and newer

    ClassBasic DescriptionHow UsedOld Class
    Name
    xbXBaseBasic Xbase ClassEvery program gets one of theseXBASE
    xbDbfDatabase and Field classNeed one of these for each open DBF fileDBF
    xbNdxNdx index classNeed one of these for each open NDX indexNDX
    xbNtxNtx index classNeed one of these for each open NTX index
    xbStringString classUsed for handling strings
    xbHtmlHtml generation classNeeded for creating HTML codeHTML


    There are other classes used internally by these Xbase classes, but most application programs will not need to be concerned with them. These classes are xbStack - used for stack data structures, xbExpn - used for expression logic, and xbDate - used for date manipulation logic.

    If you are upgrading from an earlier version of Xbase, there is a conversion utility in the xbase/bin. See shell script xbase_rename.sh and xbase_rename.txt for details (courtesy of Vitaly Fedrushkov).



    Portability, Type Defs and Structures

    To effectively make the Xbase library as portable across platforms as possible, three things occured.

  • First, the software was developed to run and compile on either big endian or little endian computers and store all numeric data in little endian format.

  • Secondly, field types must be consistently defined in each environment. The types.h file defines the xbase data types. To modify the Xbase code base to function in a different (non ported to yet) environment, start by modifying the types.h file for your site and recompile.

  • Thirdly, support for unix automake and autoconf has been added to provide support on a wide variety of unices.

    Field Types

    TypeDescriptionOld Type
    xbULongunsigned long intULONG
    xbUShortunsigned short intUSHORT
    xbShortshort int
    xbLonglongLONG
    xbFloatfloathFLOAT
    xbDoubledoubleDOUBLE
    charcharCHAR
    voidvoidVOID
    struct SCHEMAUsed for defining record structures


    Xbase was designed for portability utilizing standard ANSI-C compliant code. If you decide to write updates to the Xbase project, please try to keep your work to standard generic ANSI-C (no special DOS/WINDOWS Calls). If you find find non compliant code, please let the Xbase team know by sending an email to xbase@startech.keller.tx.us.


    Compilation Overview

    The following sections document building the Xbase library. If none of the methods documented work for you, or are not what you need, then you will need to build some type of makefile or batch file to compile the source code and build a static or dynamic library for your OS environment.

    The source members you will need to compile into your library include:

    dbf.cpp, exp.cpp. expfunc.cpp. expproc.cpp, fields.cpp, html.cpp, lock.cpp, memo.cpp, ndx.cpp, stack.cpp, xbase.cpp, xdate.cpp and xbexcept.cpp.

    Before compiling the library, you may need to modify the options.h file for your environment.

    After you have it working, please consider contributing your make files to the xbase project.

    Installing the Xbase source code (for Unix environments)

    Instructions for 1.8.0a installation

    Dowload the file
    cp /home/of/xbase-1.8.0a.tar.gz /usr/local
    cd /usr/local
    gunzip xbase-1.8.0a.tar.gz
    tar -xvf xbase-1.8.0a.tar
    ln -s xbase-1.7.4c xbase


    Building the Xbase Library (for Unix environments)

    Beginning with version 1.7.4c, there is an automake procedure which is designed to provide automatic makefile generation for a variety of Unix environments (courtesy of Denis Pershin).

    Execute the following commands to create the makefile for your environment.

  • cd /usr/local/xbase
  • make -f Makefile.cvs
  • ./configure - this step builds a makefile for your specific Unix environment optionally you could do ./configure --help to see the library build options ie; ./configure --enable-debug --disable-shared --enable-static - builds a static debug lib)
  • make - this step builds the actual xbase library
  • make install - this step copies the library and the header files into local bin and include directories

    Watch for any error messages. If you get errors and they scroll off the screen, rerun the command and append "| more" (make | more or make install | more) to the end of the command to stop the display. The most common errors are related to directory access rights. Read any instructions for your environment produced by this script and follow the printed directions.

    In the Linux development environment, the script generates the following messages.

    To link against installed libraries in a given directory, LIBDIR, you must use the '-LLIBDIR' flag during linking.

    You will also need to do one of the following
    - add LIBDIR to the 'LD_LIBRARY_PATH environment variable during execution
    - add LIBDIR to the 'LD_RUN_PATH' environment during linking
    - use the -Wl, --rpath -Wl,LIBDIR linker flags
    - have your system administrator add LIBDIR to 'etc/ld.so.conf'

    On the Startech server, I had to:
  • Verify the library and associated links were copied from xbase/xbase/.libs into /usr/local/lib
  • Add /usr/local/lib is in /etc/ld.so.conf
  • execute program ldconfig to refresh the new libs

    Actual milage at your site may vary.



    Building a program with the Xbase library

    Create a directory for your project:

    cd /home/me
    mkdir MyProject
    cd MyProject
    vi MyProg.cpp

    To use the Xbase classes, include the following header file in the program:

    #include <xbase/xbase.h>

    If you are using the html interface, you will also need
    #include <xbase/html.h>
    in your program. For more details, check out the sample programs in the xbase/examples directory.

    Compiling and Linking Unix Application Program for v1.7.4c and later

    The install script should have provided specific instructions for your environment on how to link with the xbase library.

    In the Linux environment, assuming that you are using shared libraries, and usr/local/lib has been added to the /etc/ld.so.conf file, and the ldconfig command was executed

    To Compile:
    g++ -c -Wall -I/usr/include -I/usr/src/linux/include-asm-i386 -I/usr/local/include -I/usr/local/xbase myprog.cpp

    To Link Edit:
    g++ -o myprog myprog.o libxbase.so

    Compiling an Application Program with Borland v4.5 C/C++compiler

    With Borland C compiler: bcc -Ic:\xbase\src myprog.cpp -Lc:\xbase\src\xbase.lib


    Getting the latest development version of XBase


    The Xbase project is in an ongoing state of development with new enhancements being added regularly and bug fixes being applied as they are found. There are several programmers from various parts of the world working on Xbase. If you would like to get the latest version of the Xbase library for your project, then follow these steps.

    You will need:

  • 1 - A computer running Unix or Linux connected to the internet via TCP/IP
  • 2 - CVS loaded and operational. CVS is a tool which maintains a repository of source code and supports the building of the Xbase library allowing simultaneous access and development by several programmers.
  • 3 - automake
  • 4 - autoconf

    Follow these steps:

  • 1 - connect to the Startech CVS server with the following command:
  • cvs -d :pserver:cvsguest@stargazer.startech.keller.tx.us:/usr/local/cvsroot login
  • 2 - The next prompt should be asking you for a password. Enter download
  • 3 - change directory to the location you want to load the Xbase library
    ie; cd /home/mydirectory
  • 4 - Download the archive
    cvs -d :pserver:cvsguest@stargazer.startech.keller.tx.us:/usr/local/cvsroot checkout xbase
  • 5 - make -f Makefile.cvs
  • 6 - Configure for your environment.
    ./configure - this will set up a basic build of a dynamic link library and put the resultant libraries in the xbase/xbase/.libs directory
    ./configure --enable-debug --disable-shared --enable-static This will build a static library with debug mode turned on.
    ./configure --help This will display all the configure options.
  • 7 - Build the core library, examples and utility programs enter
    make
  • 8 - If you accepted the defaults, after the build is complete, you will end up with a set of dynamic link library files in the xbase/xbase/.libs directory.
  • 9 - Install the library and header files into the system libraries - make install
    This will typically copy the dynamic libraries into /usr/local/lib and copy the header files (.h files) into /usr/local/include
  • 10 - If you have got this far, the library is now operational. you can go into the examples directory, or the bin directory and execute some of the programs to verify all is working OK. For example, cd examples, then type sample1, this program should build a DBF,DBT and several NDX files.

    Notes about using the current development library

  • 1 - Library functions may or may not be documented
  • 2 - The library may or may not be stable. This is the development library and is being updated with current code changes. If you are using it, and it does not behave the way you think it should, you may want to drop a note to xbase@startech.keller.tx.us. This may sound a little unsettling, but the library is generally stable. It goes through periods of time where it is in a state of flux when major changes are occurring, but for the most part it is probably OK to use.
  • 3 - If you have changes to contribute to the library, mail your updates to xbase@startech.keller.tx.us
    .

    System Limitations


    Maximum size of a database file is the size of LONG - 2,147,483,647 bytes
    Total number of fields in a database - 1024
    Total number of characters in all fields - 32767
    Maximum number of characters in a field - 254
    Total number of records in a file - 1 billion
    Maximum index key length - 100 bytes
    Maximum .DBT file memo block size - 32256
    Maximum expression result length - 100 bytes
    Maximum NDX index key length - 100 bytes



    Directory Structures

    The following is a proposed directory structure for loading the Xbase libraries at your site.

    Proposed Xbase Directory Structure for Unix
    Versions 1.7.4c and later

    DirectoryDescription
    /usr/local/xbaseXbase source code
    /usr/local/xbase/samplesX-Base samples
    /home/me/MyProject1Your first project
    /home/me/MyProject2Your second project


    Proposed Xbase Directory Structure for Dos/Windows/NT

    DirectoryDescription
    c:\xbaseBase Directory for Xbase
    c:\xbase\srcXbase source code
    c:\xbase\samplesX-Base samples
    c:\xbase\binXbase utility programs
    c:\xbase\MyProject1Your first project
    c:\xbase\MyProject2Your second project



    Compile Options

    The options.h header file contains compile options which impact how the Xbase library is built.

    Xbase Options - Non Unix Automake environment

    OPTIONDESCRIPTION
    XBASE_DEBUGXBASE_DEBUG can be used during application development. To generate smaller and faster production executable programs, comment this define out before building the Xbase library. This option generates debugging logic.
    XB_HTMLTurns on the option for the HTML generation class.
    XB_INDEX_NDXThis define compiles in support for NDX indexes. Comment this line out to drop support for NDX indexes. This define automatically enables expression processing.
    XB_LOCKING_ONNeeded for multi user configuration. It is safe to remove this option for single user environments. DOS/Windows support is at alpha level and needs a volunteer to test it.
    XB_MEMO_FIELDSThis define compiles in support for memo (variable length) fields.
    XB_DBT_BLOCK_SIZEThis defines the default block size to use when creating memo .DBT files. It must be an increment of 512 bytes. The maximum block size is 32256.
    XB_EXPRESSIONSUsed for expression logic, required for index keys.
    XB_CASTELLANODate routines return Spanish names for days,weeks and months




    Xbase Options - Unix Automake environment

    OPTIONDESCRIPTION
    --without-xbase-debugTurns off xbase debugging code
    --without-index-ndxTurns off NDX index options
    --without-memo-fieldsTurns off memo fields
    --without-expressionsTurns off expression processing
    --without-ui-htmlTurns off HTML user interface class
    --without-xbase-lockingTurns off xbase locking
    --without-xbase-debugTurns off debug logic
    --without-exceptionsTurns on exception processing
    --with-castellanoTurn on castellano date options


    Use these options on the command line when executing the ./configure command. Also, you can execute ./configure --help for a complete list of all unix configure options.

    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c10.html0000644000000000000000000000273407115376625011663 Xbase DBMS Chapter 10

    Turbo Vision Interface

    Page Updated 1/30/99


    Begining with release 1.8.0a, an interface to Turbo Vision has been provided by Vitaly Fedrushkov - email willy@snowyowl.csu.ac.ru.

    Turbo Vision is a powerful class library that provides best of breed text mode interface with SAA/CUA flavor. Turbo Vision is copyrighted by (former) Borland Intl.

    This code corresponds to Turbo Vision version 2 for DOS, which can be found at

    ftp.borland.com/pub/borlandcpp/devsupport/archive/turbovision/tv.zip

    However, it works great with TurboVision for Unix (0.6 -- or any other at your option). This port is (c) Sergio Sigala and can be found at

    ftp.vix.com/guests/ssigala/pub/tvision

    Comments and complaints are welcome.

    To do:

    o Index support. RecNo-based addressing is hammered into TListViewer. May require great rewrite.
    o Horizontal scrolling.
    o Locked (non-scrollable) columns.
    o Nontrivial memo field handling.
    o In-place editing.
    o Documentation

    Wanted:

    o More testing (DOS/Windows or BSD)
    o Better idea for demo app (maybe bin/dbfutil.cpp ?)


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c11.html0000644000000000000000000000257107115376627011665 Xbase DBMS Chapter 11

    Library Options and Methods

    Chapter Updated 2/1/99



    xbXbase Class Methods

    MethodDescription
    void xbXBase::DisplayError(xbShort ErrorNumber)Display error text
    char * xbXbase::GetDefaultDateFormat()Return the default date format
    void xbXBase::SetDefaultDateFormat(char * Format)Set the default date format



    Method Definitions


    Method void xbXbase::DisplayError( xbShort ErrorNo )


    This method prints a text description of an error code.

    Example Code Snipit:

    xbShort rc; rc = d.SomeXbaseFunction(...); if( rc < 0 ) x.DisplayError( rc ); else DoSomethingUsefull();

    Method char * xbXBase::GetDefaultDateFormat( void )
    Method void xbXBase::SetDefaultDateFormat( char * NewDateFormat )


    These methods are used for retrieving and setting the default date format which is used by expression function DTOC.


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c12.html0000644000000000000000000006061507115376645011671 Xbase DBMS Chapter 12

    Database Methods

    Chapter Updated 1/30/99



    This chapter lists the database methods and provides links to examples of how to use them.


    Xbase Database Method List

    MethodDescription
    xbShort rc AppendRecord()Append a new record to the end of an open database
    void AutoLockOn()Turns on automatic record locking (see locking chapter)
    void AutoLockOff()Turns off automatic record locking (see locking chapter)
    void BlankRecord()Fill the current record buffer with blanks
    xbLong csum CalcCheckSum()Calculate checksum on a data record
    xbShort rc CloseDatabase()Close an open database
    xbShort rc CopyDbfStructure(
    char * NewFileName,
    xbShort OverlaySwitch )
    Copies the structure of a xbDbf file to a new file
    xbShort rc CreateDatabase(
    char * FileName, XbSchema *s, xbShort OverlaySwitch )
    Close an open database
    xbULong CurrentRecNo()Returns the current record number
    xbShort rc DeleteAllRecords()Mark all records for deletion
    xbShort rc DeleteRecord()Mark a record for deletion
    xbShort rc DumpHeader(xbShort option)Display information about a .DBF file header
    xbShort rc DumpRecord(
    xbULong RecNo)
    Dump a record for a database
    xbLong cnt FieldCount()Returns number of fields in database
    xbLong recno GetCurRecNo()Returns current record number
    xbShort rc GetFirstRecord()Get the first record in the database
    xbShort rc GetLastRecord()Get the last record in the database
    xbShort rc GetNextRecord()Get the next record in the database
    xbShort rc GetPrevRecord()Get the previous record in the database
    xbShort rc GetRecord(xbLong RecNo)Get a record by record number from an open database
    char * buf GetRecordBuf()Returns a pointer to the record buffer
    xbLong RecCnt NoOfRecords()Returns the number of records in an open database
    xbShort rc OpenDatabase(char * FileName)Open an existing database
    xbShort rc PackDatabase(
    xbShort WaitOption)
    Compress file and remove deleted records
    xbShort rc PutRecord(xbULong RecNo)Put a record in an open database
    xbShort rc RebuildAllIndices()Rebuilds all open indices
    xbShort dflag RecordDeleted()Determine if a record has been deleted
    xbShort version SetVersion(xbShort Ver)Set version to xbase III+ or IV style xbDbf files
    xbShort rc UndeleteAllRecords()Unmark all deleted records
    xbShort rc UndeleteRecord()Unmark a deleted record
    xbShort rc Zap(xbShort WaitOption)Deletes all records from a database



    Method Definitions


    Method xbShort xbDbf::AppendRecord( void )


    This method appends the contents of the database record buffer to the end of the .DBF file and updates the date and number of records in the header of the datafile.

    This method also updates any open indexes associated with the database.


    Method Return Codes

    Return CodeDescription
    XB_LOCK_FAILEDWrite lock not successful
    XB_NO_ERRORIf there is no error
    XB_WRITE_ERRORUnsuccessful write operation

    Example Program:

    See program sample2.cpp for an example of how to use this method.

    Method xbShort xbDbf::BlankRecord( void )


    This method overlays the database record buffer with space (0x20) CHARacters. This method is useful for initializing the record buffer.

    Example Program:

    See program sample2.cpp for an example of how to use this method.

    Method xbLong xbDbf::CalcCheckSum( void )


    This method calculates the checksum of a database record.

    Method xbShort xbDbf::CloseDatabase( void )


    This method closes an Xbase (.DBF) file which was previously opened by CreateDatabase or OpenDatabase and frees any previously allocated memory which is no LONGer needed.

    This method automatically closes any open indexes associated with the database before closing the database.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_NOT_OPENIf there is no error

    Example Program:

    See program sample2.cpp for an example of how to use this method.

    Method xbShort xbDbf::CopyDbfStructure( char *NewFileName, xbShort OverLay )


    This method copies the structure of an Xbase (.DBF) file to file NewFileName. If there are memo fields, they are included.

    The OverLay switch is used to determine what to do if a xbDbf file with the same name already exists. If OverLay is set to XB_OVERLAY and the file exists, the file is overwritten, otherwise an error is returned.

    Overlay Switch is:
  • XB_OVERLAY = Overlay file if it exists
  • XB_DONTOVERLAY = Return with error if file exists


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_FILE_EXISTSIf a file exists and OverLay switch = FALSE
    XB_OPEN_ERRORCouldn't open the file
    XB_NO_MEMORYMemory allocation error
    XB_WRITE_ERRORCouldn't write to disk
    XB_SEEK_ERRORSeek routine error

    Example Program:

    See program copydbf.cpp for an example of how to use this method.

    Method: xbShort xbDbf::CreateDatabase( char *FileName, xbSchema *s, xbShort OverLay )


    This method creates an Xbase (.DBF) file with the name of FileName and builds the header record with the format as defined in the xbSchema parameter. The OverLay switch is used to determine what to do if a xbDbf file with the same name already exists. If OverLay is set to XB_OVERLAY and the file exists, the file is overwritten, otherwise an error is returned.

    Overlay Switch is:
  • XB_OVERLAY = Overlay file if it exists
  • XB_DONTOVERLAY = Return with error if file exists

    xbSchema has the following format:
    xbSchema MyRecordSchema[] = { { FieldName, Type, FieldLength, NoOfDecimals }, { FieldName2, Type, FieldLength, NoOfDecimals }, ... { "",0,0,0 } }; Where:
  • FieldName is the name of the data field.
  • Type

    Version 1.7.4 and greater:

    XB_CHAR_FLD or C
    XB_DATE_FLD or D
    XB_LOGICAL_FLD or L
    XB_MEMO_FLD or M
    XB_FLOAT_FLD or F
    XB_NUMERIC_FLD or N

  • FieldLength is the length of the field.
  • NoOfDecimals is the number of decimals for NUMERIC fields.

    The record buffer is automatically set to spaces when this method is called.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_FILE_EXISTSIf a file exists and OverLay switch = FALSE
    XB_OPEN_ERRORCouldn't open the file
    XB_NO_MEMORYMemory allocation error
    XB_WRITE_ERRORCouldn't write to disk

    Example Program:

    See program sample1.cpp for an example of how to use this method.

    Method xbULong xbDbf::CurrentRecNo( void )


    This method returns the current record number.

    Example Program:

    See program dumprecs.cpp for an example of how to use this method.

    Method xbShort xbDbf::DeleteAllRecords( void )


    This method marks all unmarked records in the database for deletion.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORNo error encountered
    XB_INVALID_RECORDCould not mark record
    XB_NOT_OPENIf the file is not open
    XB_SEEK_ERRORSeek routine error
    XB_WRITE_ERRORWrite routine error

    Example Program:

    See program deletall.cpp for an example of how to use this method.

    Method xbShort xbDbf::DeleteRecord( void )


    This method marks the current record for deletion in the database.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORNo error encountered
    XB_INVALID_RECORDCould not mark record

    Example Program:

    See program sample4.cpp for an example of how to use this method.

    Method xbShort xbDbf::DumpHeader( xbShort Option )


    This method displays information about a .DBF file header to stdout. This method is only available if the DEBUG option is turned on in the options.h file


    Method Options

    OptionAction
    1Print Header Only
    2Field Data Only
    3Header and Field Data


    Method Return Codes

    Return CodeDescription
    XB_INVALID_OPTIONOption must be 1,2 or 3
    XB_NOT_OPENFile is not open
    XB_NO_ERRORNo error encountered

    Example Program:

    See program dumphdr.cpp for an example of how to use this method.

    Method xbShort xbDbf::DumpRecord( xbULong RecNo )


    This method dumps record RecNo for the database to stdout.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORNo error encountered
    XB_INVALID_RECORDInvalid record for RecNo parameter

    Example Program:

    See program dumprecs.cpp for an example of how to use this method.

    Method xbLong xbDbf::FieldCount( void )


    This method returns the number of fields defined in the database.


    Method xbLong xbDbf::GetCurRecNo( void )


    This method returns the current record number of the record in the record buffer.

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetFirstRecord( void )


    This method loads the first record of the file into the record buffer.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_INVALID_RECORDInvalid record number
    XB_LOCK_FAILEDUnsuccessful lock operation
    XB_NOT_OPENIf the file is not open
    XB_SEEK_ERRORSeek routine error
    XB_WRITE_ERRORWrite routine error

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetLastRecord( void )


    This method loads the last record of the file into the record buffer.


    Method Return Codes

    Return CodeDescription
    XB_LOCK_FAILEDRead lock not successful
    XB_NO_ERRORIf there is no error
    XB_EOFAt end of file
    XB_NOT_OPENIf the file is not open
    XB_INVALID_RECORDInvalid record number
    XB_SEEK_ERRORSeek routine error
    XB_WRITE_ERRORWrite routine error

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetNextRecord( void )


    This method loads the next record of the file into the record buffer.


    Method Return Codes

    Return CodeDescription
    XB_LOCK_FAILEDRead lock not successful
    XB_NO_ERRORIf there is no error
    XB_EOFAt end of file
    XB_NOT_OPENIf the file is not open
    XB_INVALID_RECORDInvalid record number
    XB_SEEK_ERRORSeek routine error
    XB_WRITE_ERRORWrite routine error

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetPrevRecord( void )


    This method loads the previous record of the file into the record buffer.


    Method Return Codes

    Return CodeDescription
    XB_LOCK_FAILEDRead lock not successful
    XB_NO_ERRORIf there is no error
    XB_BOFAt beginning of file
    XB_NOT_OPENIf the file is not open
    XB_INVALID_RECORDInvalid record number
    XB_SEEK_ERRORSeek routine error
    XB_WRITE_ERRORWrite routine error

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetRecord( xbLong RecNo )


    This method retrieves record RecNo from the database into the record buffer.

    This method will call the PutRec method and flush all updates to disk if necessary before moving to the specified record. If PutRecord is not successful, this method will return the return code from PutRecord.


    Method Return Codes

    Return CodeDescription
    XB_LOCK_FAILEDRead lock not successful
    XB_NO_ERRORIf there is no error
    XB_NOT_OPENIf the file is not open
    XB_INVALID_RECORDInvalid record number
    XB_SEEK_ERRORSeek routine error
    XB_WRITE_ERRORWrite routine error

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method char * xbDbf::GetRecordBuf( void )


    This method returns a pointer to the record buffer.

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method xbLong xbDbf::NoOfRecords( void )


    This method returns the number of records in the file.

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::OpenDatabase( char * FileName )


    This method opens an Xbase (.DBF) file with the name of FileName. FileName must a valid filename which can include drives identifier, directory, filename and extension.

    The OpenDatabase method does not position to any any particular data record. After opening a database, use GetRecord, GetFirstRecord or GetLastRecord to position to a particular data record and load a data record into the record buffer.

    The record buffer is automatically set to spaces when this method is called.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_OPEN_ERRORCouldn't open the file
    XB_NO_MEMORYMemory allocation error
    XB_NOT_XBASENot an xbXBase type file

    Example Program:

    See program sample2.cpp for an example of how to use this method.

    Method xbShort xbDbf::PackDatabase( xbShort WaitOption )


    This method removes all records marked for deletion from an Xbase (.DBF) file and reindexes any open index files. This method also reorganizes any memo fields stored in a .DBT memo file.

    WaitOption is one of:

  • F_SETLK - returns if the xbDbf file can not be exclusively locked
  • F_SETLKW - will wait to execute until it can exclusively lock the file


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_CLOSE_ERRORIf intermediate work file can not be closed
    XB_OPEN_ERRORCould not open file
    XB_NO_MEMORYMemory allocation error
    XB_WRITE_ERRORError writing to file
    XB_SEEK_ERRORSeek error encountered
    XB_LOCK_FAILEDCan not lock file or index

    Example Program:

    See program packdbf.cpp for an example of how to use this method.

    Method xbShort xbDbf::PutRecord( xbLong RecNo )


    This method copies the record buffer into record RecNo in the database. This method can be used for updating records which were retrieved by the GetRecord method.

    This method updates any open index files.


    Method Return Codes

    Return CodeDescription
    XB_LOCK_FAILEDWrite lock not successful
    XB_NO_ERRORIf there is no error
    XB_NOT_OPENDatabase is not open
    XB_INVALID_RECORDInvalid record number
    XB_SEEK_ERRORSeek operation failed
    XB_WRITE_ERRORWrite operation failed

    Example Program:

    See program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::RebuildAllIndicis( void )


    This method rebuilds all opened indicis for the database file.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_WRITE_ERRORError writing data
    XB_CLOSE_ERRORError closing work file

    Example Program:

    See program reindex.cpp for an example of how to use this method.

    Method xbShort xbDbf::RecordDeleted( void )


    This method returns TRUE (or 1) if a record is marked for deletion and returns FALSE (or 0) if the record is not marked for deletion.


    Method Return Codes

    Return CodeDescription
    TRUE (1)Record is marked for deletion
    FALSE (0)Record is not marked for deletion

    Example Program:

    See program sample4.cpp for an example of how to use this method.

    Method xbShort xbDbf::SetVersion( xbShort Vswitch )


    This method sets the version of xbDbf and DBT database files and memo files to be created using the CreateDatabase method. The default setting is 3 - dBASE III+ version files. It can be set to 4 - for dBASE IV style files.

    Vswitch is one of:
    0 - return current setting
    3 - Set to create version III files (default)
    4 - Set to create version IV files


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORSetting updated
    3 or 4If Vswitch = 0, it returns current version setting
    XB_INVALID_OPTIONVswictch not one of 0,3 or 4

    Example Program:

    See program sample1.cpp for an example of how to use this method.

    Method xbShort xbDbf::UndeleteAllRecords( void )


    This method unmarks all marked for deletion records in the database.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORNo error encountered
    XB_INVALID_RECORDCould not mark record
    XB_NOT_OPENIf the file is not open
    XB_SEEK_ERRORSeek routine error
    XB_WRITE_ERRORWrite routine error

    Example Program:

    See program undelall.cpp for an example of how to use this method.

    Method xbShort xbDbf::UndeleteRecord( void )


    This method removes the mark for deletion on the current record in the database.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORNo error encountered
    XB_INVALID_RECORDCould not unmark record

    Example Program:

    See program sample4.cpp for an example of how to use this method.

    Method xbShort xbDbf::Zap( xbShort WaitOption )


    This method removes all records from a database and any open indices.

    WaitOption is one of:

  • F_SETLK - returns if the xbDbf file can not be exclusively locked
  • F_SETLKW - will wait to execute until it can exclusively lock the file


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORNo error encountered
    XB_LOCK_FAILEDCould not lock file
    XB_WRITE_ERRORCould not write to file
    XB_OPEN_ERRORCould not open temp database

    Example Program:

    See program zap.cpp for an example of how to use this method.
    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c13.html0000644000000000000000000004506207115376647011673 Xbase DBMS Chapter 13

    Field Methods

    Chapter Updated 2/1/99


    This chapter lists the field methods and provides examples of how to use them.

    Xbase Field Method List

    MethodDescription
    xbLong cnt FieldCount()Returns the number of fields in the file
    xbDouble d GetDoubleField(char * FieldName)Returns a xbDouble field for field name
    xbDouble d GetDoubleField(xbShort FieldNo)Returns a xbDouble field for field number
    xbShort rc GetField(xbShort,char *buf)Gets field data from the record buffer
    xbShort d GetFieldDecimal(xbShort FieldNo)Gets field decimal count
    xbShort len GetFieldLen(xbShort FieldNo)Returns the length of a given field
    char * name GetFieldName(xbShort FieldNo)Returns field name for field number
    xbShort FieldNo GetFieldNo(char * FieldName)Returns the field ID number for a given field
    char type GetFieldType(xbShort FieldNo)Returns the type of a given field
    xbFloat f GetFloatField(char * FieldName)Returns a float field for field name
    xbFloat f GetFloatField(xbShort FieldNo)Returns a float field for field number
    xbShort l GetLogicalField(xbShort FieldNo)Returns logical field data
    xbShort l GetLogicalField(char * FieldName)Returns logical field data
    xbLong l GetLongField(char * FieldName)Returns a long field for field name
    xbLong l GetLongField(xbShort FieldNo)Returns a long field for field number
    xbShort rc GetMemoField(xbShort FieldNo,
    xbLong len,char * buf)
    Get memo field data
    xbLong len GetMemoFieldLen(xbShort FieldNo)Get memo field data length
    xbShort s MemoFieldsPresent()Determine if memo fields exist in DBF file
    xbShort s MemoFieldExists(xbShort FieldNo)Determine if a particular memo field has data
    xbShort rc PutDoubleField(char * FieldName,
    xbDouble d)
    Updates a xbDouble field for field name
    xbShort rc PutDoubleField(xbShort FieldNo,
    xbDouble d)
    Updates a xbDouble field for field number
    xbShort rc PutField(xbShort FieldNo,char * val)Fills or overlays a field in the current record buffer

    Xbase Field Method List (cont)

    MethodDescription
    xbShort rc PutFloatField(char * FieldName,
    xbFloat f)
    Updates a float field for field name
    xbShort rc PutFloatField(xbShort FieldNo,
    xbFloat f)
    Updates a float field for field number
    xbShort rc PutLongField(char * FieldName,
    xbLong l)
    Updates a long field for field name
    xbShort rc PutLongField(xbShort FieldNo,
    xbLong l)
    Updates a long field for field number
    xbShort rc UpdateMemoData(xbShort FieldNo,
    xbLong len,char * buf, xbShort LockOpt)
    Update memo field data
    xbShort l ValidLogicalData( char * buf )Check for valid logical data
    xbShort l ValidNumericData( char * buf )Check for valid numeric data



    Method Definitions


    Method xbLong xbDbf::FieldCount( void )


    This method returns the number of fields which exist in the database.

    Method Return Codes


    If successful, this method returns the number of fields in the database.

    Example Program:

    See sample program sample3.cpp for an example of how to use this method.

    Method xbDouble xbDbf::GetxbDoubleField( char * FieldNo )


    This method returns a xbDouble value for field FieldNo. Fieldno can be retrieved by using method GetFieldNo.


    Method xbDouble xbDbf::GetxbDoubleField( char * FieldName )


    This method returns a xbDouble value for field FieldName. If multiple accesses for this particular field will be made from within the program, it is more efficient to access the data utlizing the field's number, rather than its name.


    Method xbShort xbDbf::GetField( xbShort FieldNo, char * buf )


    This method fills an application program supplied buffer *buf with data from the record buffer for field number FieldNo. FieldNo can be retrieved by using method GetFieldNo.

    It is the responsibility of the application program to verify the buffer is large enough to hold the data. No checking is done by method GetField to verify the buffer is large enough to hold the data.

    If successful, this method returns the length of the field in bytes.

    Example Program:

    See sample program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetFieldDecimal( xbShort FieldNo )


    This method returns the decimal count of field FieldNo. FieldNo can be retrieved by using method GetFieldNo.

    If successful, this method returns the decimal count.

    Method xbShort xbDbf::GetFieldLen( xbShort FieldNo )


    This method returns the length of field FieldNo. FieldNo can be retrieved by using method GetFieldNo.

    If successful, this method returns the length of the field in bytes.

    Example Program:

    See sample program sample3.cpp for an example of how to use this method.

    Method char * xbDbf::GetFieldName( xbShort FieldNo )


    This method returns a pointer to the name of field FieldNo. FieldNo can be retrieved by using method GetFieldNo.

    If successful, this method returns the field name.

    Example Program:

    See sample program dumpdbt.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetFieldNo( char * FieldName )


    This method is used to get a field's ID number based on paramater FieldName. Where FieldName is a valid name of a field in the database.


    Method Return Codes

    Return CodeDescription
    -1Field not found in record
    0 through nThe field number for field FieldName


    Example Program:

    See sample program sample2.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetFieldType( xbShort FieldNo )


    This method returns the type of field FieldNo. FieldNo can be retrieved by using method GetFieldNo.

    Method Return Codes


    If successful, this method returns the field type.
    C = character
    D = Date
    L = Logical
    M = Memo
    N = Numeric
    F = Float

    Example Program:

    See sample program sample3.cpp for an example of how to use this method.

    Method xbFloat xbDbf::GetFloatField( char * FieldName )


    This method returns a float value for field FieldName. If multiple accesses for this particular field will be made from within the program, it is more efficient to access the data utlizing the field's number, rather than its name.

    Example Program:

    See sample program sample3.cpp for an example of how to use this method.

    Method xbFloat xbDbf::GetFloatField( xbShort * FieldNo )


    This method returns a float value for field number FieldNo.

    Example Program:

    See sample program sample3.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetLogicalField( xbShort FieldNo )


    Method xbShort xbDbf::GetLogicalField( char * FieldName )


    This method returns -1 if field FieldName or FieldNo is not a logical field. It returns 1 if field FieldName is a 'T','t','Y' or 'y'. It returns 0 if not 'T','t','Y' or 'y'.

    Method xbLong xbDbf::GetLongField( xbShort * FieldNo )


    Method xbLong xbDbf::GetLongField( char * FieldName )


    This method returns a long value for field FieldName. If multiple accesses for this particular field will be made from within the program, it is more efficient to access the data utlizing the field's number, rather than its name.

    Example Program:

    See sample program zipinit.cpp for an example of how to use this method.

    Method xbLong xbDbf::GetLongField( xbShort * FieldNo )


    This method returns a long value for field FieldNo. FieldNo can be determined by utilizing method GetFieldNo.

    Example Program:

    See sample program zipinq.cpp for an example of how to use this method.

    Method xbShort xbDbf::GetMemoField( xbShort FieldNo, xbLong len, char * Buf, xbShort LockOption )


    This method returns Len bytes of memo field FieldNo. Buf is a user supplied buffer large enough to contain the data. No checking of the field's size is performed by this method.

    Lock Optionis one of:
    F_SETLK - return immediately if lock fails
    F_SETLKW - wait until lock function executes


    Method Return Codes

    Return CodeDescription
    XB_INVALID_FIELDNOAn invalid field number was used
    XB_NOT_MEMO_FIELDNot a memo field
    XB_NO_MEMO_DATANo memo data exists
    XB_INVALID_BLOCK_NOInternal error, notify tech support
    XB_SEEK_ERRORDisk Error
    XB_READ_ERRORDisk Error
    XB_NO_ERRORNo Error


    Example Program:

    See sample program dumpdbt.cpp for an example of how to use this method.

    Method xbLong xbDbf::GetMemoFieldLen( xbShort FieldNo )


    This method returns the length of memo field FieldNo. FieldNo can be retrieved by using method GetFieldNo.

    If successful, this method returns the length of the memo field in bytes.

    Example Program:

    See sample program dumpdbt.cpp for an example of how to use this method.

    Method xbShort xbDbf::MemoFieldExists( xbShort FieldNo )


    This method returns true (1) if field FieldNo has any memo data. Otherwise it returns false (0).


    Method Return Codes

    Return CodeDescription
    0Data file does not have any memo fields
    1Data file has memo fields


    Example Program:

    See sample program dumpdbt.cpp for an example of how to use this method.

    Method xbShort xbDbf::MemoFieldsPresent( void )


    This method returns true (1) if the file has any memo fields. Otherwise it returns false (0).


    Method Return Codes

    Return CodeDescription
    0Data file does not have any memo fields
    1Data file has memo fields


    Example Program:

    See sample program dumpdbt.cpp for an example of how to use this method.

    Method xbShort xbDbf::PutxbDoubleField( char * FieldName, xbDouble d )


    This method puts a xbDouble value d for field FieldName. If multiple accesses for this particular field will be made from within the program, it is more efficient to access the data utlizing the field's number.


    Method Return Codes

    Return CodeDescription
    XB_INVALID_FIELDNOAn invalid field number was used
    XB_INVALID_DATAAttempt to load invalid numeric or logical data



    Method xbShort xbDbf::PutxbDoubleField( xbShort FieldNo, xbDouble d )


    This method puts a xbDouble value d for field FieldNo.

    Method Return Codes


    Method Return Codes

    Return CodeDescription
    XB_INVALID_FIELDNOAn invalid field number was used
    XB_INVALID_DATAAttempt to load invalid numeric or logical data



    Method xbShort xbDbf::PutField( xbShort FieldNo, char * buf )


    This method fills field number FieldNo, with the data from buffer *buf.

    It copies data from *buf until a 0x00 character is encountered or the buffer is filled. The field will be truncated if it is to long.

    Use method GetFieldNo to determine the value for FieldNo.

    If the field is type N or F, the field is loaded right justified, left blank filled onto the record buffer.

    This method does check the validity of NUMERIC and LOGICAL data it is loading onto the record buffer. Ther can be no spaces or non-numeric data for numeric fields.


    Method Return Codes

    Return CodeDescription
    XB_INVALID_FIELDNOAn invalid field number was used
    XB_INVALID_DATAAttempt to load invalid numeric or logical data


    Example Program:

    See sample program sample2.cpp for an example of how to use this method.

    Method xbShort xbDbf::PutFloatField( char * FieldName, FLOAT f )


    This method puts a float value f for field FieldName. If multiple accesses for this particular field will be made from within the program, it is more efficient to access the data utlizing the field's number.


    Method Return Codes

    Return CodeDescription
    XB_INVALID_FIELDNOAn invalid field number was used
    XB_INVALID_DATAAttempt to load invalid numeric or logical data


    Example Program:

    See sample program sample2.cpp for an example of how to use this method.

    Method xbShort xbDbf::PutFloatField( xbShort FieldNo, FLOAT f )


    This method puts a float value f for field number FieldNo.


    Method Return Codes

    Return CodeDescription
    XB_INVALID_FIELDNOAn invalid field number was used
    XB_INVALID_DATAAttempt to load invalid numeric or logical data


    Example Program:

    See sample program sample2.cpp for an example of how to use this method.

    Method xbLong xbDbf::PutLongField( char * FieldName, xbLong Val )


    This method puts a long value Val for field FieldName. If multiple accesses for this particular field will be made from within the program, it is more efficient to access the data utlizing the field's number.

    Example Program:

    See sample program zipinit.cpp for an example of how to use this method.

    Method xbLong xbDbf::PutLongField( xbShort FieldNo, xbLong Val )


    This method puts a long value Val for field FieldNo. FieldNo can be determined by utilizing method GetFieldNo.

    Example Program:

    See sample program zipinq.cpp for an example of how to use this method.

    Method xbShort xbDbf::UpdateMemoData( xbShort FieldNo, xbLong len, char * Buf, xbShort LockOption )


    This method updates field FieldNo with Len bytes of data from Buf.

    This is the only routine necessary to add, revise or delete memo field data. To delete a memo field, set the length to zero (0L).

    LockOption is one of
  • F_SETLK - return immediately if lock fails
  • F_SETLKW - wait until lock function executes


    Method Return Codes

    Return CodeDescription
    XB_LOCK_FAILEDLock Failed
    XB_INVALID_BLOCK_NOInternal error, notify tech support
    XB_SEEK_ERRORDisk Error
    XB_READ_ERRORDisk Error
    XB_WRITE_ERRORDisk Error
    XB_NO_ERRORNo Error


    Example Program:

    See sample program sample2.cpp for an example of how to use this method.

    Method xbShort xbDbf::ValidLogicalData( char * data )


    This method returns true if data contains a valid logical data value. Otherwise, it returns false.


    Method Return Codes

    Return CodeDescription
    1Valid logical data
    0Invalid logical data


    Method xbShort xbDbf::ValidNumericData( char * data )


    This method returns true if data contains a valid numeric data value. Otherwise, it returns false.


    Method Return Codes

    Return CodeDescription
    1Valid numeric data
    0Invalid numeric data


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c14.html0000644000000000000000000000545707115376647011700 Xbase DBMS Chapter 14

    String Methods

    Chapter Updated 2/12/99


    This chapter lists the string methods.

    String Method List

    MethodDescription
    xbString()Class Constructor
    xbString(size_t size)Constructor, allocates space of size
    xbString(const char *s)Constructor, initialized to string s
    xbString(const char *s, size_t maxlen Constructor, initialized to string s, with minimal string buf size of max_len
    ~xbString()Class Destructor
    void ctor(const char *s)Set string to s
    xbString &opertor=(const xbString &s)
    xbString &operator=(const char *s)
    Set string to s
    bool isNull() constnot sure what this one does
    bool isEmpty() constReturns true if empty, otherwise returns false
    size_t len() constReturns length of string
    void resize(size_t size)Resize the string to size
    xbString copy() constUsed to copy a string
    xbSting &sprintf(const char * format, ... ) Used to format a string
    void setNum(long num)not sure what this one does
    xbString& assign(const xbString& str, size_t pos = 0, int n = 1)not sure what this one does
    char operator[](int n)Returns char in position n
    xbString &operator+=(const char *s)
    xbSting &operator+=(char c)
    Concatonate data to string
    void put_at(size_t pos, char c)Put character c at position pos
    const char *getData() constReturns the string
    void toLowerCase()Converts string to lower case
    const char *pos(char c)Locate character in string
    bool operator==(const xbString &s1, const xbString &s2) Compare string ==
    bool operator!=(const xbString &s1, const xbString &s2) Compare string !=
    xbString operator+(const xbString &s1, const xbString &s2)
    xbString operator+(const xbString &s1, const char *s2)
    xbString operator+(const char *s1, const xbString &s2)
    xbString operator+(const xbString &s1, char c2)
    xbString operator+(char c1, const xbString &s2)
    Concatonate two strings togethor


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c15.html0000644000000000000000000001651007115376651011664 Xbase DBMS Chapter 15

    Date Methods

    Chapter Updated 2/1/99


    This chapter lists the date methods and provides examples of how to use them.

    All references to Date8 refer to a date with the format of CCYYMMDD.

    Xbase Date Method List

    MethodDescription
    char * CharDayOf(char *Date8)Returns pointer to (Sun - Sat) day of week
    char * CharMonthOf(char *Date8)Returns pointer to (Jan - Dec) month of year
    xbShort DateIsValid(char *Date8)Checks a date for validity
    xbShort DayOf(char *Date8)Returns the "day of WEEK, MONTH or YEAR" from a given date
    char * FormatDate(char *fmt,char *Date8)Return a pointer to a formatted date
    xbShort IsLeapYear(char *Date8)Returns TRUE if given date is a leap year
    xbLong JulianDays(char *Date8)Returns number of days since 1/1/1900 to given date
    char * JulToDate8(xbLong Days)Converts Julian date to CCYYMMDD format
    xbLong LastDayOfMonth(char *Date8)Returns julian day for the last day of the month for a given date.
    xbShort MonthOf(char *Date8)Returns month of a date
    char * Sysdate()Returns a pointer to the system date
    xbShort YearOf(char *Date8)Returns century and year of a date




    Method Definitions


    Method: char * xbXBase::CharDayOf( char * Date8 )


    Inputs:

    Date8 - A valid date with the format of CCYYMMDD

    Returns:

    A pointer to static buffer containing the spelling of the day of the week (Monday-Sunday)

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method: char * xbXBase::CharMonthOf( char * Date8 )


    Inputs:

    Date8 - A valid date with the format of CCYYMMDD

    Returns:

    A pointer to static buffer contianing the spelling of the month (January-December)

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method: xbShort xbXBase::DateIsValid( char * Date8 )


    Inputs:

    Date8 - A valid date with the format CCYYMMDD

    Returns:

    This method returns 1 if the input date is a valid date, otherwise it returns 0.

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method: xbShort xbXBase::DayOf( xbShort Format, char * Date8 )


    Inputs:

    Valid values for Format are: WEEK for the day of the week (0 - Sunday through 6 - Saturday) MONTH for the day of the month (1-31) YEAR for the day of the year (1-366) Beginning with release 1.7.4, WEEK is now FMT_WEEK MONTH is now FMT_MONTH YEAR is now FMT_YEAR Date8 - A valid date with the format CCYYMMDD

    Processing:

    Based on the format type, calculate the day of the week, month or year.

    Returns:

    This method returns the day of the year as an integer.

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method: char * xbXBase::FormatDate( char * Format, char * Date8 )


    Inputs:

    Format - A format specifier with the following paramaters: 1) YYDDD - A julian date format 2) YY or YYYY will print a 2 or 4 digit year 3) M,MM,MMM or MMMM M - one digit month if no leading zero MM - two digit month, contains leading zero MMM - Jan through Dec MMMM - January through December 4) D,DD,DDD or DDDD D - one digit dayif no leading zero DD - two digit day, contains leading zero DDD - Sun through Sat (or julian if YYDDD) DDDD - Sunday through Saturday Date8 - A valid date with the format CCYYMMDD

    Returns:

    A pointer to a static buffer which contains the reformatted date. If the input format is an unknown type, the function returns the same date recieved.

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method: xbShort xbXBase::IsLeapYear( char * Date8 )


    Inputs:

    Date8 - A valid date with the format CCYYMMDD

    Returns:

    This method returns 1 if the input date is a leap year, otherwise it returns 0.

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method: xbLong xbXBase::JulianDays( char * Date8 )


    Inputs:

    Date8 - A valid date with the format CCYYMMDD

    Returns:

    This method returns the number or of days since 19000101.

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method: char * xbXBase::JulToDate8( xbLong Days )


    This method is the compliment of method JulianDays.

    Inputs:

    Days - A julian count of days since 19010101

    Returns:

    A date with the format of CCYYMMDD

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method: xbLong xbXBase::LastDayOfMonth( char * Date8 )


    Inputs:

    Date8 - A valid date with the format CCYYMMDD

    Returns:

    This method returns the julina day for the last day of the month for the given input date.


    Method: xbShort xbXBase::MonthOf( char * Date8 )


    Inputs:

    Date8 - A valid date with the format CCYYMMDD

    Returns:

    This method returns the MM part of the date as an integer.

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method char * xbXBase::Sysdate()


    Returns:

    This method returns a pointer to a static buufer which contains the system date in CCYYMMDD format.

    Example:

    See program testdate.cpp for an example of how to use this method.

    Method xbShort xbXBase::YearOf( char * Date8 )


    Inputs:

    Date8 - A valid date with the format CCYYMMDD

    Returns:

    This method returns the CCYY part of the date as an integer.

    Example:

    See program testdate.cpp for an example of how to use this method.
    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c16.html0000644000000000000000000002014207115376654011664 Xbase DBMS Chapter 16

    Expressions Reference

    Chapter Updated 2/12/99




    Expression Operands

    OperandTypeFunction
    +AlphaConcatonate
    +NumericAddition
    -AlphaConcatonate, remove white space
    -NumericSubtraction
    *NumericMultiplication
    /NumericDivision
    **NumericExponentiation
    <LogicalLess Than
    >LogicalGreater Than
    =LogicalEqual
    <>LogicalNot Equal
    #LogicalNot Equal
    <=LogicalLess Than or Equal
    >=LogicalGreater Than or Equal
    $LogicalContains
    ->N/AIdentifies database field ie; DATABASE->FIELD



    Expression Functions

    Expression FunctionXbase C++ MethodDescription
    ABS()xbDouble EXPN::ABS( xbDouble d ) Returns absolute numeric value of argument.
    ASC()xbLong EXPN::ASC( char * String ) Returns ASCII code of left character of string.
    AT()xbLong EXPN::AT( char *s1, char *s2 ) Returns starting position of first alphanumeric argument in second argument.
    CDOW()char * EXPN::CDOW( char Date8 ) Returns name of the day of the week of Date8.
    CHR()char * EXPN::CHR( xbLong l ) Returns ASCII character corresponding to numeric value supplied.
    CMONTH()char * EXPN::CMONTH( char * Date8 ) Returns name of the month of Date8.
    DATE()char * EXPN::DATE() Returns system date.
    DAY()xbLong EXPN::DAY( char * Date8 ) Returns numeric value of the day of the month for Date8.
    DESCEND()EXPN::DESCEND()Descend
    DTOC()char * EXPN::DTOC( char * Date8 ) Returns a date converted to format MM/DD/YY.
    EXP()xbDouble EXPN::EXP( xbDouble d ) Returns exponential for supplied value.
    INT()xbLong EXPN::INT( xbDouble d ) Converts any numeric value to an integer.
    ISALPHA()xbLong EXPN::ISALPHA( char * String ) Returns TRUE if string is alpha.
    ISLOWER()xbLong EXPN::ISLOWER( char * String ) Returns TRUE if string is lower case.
    ISUPPER()xbLong EXPN::ISUPPER( char * String ) Returns TRUE if string is upper case.
    LEFT()char * EXPN::LEFT( char * String, xbShort Len ) Returns Len characters from the left side of String.
    LEN()xbLong EXPN::LEN( char * String ) eturns the number of characters in the String.
    LOG()xbDouble EXPN::LOG( xbDouble d ) Returns the natural log of d.
    LOWER()char * EXPN::LOWER( char * String ) Converts a string to lower case.
    LTRIM()char * EXPN::LTRIM( char * String ) Eliminates leading white space from String.
    MAX()xbDouble EXPN::MAX( xbDouble d1, xbDouble d2 ) Returns the larger of two numeric arguments.
    MIN()xbDouble EXPN::MIN(xbDouble d1, xbDouble d2 ) Returns the smaller of two numeric arguments.
    MONTH()xbLong EXPN::MONTH( char * Date8 ) Returns numeric month for Date8.
    REPLICATE()char * EXPN::REPLICATE( char * String, xbShort Count ) Replicates String Conut times.
    RIGHT()char * EXPN::RIGHT( char * String, xbShort Count ) Returns Count characters from the right side of String.
    RTRIM()char * EXPN::RTRIM( char * String ) Removes trailing white space from String.
    SPACE()char * EXPN::SPACE( xbShort Count ) Returns a buffer filled with Count spaces.
    SQRT()xbDouble EXPN::SQRT( xbDouble d ) Returns square root of d.
    STR()char * EXPN::STR( xbDouble d ) Converts a number to a string.
    SUBSTR()char * EXPN::SUBSTR( char * String, xbShort StartPos, xbShort Len ) Returns a string form String starting at position StartPos for a length of Len.
    TRIM()char * EXPN::TRIM( char * String ) Same as RTRIM.
    UPPER()char * EXPN::UPPER( char * String ) Converts a string to upper case.
    VAL()xbLong EXPN::VAL( char * String ) Converts a string to an integer.
    YEAR()xbLong EXPN::YEAR( char * Date8 ) Returns numeric year from Date8.



    Expression Processing Method List

    MethodDescription
    GetCharResult()Get char * result from processed expression
    GetDoubResult()Get xbDouble result from processed expression
    GetIntResult()Get a xbLong result from processed expression
    GetExpressionHandle()Get an expression's handle
    GetExpressionResultType(xbExpression *)Get expression result type
    ParseExpression(char *,xbDbf *)Parse an expression
    ProcessExpression(xbExpression *)Process a parsed expression


    Method Definitions


    Method char * xbXBase::GetCharResult()


    This method returns a char * result from a processed expression.

    See the program listing in chapter 5 for an example of how to use this method.

    Method xbDouble xbXBase::GetDoubleResult()


    This method returns a xbDouble result from a processed expression.

    See the program listing in chapter 5 for an example of how to use this method.

    Method xbLong xbXBase::GetIntResult()


    This method returns a xbLong result from a processed expression.

    See the program listing in chapter 5 for an example of how to use this method.

    Method xbExpression * xbXBase::GetExpressionHandle()


    This method returns a handle to a recently parsed expression.

    See the program listing in chapter 5 for an example of how to use this method.

    Method char xbXBase::GetExpressionResultType( xbExpression * e )


    This method returns the result type for a given expression e.

    Method Return Codes

    Return Code ValueDescription
    Cchar * result from processed expression
    NxbDouble result from processed expression
    LxbLong (also logical) result from processed expression


    See the program listing in chapter 5 for an example of how to use this method.

    Method xbShort ParseExpression( char * exp, DBF * d)


    This method parses expression exp.
    d is a pointer to a database used for resolving any fieldname which does not contain the ->
    operator.

    See the program listing in chapter 5 for an example of how to use this method.

    Method xbShort ProcessExpression( xbExpression * e )


    This method processes parsed expression e.

    See the program listing in chapter 5 for an example of how to use this method.


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c17.html0000644000000000000000000003373307115376662011676 Xbase DBMS Chapter 17

    Index Methods

    Chapter Updated 2/12/99


    This chapter lists the xbNdx and xbNtx index methods and provides examples of how to use them.

    There are many methods in the xbNdx and xbNtx classes which are used for maintaining and updating NDX and NTX files. Fortunately for the application programmer, most of the complexities of dealing with the NDX and NTX indices are automatically cared for by the Xbase library.

    xbNdx and xbNtx methods which are used by application programs are documented here. With some exceptions (OpenIndex,CloseIndex and KeyExists) using the index routines automatically positions and returns the associated record in the DBF database.


    Xbase xbNdx Index Method List

    MethodDescription
    CheckIndxIntegrityChecks an index file for integrity
    CloseIndexOptional, closes an index. Closing the DBF file will close any open indexes.
    CreateIndexCreate an index
    FindKeyFind a key in an index file
    GetFirstKeyGet the first key in an index
    GetLastKeyGet the last key in an index
    GetNextKeyGet the next key in an index
    GetPrevKeyGet the previous key in an index
    KeyExistsDetermine if a key exists w/o positioning DBF file
    OpenIndexOpen an index
    ReIndexRebuilds an index
    in


    Method Definitions


    Method xbShort xbNdx::CheckIndexIntegrity( xbShort option )

    Method xbShort xbNtx::CheckIndexIntegrity( xbShort option )


    This method checks an open index for accuracy or file corruption. If the option is non zero, the method will display informational messages.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_LOCK_FAILEDRead lock not successfull
    XB_NOT_OPENFile not open
    XB_INVALID_RECORDInvalid record number
    XB_SEEK_ERRORSeek routine error
    XB_WRITE_ERRORWrite routine error

    Example Program:

    See program checkndx.cpp for an example of how to use this method.

    Method xbShort xbNdx::CloseIndex( VOID )

    Method xbShort xbNtx::CloseIndex( VOID )


    This method closes an open NDX index. NDX indexes are closed automatically by the DBF::CloseDatabase routine, so this is an optional method. Closed indices are not updated by the Xbase routines.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error

    Example Program:

    See program sample1.cpp for an example of how to use this method.

    Method xbShort xbNdx::CreateIndex( char * IndexName, char * KeyExpression, xbShort Unique, xbShort OverLay )

    Method xbShort xbNtx::CreateIndex( char * IndexName, char * KeyExpression, xbShort Unique, xbShort OverLay )


    This method creates an index. Indices are created as either a character based index or a numeric based index, depending on the KeyExpression value.

  • Indexname - is the name of the physical index file name.
  • KeyExpression - is the key of the index.
  • Unique - XB_UNIQUE or XB_NOT_UNIQUE
  • Overlay - XB_OVERLAY or XB_DONTOVERLAY


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_NO_MEMORYMemory error
    XB_OPEN_ERRORCould not open index file
    XB_INVALID_KEY_EXPRESSIONBad index key expression
    XB_NOT_OPENThe database was not open
    XB_SEEK_ERRORSeek error encountered
    XB_READ_ERRORRead error encountered


    Index expressions can be a single field or multiple fields. Assuming a database has fields LASTNAME and FIRSTNAME, valid index expressions could be:


    Sample Index Expressions

    ExpressionDescription
    "LASTNAME"Index on LASTNAME only.
    "LASTNAME+FIRSTNAME"Index on LASTNAME and FIRSTNAME
    "LASTNAME-FIRSTNAME"Index on LASTNAME and FIRSTNAME, all spaces between the two fields removed.
    "LASTNAME-','FIRSTNAME"Index on LASTNAME and FIRSTNAME, insert a comma between the two values, remove spaces between the two fields.


    Allowable Index Expression Operators

    OperatorKey TypeDescription
    +CharacterConcatonate string fields
    -Character Concatonate string fields, remove trailing spaces
    'literal'Characterinclude literal value
    "literal"Characterinclude literal value
    +NumericAdd two numeric fields togethor
    -NumericSubtract one numeric field from another
    *NumericMulitply two numeric fields togethor
    /NumericDivide one numeric field into another
    **NumericExponential


    Example Program:

    See program sample1.cpp for an example of how to use this method.

    Method xbShort xbNdx::FindKey( char * SearchValue )

    Method xbShort xbNdx::FindKey( xbDouble SearchValue )

    Method xbShort xbNtx::FindKey( char * SearchValue )

    Method xbShort xbNtx::FindKey( xbDouble SearchValue )


    This method searches the index for key SearchValue. The routine positions in the index, then positions to the database record for the key. If the key is not found, the key value that is the next higher value is returned.

    For character keys, the SearchValue should be a null terminated string. To find an exact match, use a key value which is as long as the key is, padded on the right with spaces.

    For numeric keys, use a xbDouble value for a search value. This is because all numeric field indices are saved as double values.


    Method Return Codes

    Return CodeDescription
    XB_FOUNDThe key was found
    XB_NOT_FOUNDThe key was not found
    XB_NO_MEMORYMemory error
    XB_OPEN_ERRORCould not open index file
    XB_SEEK_ERRORSeek error encountered
    XB_READ_ERRORRead error encountered

    Example Program:

    See program sample5.cpp for an example of how to use this method.

    Method xbShort xbNdx::GetFirstKey( VOID )

    Method xbShort xbNtx::GetFirstKey( VOID )


    This method retrieves the record for the first key in the index.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_NO_MEMORYMemory error
    XB_OPEN_ERRORCould not open index file
    XB_SEEK_ERRORSeek error encountered
    XB_READ_ERRORRead error encountered

    Example Program:

    See program sample5.cpp for an example of how to use this method.

    Method xbShort xbNdx::GetLastKey( VOID )

    Method xbShort xbNtx::GetLastKey( VOID )


    This method retrieves the record for the last key in the index.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_NO_MEMORYMemory error
    XB_OPEN_ERRORCould not open index file
    XB_SEEK_ERRORSeek error encountered
    XB_READ_ERRORRead error encountered

    Example Program:

    See program sample5.cpp for an example of how to use this method.

    Method xbShort xbNdx::GetNextKey( VOID )


    This method retrieves the record for the next key in the index. If the index is not positioned, a call to GetFirstKey is autoamtically executed.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_NO_MEMORYMemory error
    XB_OPEN_ERRORCould not open index file
    XB_SEEK_ERRORSeek error encountered
    XB_READ_ERRORRead error encountered

    Example Program:

    See program sample5.cpp for an example of how to use this method.

    Method xbShort xbNdx::GetPrevKey( VOID )


    Method xbShort xbNtx::GetPrevKey( VOID )


    This method retrieves the record for the previous key in the index. If the index is not positioned, a call to GetLastKey is autoamtically executed.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_NO_MEMORYMemory error
    XB_OPEN_ERRORCould not open index file
    XB_SEEK_ERRORSeek error encountered
    XB_READ_ERRORRead error encountered

    Example Program:

    See program sample5.cpp for an example of how to use this method.

    Method xbShort xbNdx::KeyExists( char * SearchValue )

    Method xbShort xbNdx::KeyExists( xbDouble SearchValue )

    Method xbShort xbNtx::KeyExists( char * SearchValue )

    Method xbShort xbNtx::KeyExists( xbDouble SearchValue )


    This method searches the index for the key SearchValue. The routine does not position the database record for the key. See the reference on FindKey for more information regarding KeyValue.


    Method Return Codes

    Return CodeDescription
    XB_FOUNDThe key was found
    XB_NOT_FOUNDThe key was not found
    XB_NO_MEMORYMemory error
    XB_OPEN_ERRORCould not open index file
    XB_SEEK_ERRORSeek error encountered
    XB_READ_ERRORRead error encountered

    Example Program:

    if( xbNdx::KeyExists( "MyKeyValue" )) cout << "\nKey was found"; else cout << "\nKey was not found";

    Method xbShort xbNdx::OpenIndex( char * IndexName )

    Method xbShort xbNtx::OpenIndex( char * IndexName )


    This method opens index IndexName for a given DBF database. An index must be opened before it will be automatically updated by the database update routines.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_NO_MEMORYMemory error
    XB_OPEN_ERRORCould not open index file
    XB_INVALID_KEY_EXPRESSIONBad key in index
    XB_NOT_OPENThe database was not open
    XB_SEEK_ERRORSeek error encountered
    XB_READ_ERRORRead error encountered

    Example Program:

    See program sample1.cpp for an example of how to use this method.

    Method xbShort xbNdx::ReIndex( VOID )

    Method xbShort xbNtx::ReIndex( VOID )


    This method rebuilds an index. It is used for optimizing an index, or recreating a damaged index. If the index is severly damaged (ie; the first 512 bytes are foobar) then the index must be recreated with the CreateIndex method before using the ReIndex method.


    Method Return Codes

    Return CodeDescription
    XB_NO_ERRORIf there is no error
    XB_OPEN_ERRORCould not open index file
    XB_WRITE_ERRORError writing data
    XB_CLOSE_ERRORError closing work file

    Example Program:

    See program reindex.cpp for an example of how to use this method.


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c18.html0000644000000000000000000002406407115376664011676 Xbase DBMS Chapter 18

    Locking Methods

    Chapter Updated 2/1/99


    The locking methods return either XB_LOCK_FAILED or XB_NO_ERROR. If they return LOCK_FAILED the actual reason can be found in the global variable errno or function perror() can be executed to view the results.

    The errno field may contain one of the following values if the lock was not successful.

    Error CodeDescription
    EBADFInvalid file descriptor
    EINVALInvalid lock information or file does not support locks
    EACCESS
    EAGAIN
    Lock can not be set because it is blocked by an existing lock on the file.
    ENOLCKThe system is out of lock resources, too many file locks in place.
    EDEADLKDeadlock condition
    EINTRProcess was interrupted by a signal while it was waiting


    Types of Locks

  • Write or Exclusive Locks provide exclusive access to a particular file location. No other process can lock the same location.

  • Read or Shared Locks prohibit any process from requesting a write lock on a specified part of the file. Other processes can request simultaneous read locks.


    DBF File Locking Techniques

    Xbase DBMS uses the following protocol for DBF file and record locking:

    To lock a record - the first byte of the record is locked.
    To lock the file - the header bytes of the file are locked.

    When a record is being appended to the file, the header bytes are locked.
    When a record is being updated, the header bytes and the specific record are locked.

    This locking protocol is probably not compatable with other Xbase type products. However, Xbase can be safely used for multi-user access when it is not simultaneously updating DBF or NDX files while other products/programs are.


    NDX File Locking Techniques

    Xbase DBMS locks indexes by locking the first 512 bytes of the index file. The entire index is locked because any updates to the index potentially can modify significant portions of the index tree.


    DBT File Locking Techniques

    Xbase DBMS locks memo files by locking the first 4 bytes of the memo file. This effectively locks the entire file. The entire file is locked because any updates to the free block chain can significantly change the structure of the file.


    AutoLocking Features

    If XB_LOCKING_ON is set in the options.h file, the locking methods execute any appropriate locking logic. If XB_LOCKING_ON is not set in the options.h file, all locking methods return NO_ERROR without performing any actual record or file locking. This enables the application program to always call locking routines regardless of the XB_LOCKING_ON switch in the options.h file.

    By leaving the autolocking features enabled, the application program does not need to address record, file or index locking. All locking is handled automatically by the Xbase routines. However, if access to the locking routines is required, they are available to the applciation programmer.

    When the files are automatically locked by the Xbase routines, the database file is locked first, then it locks the indexes in alphabetical order. To avoid deadlock conditions, files and record locks should always be done in the same order. When the files are unlocked, then indexes are unlocked first, then the database is unlocked.

    Auto-locking works well in an on-line transaction based environment. However, it does not function efficiently in batch mode. If you will be writing programs which process files in a batch mode, disabling auto-lock and locking the entire file at the beginning of the process and unlocking the file at the end of the process will significantly reduce process time. On a 586-200 class machine, a file with 45000 records can be read thru in a few seconds with the file locked in batch mode. In record-lock mode it takes about six minutes with the same processor.

    For processing large files, locking the file instead of locking each record is far more efficient. This is how you do it.

    For reading the file in batch mode:
    xbDbf.AutoLockOff();
    xbDbf.LockDatabase( F_SETLKW, F_RDLCK, 0L );

    For updating the file in batch mode:
    xbDbf.AutoLockOff();
    xbDbf.LockDatabase( F_SETLKW, F_WRLCK, 0L );




    Method Table

    MethodDescription
    xbDbf::AutoLockOnTurns autolocking on
    xbDbf::AutoLockOffTurns autolocking off
    xbDbf::ExclusiveLockLock file and indexes in exclusive mode
    xbDbf::ExclusiveUnlockUnlock files and indexes
    xbDbf::LockDatabaseLocks or unlocks a DBF database
    xbNdx::LockIndexLocks or unlocks an xbNdx index
    xbNdx::LockMemoFileLocks or unlocks a DBT memo field file


    Method Descriptions

    Method VOID xbDbf::AutoLockOn( VOID )


    This method turns automatic record locking on. Auto record locking is on by default if XB_LOCKING_ON is set in the options.h file.

    Example Program:

    See program loadzips.cpp for an example of how to use this method.

    Method VOID xbDbf::AutoLockOff( VOID )


    This method turns automatic record locking off. Auto record locking is on by default if XB_LOCKING_ON is set in the options.h file.

    Turning auto locking off will result in slightly better execution speeds but should not be used in multi-user environments when multiple users can update files simultanteously. If multiple users are accessing a file which is read only then it is safe to turn off auto-locking for a particular file.

    Turning autolocking off will disable any index file locking which is particularly dangerous in a multi-user environment if updates on the files are permitted.

    Example Program:

    See program loadzips.cpp for an example of how to use this method.

    Method SHORT xbDbf::ExclusiveLock( SHORT WaitOption )

    Method SHORT xbDbf::ExclusiveUnlock( VOID )


    ExclusiveLock and ExclusiveUnclock will lock the data file, memo file (if applicable) and any associated indexes in an exclusive mode. They also turn auto-lock on and off as appropriate.

    WaitOption is either:

  • F_SETLK - returns immediately regardless if success or failure
  • F_SETLKW - waits until lock function executes

    Example Program:

    See program sample4.cpp for an example of how to use this method.

    Method SHORT xbDbf::LockDatabase( SHORT WaitOption, SHORT LockType, LONG LRecNo )


    This method locks or unlocks an Xbase (.DBF) file which was previously opened.

    WaitOption is either:

  • F_SETLK - returns immediately regardless if success or failure
  • F_SETLKW - waits until lock function executes

    LockType is one of:

  • F_RDLCK - Perform a Read or Shared Lock
  • F_WRLCK - Perform a Write or Exclusive Lock
  • F_UNLCK - Unlock it

    LRecNo is:

    0 - Lock the header section of the file (use this to lock the file)
    1 through n - Lock a particular record

    Method Return Codes
    Return CodeDescription
    XB_INVALID_RECORDAn invalid record given
    XB_LOCK_FAILEDThe lock action failed, see errno
    XB_NO_ERRORThe lock was successful

    Example Program:

    See program loadzips.cpp for an example of how to use this method.

    Method xbShort xbDbf::LockIndex( xbShort WaitOption, xbShort LockType )


    This method locks or unlocks an Index (.NDX) file which was previously opened.

    WaitOption is either:

  • F_SETLK - returns immediately regardless if success or failure
  • F_SETLKW - waits until lock function executes

    LockType is one of:

  • F_RDLCK - Perform a Read or Shared Lock
  • F_WRLCK - Perform a Write or Exclusive Lock
  • F_UNLCK - Unlock it

    Method Return Codes
    Return CodeDescription
    XB_LOCK_FAILEDThe lock action failed, see errno
    XB_NO_ERRORThe lock was successful

    Example Program:

    See program loadzips.cpp for an example of how to use this method.

    Method xbShort xbDbf::LockMemoFile( xbShort WaitOption, xbShort LockType )


    This method locks or unlocks a memo (.DBT) file which was previously opened. It is not necessary for an application to call this method as locking is handled automatically by other routines.

    WaitOption is either:

  • F_SETLK - returns immediately regardless if success or failure
  • F_SETLKW - waits until lock function executes

    LockType is one of:

  • F_RDLCK - Perform a Read or Shared Lock
  • F_WRLCK - Perform a Write or Exclusive Lock
  • F_UNLCK - Unlock it

    Method Return Codes
    Return CodeDescription
    XB_LOCK_FAILEDThe lock action failed, see errno
    XB_NO_ERRORThe lock was successful

    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c19.html0000644000000000000000000003546707115376672011707 Xbase DBMS Chapter 19

    xbHtml/CGI Interface Methods

    Chapter Updated 2/1/98


    xbHtml Class Methods

    ClassDescription
    BoldOn()Turn on bold
    BoldOff()Turn off bold
    Bullet()Create a bullet point
    DumpArray()Dumps the internal field array
    EmphasizeOn()Turn on emphasize
    EmphasizeOff()Turn off emphasize
    EndHtmlPage()Generate end-of-page tags
    GenFormFields(...)Print a form with data fields
    GetArrayNo(char * FieldName)Gets a field's offset into the internal data array
    GetCookie(char *CookieName)Get a cookie data value
    GetData(xbShort ArrayNo)Gets data for a particular array offset
    GetDataForField(char * FldName)Gets the value for a particlar field
    GetEnv(char * EnvString)Get an environment string
    GetMethod()Returns true if get method used
    HeaderOn(xbShort HeaderLevel)Turn on a header
    HeaderOff(xbShort HeaderLevel)Turn off header
    ItalicOn()Turn on italics
    ItalicOff()Turn off italics
    Newline()Generate a newline
    PlusToSpace(char *s)Convert + symbols to spaces
    PostMethod()Returns true if post method used
    PrintHtml(char * String)Print a string or number
    PrintEncodedChar(char c)Prints an encoded xbHtml character
    PrintEncodedStringCHAR *s)Prints an encoded xbHtml string
    SendRedirect(char * RedirectURL)Send redirect command
    SetCookie(...)Set up and send a cookie to the client
    SpaceToPlus(char *s)Convert spaces to + symbols
    StartHtmlPage(char *Title)Generates beginning of Html page tags
    StartTextPage()Generates beginning of Text page tags
    Tally(char * FileName)Increment a counter



    Method Definitions


    Method void xbHtml::BoldOn()


    This method prints the bold on tag.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::BoldOff()


    This method prints the bold off tag.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::Bullet( void )


    This method prints a bullet point.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::DumpArray( void )


    This method dumps the internal array which stores all data passed to the program from the previous form. This method is mostly used for trouble shooting.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::EmphasizeOn( void )


    This method prints the emphasize on tag.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::EmphasizeOff( void )


    This method prints the emphasize off tag.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::EndHtmlPage( void )


    This method prints the end-of-page tags .

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method xbShort xbHtml::GetArrayNo( char * FieldName )

    This method returns a the offset into the internal array where the data for field FieldName is stored. It will return -1 on error.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::GetFormFields( xbDbf *d, xbShort Option, const char * Title, xbFieldList * fl )

    This method is used for creating an xbHtml page with database (or non database) fields and displaying them. The method creates an xbHtml table in order to align the fields in an asthetically pleasing manner.


    Method Paramaters

    ParamaterDescription
    xbDbf *dA pointer to a xbDbf object, or 0 if no dbf fields used
    xbShort Option0 = Display empty fields
    1 = Display field data from record buffer of object d
    char * TitleAn optional title
    xbFieldList *flAn array of field specific information used for building the output

    Stucture xbFieldList

    ParamaterDescription
    char * LabelField label on form
    char * FieldNameForm Field Name
    char * FieldLenForm Display Length
    xbShort DbfFieldNoCorresponding database field no
    xbShort FieldOption0 - display as input/output field
    1 - display as password field
    2 - display as output data only

    Return Codes

    Return CodeDescription
    XB_NOT_OPENDatabase is not open
    XB_NO_ERRORNo error

    Example Program:

    xbXBase x; xbDbf d( &x ); xbHtml p; xbFieldList FL[] = { { "Name", "NAME", 0, 0 }, { "Address", "ADDRESS", 1, 0 }, { "City", "CITY", 2, 0 }, { "State", "STATE", 3, 0 }, { "Zip", "ZIP", 4, 0 } } // open the database and get a record p.GenFormFields( &d, 1, "Address Information", FL );

    Method char * xbHtml::GetCookie( char * CookieName )

    This method returns a pointer to the data for cookie CookieName

    Sample Usage:

    xbHtml p; char CookieDataBuffer[10]; if( p.GetCookie( "COOKIETEST" )) strcpy( CookieDataBuffer, p.GetCookie( "COOKIETEST" ), 9 );

    Method char * xbHtml::GetData( xbShort ArrayNo )

    This method returns the data from the internal array for offset ArrayNo. It will return NULL if there is no data in the array for ArrayNo or if ArrayNo is out of range.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method char * xbHtml::GetDataForField( char * FieldName )

    This method returns the data for from the internal array for field FieldName. It will return NULL if FieldName is not in the internal array, or if there is no data for field FieldName.

    Example Program:

    See program zipinq.cpp for an example of how to use this program.

    Method char * xbHtml::GetEnv( char * EnvString )


    This method returns a pointer to the data for environment string EnvString.

    EnvString Values

    EnvString
    AUTH_TYPE
    CONTENT_LENGTH
    CONTENT_TYPE
    HTTP_REQUEST_METHOD
    QUERY_STRING
    REMOTE_ADDR
    REMOTE_HOST
    REMOTE_USER
    SCRIPT_FILENAME
    SCRIPT_NAME
    SERVER_PORT
    SERVER_PROTOCOL
    SCRIPT_PATH
    CGI_STDIN
    CGI_STDOUT
    CGI_STDERR
    HTTP_USER_AGENT
    HTTP_CONTENT_LENGTH
    HTTP_ACCEPT
    HTTP_HOST
    REQUEST_METHOD

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method xbShort xbHtml::GetMethod( void )


    This method returns true if a GET method was used.

    Example Program:

    See program testhtml.cpp for an example of how

    Method void xbHtml::HeaderOn( xbShort lvl )


    This method prints the header on tag where lvl is a level 1 thru 6.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::HeaderOff( xbShort lvl )


    This method prints the header off tag where lvl is a level 1 thru 6.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::ItalicOn( void )


    This method prints the italic on tag.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::ItalicOff( void )


    This method prints the italic off tag.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::Newline( void )


    This method prints the newline tag.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::PrintEncodedChar( char )


    This method prints an xbHtml encoded character. For example, the '<' character is printed as '& lt'.

    Method void xbHtml::PrintEncodedString( char * )


    This method prints an xbHtml encoded string. For example, any '<' characters in the string are printed as '& lt'.

    Method void xbHtml::Newline( void )


    This method prints the newline tag.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::PlusToSpace( char * String )


    This method is used for converting all + symbols to spaces in a given string. This is useful for sending URLs with spaces in the data.

    Sample Code:

    xbHtml p; char MyUrlString[40]; strcpy( MyUrlString, "program.cgi?PARM=My paramater information" ); p.SpaceToPlus( MyUrlString ); // eliminate the spaces p.SendRedirect( MyUrlString ); // send it p.PlusToSpace( MyUrlString ); // un-eliminate the spaces

    Method xbShort xbHtml::PostMethod( void )


    This method returns true if a POST method was used.

    Example Program:

    See program testhtml.cpp for an example of how

    Method void xbHtml::PrintHtml( char * x )
    Method void xbHtml::PrintHtml( xbLong x )
    Method void xbHtml::PrintHtml( xbShort x )

    This method prints the data x on the page.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::SetCookie( char * Name, char * Value, char * ExpDate, char * ExpTime, char * TimeZone, char * Path, char * Domain, xbShort Secure );

    Some browsers support the Netscape cookie method for storing client side data such as state information. The cookie containing data is passed along in the HTTP request-response dialog. To send a cookie to a browser, you must send the cookie before any html data is sent.

    Sample Usage:

    xbXBase x;
    xbHtml p;
    char ExpireDate[15];

    strcpy( ExpireDateBuf, x.FormatDate( "DDD DD-MMM-YY", x.Sysdate()));
    p.SendCookie( "COOKIETEST", "Y", ExpireDate, 0, "CST" );

    If the SendCookie method doesn't work, you could optionally do this:
    cout << "Set-Cookie: COOKIETEST=Y; " << ExpireDateBuf << " CST" << endl;

    Method void xbHtml::SendRedirect( char * RedirectURL )


    The output of a CGI program can be a redirect command. The redirect command is used to instruct the client to display the contents of the new URL instead of loading the URL from the present location.

    Example:


    xbHtml h;
    h.SendRedirect( "http://www.startech.keller.tx.us" );


    Method void xbHtml::SpaceToPlus( char * String )


    This method is used for converting all spaces in a given string to + symbols. This is useful for sending URLs with spaces in the data.

    Sample Code:

    xbHtml p; char MyUrlString[40]; strcpy( MyUrlString, "program.cgi?PARM=My paramater information" ); p.SpaceToPlus( MyUrlString ); // eliminate the spaces p.SendRedirect( MyUrlString ); // send it p.PlusToSpace( MyUrlString ); // un-eliminate the spaces

    Method void xbHtml::StartHtmlPage( char * Title )


    This method prints data necessary to begin an Html page:
    Content-type: text/html\n\n

    and also sets the page title to title.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method void xbHtml::StartTextPage( void )


    This method prints data necessary to begin a Text page:
    Content-type: text/plain\n\n

    Example Program:

    See program testhtml.cpp for an example of how to use this program.

    Method xbLong xbHtml::Tally( char * Filename )


    This method increments a counter stored in Filename and returns the new count. The Web server needs write access to the directory where Filename is stored for this routine to function. This method will not create a file. It expects the file to already exist. To initialize a file, create an ASCII file with the number 0 in it. It is a case sensitive routine.

    This routine returns 0 if it fails, otherwise it returns the current tally count for Filename.

    Example Program:

    See program testhtml.cpp for an example of how to use this program.
    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c2.html0000644000000000000000000002527707115376676011621 Xbase DBMS Chapter 2

    Database Overview

    Chapter Updated 2/1/99


    The objective of this chapter is to provide information regarding how the database files are utilized and document the various record structures. With the exception of the brief section on the record buffer, the information presented in this chapter is not required to use the Xbase library. It is mainly information describing internal file structures utilized by the Xbase routines.

    Xbase files are comprised of a variable length header record which stores information about the file and describes the fixed length record format, followed by a series of fixed length data records.

    Each fixed length data record is preceded by a one byte indicator which identifiies if the record has been deleted. If the record is not deleted, the indicator is a space (0x20). If deleted, the indicator contains an asterisk (0x2A). Data fields are stored in records without field separators or record terminators.

    In earlier releases of dBASE, there is an ASCII NULL character between the $0D end of header indicator and the start of the data. This NULL was removed starting with dBASE III Plus, making a Plus header one byte shorter than an identically structured III file. The methods documented in the Xbase software and documentation follow the more recent version where the NULL character is not included.

    Each database file is comprised of zero, one or many records. A record is comprised of fields. Only one record is accessed at a time.

    Zero, one or many database files can be open simultaneously.


    The Record Buffer

    When using the Xbase routines, each open data file has a record buffer which is manipulated by calling the database, index and field routines. Updates are committed from the record buffer to the database when a write, or append is performed. The library will automatically write updates to the database if the buffer has been updated and the record is repositioned or the database is closed.

    The record buffer is not used for handling the actual data portion of memo fields. When working with memo fields, the application program must allocate enough buffer space for reading and writing memo fields.

    Internal to the library, there is an additional record buffer which stores the original value of the data record before any changes are made. This is used by the index routines for finding and deleting original key values from any open indices before adding the new keys. If the key values are not changed, no index updates occur.



    Xbase Database File Header

    The Xbase file header, located at the beginning of the database, describes the .DBF database. Knowledge of this structure is not necessary to effectively utilize the Xbase libraries.


    PositionLengthDescription
    01 bytefile version number
    (03H without a .DBT file)
    (83H with a .DBT file)
    1-33 bytesdate of last update
    (YY MM DD) in binary format
    4-732 bit numbernumber of records in data file
    8-916 bit numberlength of header structure
    10-1116 bit numberlength of the record
    12-3120 bytesreserved
    32-n32 bytes eachfield descriptor record (see below)
    n+11 byte0DH as the field terminator




    Xbase Field Descriptor Record

    The Xbase field descriptor record stores information about each field in the database. Each database has from 1 to 1024 fields. Knowledge of this structure is not necessary to effectively utilize the Xbase libraries.


    PositionLengthDescription
    0-1011 bytesfield name in ASCII zero-filled
    111 bytefield type in ASCII (C N L D or M)
    12-1532 bit numberfield data address
    161 bytefield length in binary
    171 bytefield decimal count in binary
    18-3114 bytesreserved bytes (version 1.00)




    Field Data Format

    Data are stored in ASCII format in the database as follows:

    DATA TYPEDATA RECORD STORAGE
    CharacterASCII characters, left justified, right blank filled
    Date(8 digits in YYYYMMDD format, such as
    19601007 for October 7, 1960)
    Logical? Y y N n T t F f (? when not initialized)
    Memo10 digits representing a .DBT block number
    Numeric. 0 1 2 3 4 5 6 7 8 9 + -, right justified, left blank filled
    Float. 0 1 2 3 4 5 6 7 8 9 + -, right justified, left blank filled



    Memo Fields

    Memo fields store variable length data elements in a seperate .DBT file. The main .DBF file maintains a ten byte field which is used by the Xbase routines for determining the location of the data in the .DBT file.

    Xbase DBMS supports both dBASE III+ and dBASE IV version memo files. The version IV files are somewhat more efficient in that they reuse unused memo space when data are deleted or freed from use. With version III files, all new updates are appended to the end of the file and the unused space is not reclaimed until the datafiles are packed.

    Memo fields can be used for storing a variety of date type. However, type 3 files are limited to storing textual data because most internal memo field processing in a type 3 file relies on two contiguous 0x1a charaters.

    Type 4 memo fields can be used for storing BLOB (binary large object) data reliably, as the internal file structure does not rely on any special characters embedded in the data.

    A special not on storing string data in a memo field. For those users that are new to C/C++ programming, string fields typically end with a null (0x00) terminator character. As a general rule of thumb when using the library, add one to the length of any string when specifying the length of the data. This stores the null terminating byte with the data. For example, when storing string "This is a string" specified size if 17, not 16.

    Technical memo file information

    The following info on memo fields is for the curious. It is not required reading if you don't need to know the internals.

  • Memo files are made up of one or more blocks
  • For version III files, the block size is 512
  • For version IV files, the block size is a multiple of 512
  • The minimum amout of space necessary to store one memo field is one block or 512 bytes.
  • The default block size can be adjusted by manipulating the XB_DBT_BLOCK_SIZE macro in the options.h file.
  • The main .DBF file maintains a ten byte numeric field which is blank if no memo data exists for a given field. Otherwise it contains a number, which when multiplied by the block size, points to the offset in the file of the head block in the file/

    For version 3 memo field files, there are two fields in the head block of the file, NextBlockNo and Version. Depending on the Xbase software, some vendors products update these two fields, some do not. The Xbase library keeps the fields updated, but does not rely on them to be valued with correct data. This helps to support maximum compatibility amoungst all Xbase tools available.

    For version 4 memo field files, the first block in the .DBT file is a header block which is comprised of 8 bytes of data which maintain the file's block size and the next free block available in the file. Blocks two through n contain the actual memo data. A chain of empty blocks is maintained within the file for potential future use. When an add or update routine executes, it first attempts to find a spot in a set of blocks which were earlier allocated, but not currently in use for the data. If no free spot is found, data are appended to the end of the file. The free block chain is sorted in block number order. When blocks of data are freed and added to the free block chain, the routines will attempt to concatonate free block chains togethor where possible. When a delete occurs, or an update which requires less space occurs, the new free space is added to the free block chain.

    Various Memo File Block Types

    Valid Block Types
    Head Block
    Only data block for memo field
    First of several contiguous data block set
    2-n of contiguous data block set
    Only data block in free chain (version IV only)
    First of several contiguous free block set (version IV only)
    2-n of contiguous free block set (type 4 only)


    Head Block Structure

    1-4LONGNext Block ID
    5-8LONGNot used all 0x00's
    9-16CHAR(8)Filename (Version IV Only)
    17CHARVersion (0x03 = Version III, 0x00 = Version IV)
    18-20CHAR(3)Not used all 0x00's
    21-22SHORTBlock Size (Version IV only )
    23-Remainder of blockCHARNot used


    Version IV Head Data Block Structure

    xbShort0-1-1
    xbShort2-3Starting position of data (always 8 ?)
    xbLong4-7Length of data includes first 8 bytes
    char (9) - Blocksize8-15Data


    Version IV Head Free Block Structure

    xbLong0-3Next free block in the free block chain
    xbLong4-7Number of free blocks in this contiguous free block set


    Version 3 and 4 memo fields are terminated with two contiguous 0x1A bytes of data.


    Send Me Mail - xbase@startech.keller.tx.us

    (c)1997 StarTech


    xbase-2.0.0/html/xbase_c3.html0000644000000000000000000001007407115376677011610 Xbase DBMS Chapter 3

    Fields and Strings

    Chapter Updated 2/1/99




    The title of this chapter almost sounds like a popular North American magazine called Field and Stream. The difference between this chapter and that magazine is there are no dead animal carcuses or fishing lures in this chapter. For those you will need to get a copy of Field and Stream.

    The main objective of this chapter is to provide information regarding the basic concepts of manipulating data via the field methods.

    Field names can be up to ten bytes in length and can contain characters, numbers or special characters in the name. The field methods are used to manipulate the data in a record of a data file. There are several types of fields.

    Field Types

    TypeSizeAllowable ValuesSchema Value
    Numeric0 - 17(include sign and decimal point+ - . 0 through 9XB_NUMERIC_FLD
    Character0 - 254AnythingXB_CHAR_FLD
    Date8CCYYMMDDXB_DATE_FLD
    Floating Point0 - 17 (includes sign and decimal point+ - . 0 through 9XB_FLOAT_FLD
    Logical1? Y y N n T t F f (? - uninitialized)XB_LOGICAL_FLD
    MemoFixed length portion - 10
    Variable length 0 - 32760
    Type III - Text
    Type IV - Anything
    XB_MEMO_FLD


    Field names, types and lengths are defined when a data file is created. After the file is created, the field characteristics can not be changed. To change field characteristics, a new database must be defined with the new field requirements.

    Memo Fields

    Memo fields are variable length data fields which are stored in two parts. This first part is a ten byte field which is stored in the fixed length record of the .DBF file. The variable data is stored in a seperate .DBT file in 512 byte blocks. The ten byte field in the fixed length portion of the record points to a .DBT block number.

    There are two versions of memo data files type III and type IV. Type IV is more advanced in that released space can be reused and it also supports BLOB data. The type III file is older technology, does not support dynamic space reclamation and only supports string data. See method xbDbf::SetVersion for controlling which version type you are using.

    To utilize memo fields, the application program must allocate a buffer which is large enough to handle the memo data.

    Fields and Field Numbers

    The Xbase routines can access field data via using field names or field numbers. Field numbers are numbered 0-n where the first field in a datafile is field 0 going through the last field n. Accessing fields by number is more efficient than accessing by name.

    Record Schema

    The record schema of a file can be found in the documentation for method CreateDatabase in the Database Methods chapter, or view example sample1.cpp.

    Strings

    Beginning with Release 1.8.0a, Xbase includes support for a string class xbString. The original thinking was not to include a string class in the library, and encourage users to use the string class native to the user's compiler. But as C++ does not have a native way to handle strings, and there is not a standard string class across C++ compilers, it was decided to include a lightweight string class with the library. In some cases this is redundant.

    The string class interface is derived from the Draft Standard C++ Library by P.J. Plauger. If you are familiar with other string classes, this one should feel familiar to you.


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech


    xbase-2.0.0/html/xbase_c4.html0000644000000000000000000001234407115376701011577 Xbase DBMS Chapter 4

    Date Processing

    Chapter Updated 2/12/99


    The objective of this chapter is to provide information regarding the basic concepts of date arithmetic and supply generic C/C++ date methods.

    Two common things of all programmers is that if they write enough code, they will eventually have to deal with dates. They may be Julian dates, Gregorian dates, or a date with their best freind's girl, but they'll eventually be working with dates. The other thing is that most programmers don't have the time or don't want to spend time writing mundane date routines.

    To explain how dates work, I'll give a brief overview and history of Julian dates, Gregorian dates, leap years and leap centuries.

    Leap Years

    Due to the fact that it actually takes about 365 1/4 days for the earth to circle the sun, every fourth year and every fourth century have an extra day added to the end of February and the year is called a leap year. Leap years have 366 days, non leap years have 365 days. The following code segment describes how to determine if a given year is a leap year. A leap year is a year having 366 days, which can be evenly divisible by 4 and not by 100 or divisible by 400. There are also leap centuries. Leap centuries are years which are evenly divisible by 400. To calculate a leap year, the following code segment can be used int year; if(( year % 4 == 0 && year % 100 != 0 ) || year % 400 = 0 ) LEAP_YEAR = TRUE; else LEAP_YEAR = FALSE

    Julian Dates

    Around the time of Jesus Christ, a fellow with the name of Julias Ceasar established the Julian calendar. The Julian calendar established every fourth year as a leap year with 366 days and all other years having 365 days. The months were set up the same as they are with a Gregorian calendar, which is what we use today. A Julian date is defined as as the number of days from the first day of the year; February 1 would have a Julian day of 32.

    From a programmer's perspective, Julian dates are useful for doing date arithmetic, determining the difference between two dates or calculating a future or past date.

    To determine the difference between two dates, convert both dates to a Julian date and subtract one from the other.

    To calculate a future or past date, convert the base date to a Julian date, add (or subtract) the number of days necessary to (from) it and convert the julian date back to a Gregorian date.

    The Julian date routines use a base date of 01/01/1900.

    Gregorian Dates

    In 1582, Pope Gregor XIII introduced a corrected form of the Julian calendar. Every 4th year still has 366 days except for century years. Century years were added as leap years if evenly divisible by 400. The year 2000 is a leap century.

    The methods supplied with this software are based on gregorian dates with the format of CCYYMMDD for century, year, month and day.

    CASTELLANO options

    There is an option in the options.h file for enabling the date routines to return Spanish values for days, weeks and months.

    #define CASTELLANO

    Date Formats

    All dates are stored in the .DBF files with format CCYYMMDD.

    All date routines work with dates formated with the same CCYYMMDD format.

    Sample Program

    #include <iostream.h> #include <xbase/xbase.h> main() { xbXBase x; long l; cout << "\nThis program tests the XDATE routines\n\n"; cout << "\nThis year is " << x.YearOf ( x.Sysdate() ); cout << "\nThis Month is " << x.MonthOf( x.Sysdate() ); cout << "\nToday is day " << x.DayOf( WEEK, x.Sysdate()) << " of the week"; cout << "\nToday is day " << x.DayOf( MONTH, x.Sysdate()) << " of the month"; cout << "\nToday is day " << x.DayOf( YEAR, x.Sysdate()) << " of the year"; if( x.IsLeapYear( x.Sysdate())) cout << "\nThis is a leapyear"; else cout << "\nThis is not a leap year."; cout << "\nToday is " << x.Sysdate(); if( x.DateIsValid( "19951301" )) cout << "\n19951301 is a valid date"; else cout << "\n19951301 is not a valid date"; l = x.JulianDays( "19951101" ) - x.JulianDays( "19951001" ); cout << "\nThere are " << l << " days between 10/1/95 and 11/1/95."; cout << "\nIn 7 days it will be " << x.JulToDate8( x.JulianDays( x.Sysdate()) + 7L ); cout << "\nToday is " << x.CharDayOf( x.Sysdate()); cout << "\nThis month is " << x.CharMonthOf( x.Sysdate()); cout << "\nFormat (YYDDD) "; cout << x.FormatDate( "YYDDD", x.Sysdate()); cout << "\nFormat (MM/DD/YY) "; cout << x.FormatDate( "MM/DD/YY", x.Sysdate()); cout << "\nFormat (MMMM DD,YYYY) "; cout << x.FormatDate( "MMMM DD,YYYY", x.Sysdate()); cout << "\nFormat (DDDD, MMMM DD YYYY) "; cout << x.FormatDate( "DDDD, MMMM DD YYYY", x.Sysdate()); cout << "\n"; }
    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c5.html0000644000000000000000000001204307115376702011575 Xbase DBMS Chapter 5

    Expression Handling

    Chapter Updated 2/1/98


    Overview

    The main objective of this chapter is to provide information regarding the basic concepts of using the Xbase Expression module.

    Beginning with release 1.7.4, the Xbase library includes an expression parsing routine which assists application programmers by providing a high level data manipulation tool and also allows for building complex index keys. The functions included are derived from dBASE III Plus, but not all dBASE III Plus functions have been implemented yet.

    Internal fuctioning

    The expression module works in two phases. Firstly method ParseExpression is called and builds an expression tree from all the components of the expression. The expression is checked for valid field names, literals, operands and functions. Any field references are resolved. If fields are used in an expression and the database name for the field is not included in the name with the -> operand, the routines assume the associated database has been successfully opened.

    Secondly, method ProcessExpression is called to process the expression tree which was already created. The routine parses each node in the expression tree, executing functions, processing operands and manipulating data to produce the desired result.

    If an expression will be processed repeatedely, it is best to pre-parse the tree using ParseExpression, then for each new call to the expression, execute method ProcessExpression which processes the tree.

    Expression Return Types

    Expressions will return a type of CHAR *, NUMERIC or LOGICAL.

    An expression return type can be determined with method GetExpressionResultType after parsing it.

    Expressions returning a return type of CHAR are limited to a 200 internal buffer. There is also a 100 byte limit for NDX index key support. If the 200 byte limit is not large enough for your application, you can adjust the the enum { WorkBufMaxLen = 200 }; in file exp.h.

    Expression Functions

    Each expression function also has a corresponding C++ function. It is slightly more efficient to call the C++ functions directly, rather than execute the expression parsing routines. All functions which return CHAR * are returning a pointer to a static buffer which is overlaid by the next call to any function which also returns CHAR *.

    Expression Components

    Expressions are made up of one or more tokens. A token is one of literal, database field, operand or function. Literals are either numeric or character. Character literals are enclosed in 'single' or "double" quotes. numeric literals are a series of one or more contiguous numerals, ".", "+" or "-'".

    A field is simply a field name in the default database, or is in the form of database->fieldname.


    Sample Program Demonstrating Expression Processing

    /* expressn.cpp */ #ifdef DOS extern unsigned _stklen = 40000; #endif #include <xbase/xbase.h> xbSchema MyRecord[] = { { "FIELD1", 'C', 20, 0 }, { "FIELD2", 'C', 20, 0 }, { "NAME", 'C', 10, 0 }, { "DOUB1", 'N', 7, 2 }, { "FLOAT1", 'F', 8, 3 }, { "DATE1", 'D', 8, 0 }, }; xbShort rc; xbXBase x; xbDbf d( &x ); XB_EXPRESSION *e; /****************************************************************************/ xbShort MyExpressionProcessor( char * Expression ) { xbShort rc; char type; if(( rc = x.ParseExpression( Expression, &d )) != 0 ) { cout << "\nParse Error " << rc; return rc; } e = x.GetExpressionHandle(); if(( rc = x.ProcessExpression( e )) != 0 ) { cout << "\nError processing expression rc = " << rc; return rc; } type = x.GetExpressionResultType( e ); cout << "\nExpression " << Expression << " produced result = "; if( type == 'C' ) cout << x.GetCharResult(); else if( type == 'N' ) cout << x.GetDoubleResult(); else if( type == 'L' ) cout << x.GetIntResult(); else cout << "\nUnknown result type " << type; return 0; } /****************************************************************************/ main() { e = NULL; d.CreateDatabase( "TEST", MyRecord, OVERLAY ); d.BlankRecord(); d.PutField( d.GetFieldNo( "FIELD1" ), "TESTA " ); d.PutField( d.GetFieldNo( "FIELD2" ), " testb" ); d.PutField( d.GetFieldNo( "DOUB1" ), "200.33" ); d.PutField( d.GetFieldNo( "FLOAT1" ), "100.00" ); d.PutField( d.GetFieldNo( "DATE1" ), "19980101" ); d.AppendRecord(); /* process 3 simple expressions */ MyExpressionProcessor( "FIELD1+FIELD2" ); MyExpressionProcessor( "FIELD1-UPPER(FIELD2)" ); MyExpressionProcessor( "5+TEST->DOUB1" ); d.CloseDatabase(); return 1; }
    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c6.html0000644000000000000000000001625207115376705011607 Xbase DBMS Chapter 6

    NDX Indices

    Chapter Updated 2/12/99


    The objective of this chapter is to provide information regarding the basic concepts of how .NDX index files work in the Xbase environment.

    The information in this chapter has been gathered by searching the internet and by examining the structure of known good NDX indexes.

    NDX Index File Characteristics

  • NDX indices maintain keys in ascending sort order only.

  • NDX indices support unique or non unique keys.

    Unique keys must be unique. The database update routines will fail if an attempt to add a non-unique key is performed.

    Non-unique Keys are not required to be unique, duplicate keys are allowed if the index is created with the XB_NOT_UNIQUE setting. Duplicate keys are stored in record number order.

  • NDX indexes are automatically updated by the Xbase library after the indices are opened.

  • Character keys are left justified and padded on the right with spaces.

  • Numeric keys are stored as eight byte double values.

    The numeric key processing logic performs floating point numeric calculations on eight byte double values. This logic may be compute intensive and slow on older machines, especially the older intel processors without a math coprocessor chip.

    NDX File Internals

    NDX files are comprised of two or more 512 byte blocks or nodes of information. There are three types of nodes: Head Nodes, Interior Nodes and Leaf Nodes.

  • The Head Node is the first node in the file starting at position zero (0) and contains information about the NDX file. There is only one Head Node in each index and it always starts at the beginning of the file.

    NDX Header Node

    TypeSizeField NameDescription
    xbLong4StartNodeThis identifies the root node of the index. The Header node is node 0.
    xbLong4Total NodesThis is the count of the total nodes in the index. The count includes the header node.
    xbLong4NoOfKeysTotal number of keys in the index +1
    xbUShort2KeyLenThe index key length
    xbUShort2KeysPerNodeThe maximum number of keys per node
    xbUShort2KeyTypeType of key
    00 - Character
    01 - Numeric
    xbLong4KeysizeKey record size + 8
    char1UnknownReserved
    char1UniqueUnique indicator
    00 - Not Unique - XB_NON_UNIQUE
    01 - Unique - XB_UNIQUE
    char488KeyExpressionKey expression string
    512Total bytes in node


    The following structure is used by the Xbase NDX routines: struct NdxHeadNode{ xbLong StartNode; /* header node is node 0 */ xbLong TotalNodes; /* includes header node */ xbLong NoOfKeys; /* actual count + 1 */ xbUShort KeyLen; /* length of key data */ xbUShort KeysPerNode; /* max number of keys per node */ xbUShort KeyType; /* 00 = Char, 01 = Numeric */ xbLong KeySize; /* KeyLen + 8 */ char Reserved1; /* Not sure about this one */ char Unique; /* 00 = not unique, 01 = unique*/ char KeyExpression[488]; /* key definition */ }

    Interior and Leaf Nodes

    Interior Nodes and Leaf Nodes share the same structure in an NDX file. The difference between the two types is that interior nodes point to other interior nodes or leaf nodes and leaf nodes point to records in a DBF file. Interior nodes are optional nodes in an NDX file, however if there are more than a few keys in the index there will certainly be one or more interior nodes in the file. There will always be at least one leaf node in the file. Leaf nodes contain DBF record numbers which point to the location of the record in the DBF file.

    Interior nodes have field LeftNodeNo valued which points to the node which points to the keys which are less than the key value in the KeyVal field. There is one more LeftNodeNo value in the node than there are keys. The Last LeftNodeNo points to the node which is greater than the highest key value in the node. Interior nodes have 0 in the value for the DbfRecNo field.

    Leaf nodes have 0 in the LeftNodeNo field but do have a value in the DbfRecNo field which points to a DFB record.

    NDX Interior Node and Leaf Node Structure

    TypeSizeField NameDescription
    xbLong4NoOfKeysThisNodeThe number of key values in this node.
    char508KeyRecA repeating structure of pointers and keys. See the next table for the KeyRec structure.


    KeyRec Structure

    TypeSizeField NameDescription
    xbLong4LeftNodeNoThe node number of the lower node for this key. 0 in Leaf Nodes.
    xbLong4DbfRecNoThe DBF record number for this key. 0 in Interior Nodes.
    charKeyLenKeyValueThe key value.


    For those interested in knowing how the Xbase DBMS manipulates and navigates index files, the following discussion may be helpfull.

    Xbase DBMS navigates through NDX files by using an in-memory chain of nodes of the current location / key in use. It starts by reading the Head Node of the index, which points to the first node of the file. The first node of the file will be a leaf node if the index is small or will be an interior node if the index has more than one leaf node. The first interior node is loaded into memory, added to the node chain and points to the next node to read. The node is made up of one or more keys. If it is a leaf node, the logic looks for a matching key on the node. Otherwise, if it is an interior node, the logic looks at the keys until the search key is greater than or equal to the key in the node and then traverses down the tree to the next node. It continues down the tree, adding the nodes to the in-memory node chain until it reaches the correct leaf node. If it finds a matching key in the leaf node, it returns a XB_FOUND condition. If it doesn't find an exact match in the leaf node, it returns a XB_NOT_FOUND condition and stops on the key which is greater than the search key given.
    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c8.html0000644000000000000000000001333607115376706011612 Xbase DBMS Chapter 8

    Record and File Locking

    Chapter Updated 2/1/99


    Locking Overview

    Xbase DBMS supports multi-user processing through file and record locks. Record locking restricts multiple cooperating programs from simultaneously accessing the same data and corrupting it. Without record and file locking in a multi-user environment, simultaneous access to the data and index files can cause the files to become inaccurate and unusable.

    Record locking is on by default in the Xbase DBMS library. To disable it, comment out the XB_LOCKING_ON option in the options.h file in the xbase/src directory.

    The current Xbase DBMS record locking does not co-exist with other Xbase products and there is not yet support for locking in a DOS/Windows environment. The locking functions do work correctly for a Xbase DBMS only configuration. Future version of Xbase DBMS will have enhanced locking features for co-existing with other Xbase products and also include DOS/Windows support.

    The locking methods return either XB_LOCK_FAILED or XB_NO_ERROR. If they return XB_LOCK_FAILED the actual reason can be found in the global variable errno or function perror() can be executed to view the results.

    The errno field may contain one of the following values if the lock was not successful.

    Error CodeDescription
    EBADFInvalid file descriptor
    EINVALInvalid lock information or file does not support locks
    EACCESS
    EAGAIN
    Lock can not be set because it is blocked by an existing lock on the file.
    ENOLCKThe system is out of lock resources, too many file locks in place.
    EDEADLKDeadlock condition
    EINTRProcess was interrupted by a signal while it was waiting


    Types of Locks

  • Write or Exclusive Locks provide exclusive access to a particular file location. No other process can lock the same location.

  • Read or Shared Locks prohibit any process from requesting a write lock on a specified part of the file. Other processes can request simultaneous read locks.


    DBF File Locking Techniques

    Xbase DBMS uses the following protocol for DBF file and record locking:

    To lock a record - the first byte of the record is locked.
    To lock the file - the header bytes of the file are locked.

    When a record is being appended to the file, the header bytes are locked.
    When a record is being updated, the header bytes and the specific record are locked.

    This locking protocol is probably not compatable with other Xbase type products. However, Xbase can be safely used for multi-user access when it is not simultaneously updating DBF or NDX files while other products/programs are.


    NDX File Locking Techniques

    Xbase DBMS locks indexes by locking the first 512 bytes of the index file. The entire index is locked because any updates to the index potentially can modify significant portions of the index tree.


    DBT File Locking Techniques

    Xbase DBMS locks memo files by locking the first 4 bytes of the memo file. This effectively locks the entire file. The entire file is locked because any updates to the free block chain can significantly change the structure of the file.


    AutoLocking Features

    If XB_LOCKING_ON is set in the options.h file, the locking methods execute any appropriate locking logic. If XB_LOCKING_ON is not set in the options.h file, all locking methods return XB_NO_ERROR without performing any actual record or file locking. This enables the application program to always call locking routines regardless of the XB_LOCKING_ON switch in the options.h file.

    By leaving the autolocking features enabled, the application program does not need to address record, file or index locking. All locking is handled automatically by the Xbase routines. However, if access to the locking routines is required, they are available to the applciation programmer.

    When the files are automatically locked by the Xbase routines, the database file is locked first, then it locks the indexes in alphabetical order. To avoid deadlock conditions, files and record locks should always be done in the same order. When the files are unlocked, then indexes are unlocked first, then the database is unlocked.

    Auto-locking works well in an on-line transaction based environment. However, it does not function efficiently in batch mode. If you will be writing programs which process files in a batch mode, disabling auto-lock and locking the entire file at the beginning of the process and unlocking the file at the end of the process will significantly reduce process time. On a 586-200 class machine, a file with 45000 records can be read thru in a few seconds with the file locked in batch mode. In record-lock mode it takes about six minutes with the same processor.

    For processing large files, locking the file instead of locking each record is far more efficient. This is how you do it.

    For reading the file in batch mode:
    xbDbf.AutoLockOff();
    xbDbf.LockDatabase( F_SETLKW, F_RDLCK, 0L );

    For updating the file in batch mode:
    xbDbf.AutoLockOff();
    xbDbf.LockDatabase( F_SETLKW, F_WRLCK, 0L );




    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_c9.html0000644000000000000000000000436307115376710011606 Xbase DBMS Chapter 9

    HTML/CGI Web Server Interface

    Chapter Updated 2/1/99


    The main objective of this chapter is to provide information regarding the basic concepts of utlilizing the HTML/CGI interface with Xbase.

    Overview

    The HTML/CGI interface is designed to work with web server technologies such as the Apache Web Server. The HTML class is a user interface included with Xbase DBMS.

    Utilizing this technolgy leverages on the ability to generate code which is useable on a wide variety of client platforms. Any platform which runs a browser program can access Xbase DBMS applications running on a web server.

    Before using this class, it would be helpful to have an understanding of how HTML works, which is beyond the scope of this chapter.

    Internal Functioning

    The HTML class is relatively simple. When the class initializes, the class constructor creates an internal two dimensional array with field names and data. The array is accessed by the GetData, GetArraryNo and GetDataForField methods.

    Samples

    There is one sample form testhtml.html and one sample program testhtml.cpp which demonstrate the use of the HTML class.

    Run Samples



    Apache Install Hints

    To run cgi scripts with apache, the recommended approach is to compile programs with a .cgi extension. If the executable programs are not kept int the cgi-bin directory, then you will need to add a handler to your Apache configuration script. Addtionally, in the Directory stanzas, add ExecCGI to the Options clause.

    Examples:

    Additional handler statement:
    AddHandler cgi-script .cgi

    Directory Stanza:
    < Directory /usr/local/myproject >
    Options ExecCGI Indexes
    AllowOverride None
    Order allow,deny
    allow from all
    < /Directory >


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_download.html0000644000000000000000000000352107115376710013075 Xbase DBMS Library Download Menu

    Xbase DBMS Library Download Menu

    Page Updated 2/27/99


    Unix tar file version 1.8.0b - 2/27/99

    Unix tar documentation 1.8.0a - 2/1/99

    Current development version as of 3:00 AM CST nightly update - 2/11/99

    Unix tar documentation 1.8.0a - 2/1/99

    Willy's Xbase 1.8 Conversion Programs - 2/1/99

    Unix tar file version 1.7.4c - 10/26/98

    Dos/Windows zip version 1.7.4c - 10/26/98

    Unix tar Copy of all HTML documentation - 1.7.4c - 10/26/98

    Michael Bedward's Sample application using Xbase and wxWindows 7/17/98

    Hubertus Kehl's perl utility for converting Clipper programs to Xbase 11/29/98

    CVS Access to the current working copy of Xbase



    xbase-2.0.0/html/xbase_help.html0000644000000000000000000000261207115376711012217 Xbase DBMS Help

    Help with the Xbase project

    Page Updated 11/20/98


    The Xbase project is looking for volunteers to help continue building the Xbase library. If you would like to assist, no volunteers are turned down.

    The xbase project can use help in any of the following areas:

  • Assist with a screen I/O Xbase compatible library

  • Testing

  • Marketing

  • Interpret into other languages

  • Provide feedback on any aspect of Xbase, bugs, bad html links, spelling, etc..

  • Migrate Xbase DBMS to other platforms

  • Develop makefiles for other platforms

  • Integrate Xbase with other projects / products

  • Documentation

  • Develop any relevant routines or modules to include with xbase

  • Develop additional index routines (ie; Foxpro)

  • Create a How-to on adding additional new expression functions

  • Create a How-to on adding additional index formats (like Clipper and Foxpro)

  • CVS Access to the current working copy of Xbase

  • Send me mail if you are interested - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_links.html0000644000000000000000000000324707115376711012414 Xbase DBMS Related Links Page

    Xbase Related Links

    Page Updated 2/28/99


    Galaxy Online Shopping Mall
    An online shopping mall created using Xbase as the foundation


    Xbase File Format Description by Erik Bachmann.
    A truly excellent piece of work by Erik Bachmann


    Coda, Michael Bedward's Nature Conservation Planning Software
    This beneficial software was built using the Xbase DBMS library and shows an example of how Xbase can be used to help solve real world problems.
    Thanks Michael for your work...


    The wxWindows cross platform GUI toolkit


    Stefan Holmberg's Freeware SQL Server
    This Freeware SQL server was built using the Xbase library.


    dBASE Expression Indexes: A Primer


    Programming with the XForms Library


    Dome GNU Case Tool


    If you know a good Xbase related page that belongs here
    - Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_locking.html0000644000000000000000000002565407115376716012735 Xbase DBMS Chapter 10

    Xbase DBMS Record and File Locking

    Chapter Updated 4/8/98


    Locking Overview

    Xbase DBMS supports multi-user processing through file and record locks. Record locking restricts multiple cooperating programs from simultaneously accessing the same data and corrupting it. Without record and file locking in a multi-user environment, simultaneous access to the data and index files can cause the files to become inaccurate and unusable.

    Record locking is on by default in the Xbase DBMS library. To disable it, comment out the LOCKING_ON option in the options.h file in the xbase/src directory.

    The current Xbase DBMS record locking does not co-exist with other Xbase products and there is not yet support for locking in a DOS/Windows environment. The locking functions do work correctly for a Xbase DBMS only configuration. Future version of Xbase DBMS will have enhanced locking features for co-existing with other Xbase products and also include DOS/Windows support.

    The locking methods return either LOCK_FAILED or NO_ERROR. If they return LOCK_FAILED the actual reason can be found in the global variable errno or function perror() can be executed to view the results.

    The errno field may contain one of the following values if the lock was not successful.

    Error CodeDescription
    EBADFInvalid file descriptor
    EINVALInvalid lock information or file does not support locks
    EACCESS
    EAGAIN
    Lock can not be set because it is blocked by an existing lock on the file.
    ENOLCKThe system is out of lock resources, too many file locks in place.
    EDEADLKDeadlock condition
    EINTRProcess was interrupted by a signal while it was waiting


    Types of Locks

  • Write or Exclusive Locks provide exclusive access to a particular file location. No other process can lock the same location.

  • Read or Shared Locks prohibit any process from requesting a write lock on a specified part of the file. Other processes can request simultaneous read locks.


    DBF File Locking Techniques

    Xbase DBMS uses the following protocol for DBF file and record locking:

    To lock a record - the first byte of the record is locked.
    To lock the file - the header bytes of the file are locked.

    When a record is being appended to the file, the header bytes are locked.
    When a record is being updated, the header bytes and the specific record are locked.

    This locking protocol is probably not compatable with other Xbase type products. However, Xbase can be safely used for multi-user access when it is not simultaneously updating DBF or NDX files while other products/programs are.


    NDX File Locking Techniques

    Xbase DBMS locks indexes by locking the first 512 bytes of the index file. The entire index is locked because any updates to the index potentially can modify significant portions of the index tree.


    DBT File Locking Techniques

    Xbase DBMS locks memo files by locking the first 4 bytes of the memo file. This effectively locks the entire file. The entire file is locked because any updates to the free block chain can significantly change the structure of the file.


    AutoLocking Features

    If LOCKING_ON is set in the options.h file, the locking methods execute any appropriate locking logic. If LOCKING_ON is not set in the options.h file, all locking methods return NO_ERROR without performing any actual record or file locking. This enables the application program to always call locking routines regardless of the LOCKING_ON switch in the options.h file.

    By leaving the autolocking features enabled, the application program does not need to address record, file or index locking. All locking is handled automatically by the Xbase routines. However, if access to the locking routines is required, they are available to the applciation programmer.

    When the files are automatically locked by the Xbase routines, the database file is locked first, then it locks the indexes in alphabetical order. To avoid deadlock conditions, files and record locks should always be done in the same order. When the files are unlocked, then indexes are unlocked first, then the database is unlocked.

    Auto-locking works well in an on-line transaction based environment. However, it does not function efficiently in batch mode. If you will be writing programs which process files in a batch mode, disabling auto-lock and locking the entire file at the beginning of the process and unlocking the file at the end of the process will significantly reduce process time. On a 586-200 class machine, a file with 45000 records can be read thru in a few seconds with the file locked in batch mode. In record-lock mode it takes about six minutes with the same processor.

    For processing large files, locking the file instead of locking each record is far more efficient. This is how you do it.

    For reading the file in batch mode:
    DBF.AutoLockOff();
    DBF.LockDatabase( F_SETLKW, F_RDLCK, 0L );

    For updating the file in batch mode:
    DBF.AutoLockOff();
    DBF.LockDatabase( F_SETLKW, F_WRLCK, 0L );




    Method Table

    MethodDescription
    DBF::AutoLockOnTurns autolocking on
    DBF::AutoLockOffTurns autolocking off
    DBF::ExclusiveLockLock file and indexes in exclusive mode
    DBF::ExclusiveUnlockUnlock files and indexes
    DBF::LockDatabaseLocks or unlocks a DBF database
    NDX::LockIndexLocks or unlocks an NDX index
    NDX::LockMemoFileLocks or unlocks a DBT memo field file


    Method Descriptions

    Method VOID DBF::AutoLockOn( VOID )


    This method turns automatic record locking on. Auto record locking is on by default if LOCKING_ON is set in the options.h file.

    Example Program:

    See program loadzips.cpp for an example of how to use this method.

    Method VOID DBF::AutoLockOff( VOID )


    This method turns automatic record locking off. Auto record locking is on by default if LOCKING_ON is set in the options.h file.

    Turning auto locking off will result in slightly better execution speeds but should not be used in multi-user environments when multiple users can update files simultanteously. If multiple users are accessing a file which is read only then it is safe to turn off auto-locking for a particular file.

    Turning autolocking off will disable any index file locking which is particularly dangerous in a multi-user environment if updates on the files are permitted.

    Example Program:

    See program loadzips.cpp for an example of how to use this method.

    Method SHORT DBF::ExclusiveLock( SHORT WaitOption )

    Method SHORT DBF::ExclusiveUnlock( VOID )


    ExclusiveLock and ExclusiveUnclock will lock the data file, memo file (if applicable) and any associated indexes in an exclusive mode. They also turn auto-lock on and off as appropriate.

    WaitOption is either:

  • F_SETLK - returns immediately regardless if success or failure
  • F_SETLKW - waits until lock function executes

    Example Program:

    See program sample4.cpp for an example of how to use this method.

    Method SHORT DBF::LockDatabase( SHORT WaitOption, SHORT LockType, LONG LRecNo )


    This method locks or unlocks an Xbase (.DBF) file which was previously opened.

    WaitOption is either:

  • F_SETLK - returns immediately regardless if success or failure
  • F_SETLKW - waits until lock function executes

    LockType is one of:

  • F_RDLCK - Perform a Read or Shared Lock
  • F_WRLCK - Perform a Write or Exclusive Lock
  • F_UNLCK - Unlock it

    LRecNo is:

    0 - Lock the header section of the file (use this to lock the file)
    1 through n - Lock a particular record

    Method Return Codes
    Return CodeDescription
    INVALID_RECORDAn invalid record given
    LOCK_FAILEDThe lock action failed, see errno
    NO_ERRORThe lock was successful

    Example Program:

    See program loadzips.cpp for an example of how to use this method.

    Method SHORT DBF::LockIndex( SHORT WaitOption, SHORT LockType )


    This method locks or unlocks an Index (.NDX) file which was previously opened.

    WaitOption is either:

  • F_SETLK - returns immediately regardless if success or failure
  • F_SETLKW - waits until lock function executes

    LockType is one of:

  • F_RDLCK - Perform a Read or Shared Lock
  • F_WRLCK - Perform a Write or Exclusive Lock
  • F_UNLCK - Unlock it

    Method Return Codes
    Return CodeDescription
    LOCK_FAILEDThe lock action failed, see errno
    NO_ERRORThe lock was successful

    Example Program:

    See program loadzips.cpp for an example of how to use this method.

    Method SHORT DBF::LockMemoFile( SHORT WaitOption, SHORT LockType )


    This method locks or unlocks a memo (.DBT) file which was previously opened. It is not necessary for an application to call this method as locking is handled automatically by other routines.

    WaitOption is either:

  • F_SETLK - returns immediately regardless if success or failure
  • F_SETLKW - waits until lock function executes

    LockType is one of:

  • F_RDLCK - Perform a Read or Shared Lock
  • F_WRLCK - Perform a Write or Exclusive Lock
  • F_UNLCK - Unlock it

    Method Return Codes
    Return CodeDescription
    LOCK_FAILEDThe lock action failed, see errno
    NO_ERRORThe lock was successful

    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_mail.html0000644000000000000000000000176607115376716012227 Xbase DBMS Mail Options

    Xbase Mail

    Page Updated 10/21/98

    There are two different mail lists you can participate in.



    Active Majordomo mail list - used by the Xbase development team

    To get on this list and/or contribute to Xbase project development, send an email message to majordomo@startech.keller.tx.us and type subscribe xbase in the message body. This list is subject to frequent messages.

    The Update notification and registered Xbase users list

    Add yourself to this list if you want to register yourself with the Xbase project and receive news of any significant developments and releases. This list gets infrequent messages. Register with the Xbase project

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_order.html0000644000000000000000000000261707115376717012415 Xbase DBMS Order Form

    Xbase DBMS Order Form

    Page Updated 6/9/98


    Xbase Items For Sale

    ItemPriceQtyTotal
    Xbase Users Guide, Source and Samples$34.95____________
    Xbase Handy Quick Reference$4.00____________
    Automatic software upgrade - 2 years$20.00____________
    Purchase all three and save $9.00
    Users Guide, Quick Reference and Upgrades
    $49.95____________
    Grand Total_______


    Select a Payment Type

    ___ American Express ___ Discover ___ MasterCard ___ Visa ___ Cash / Check

    For Credit Card Orders:

    Name On Card: _________________________________________

    Expiration Date: _______________________

    Card Number: _______________________________
    Print this form and send it to:

    Startech
    1615 Timber Ridge Ln
    Roanoke TX, 76262
    U.S.A.

    If you are paying by check, please include it with this order. If you order the 2 year upgrade package, please include your email address. Shipping is included with the price of this order.
    xbase-2.0.0/html/xbase_port.html0000644000000000000000000000150407115376717012260 Xbase DBMS Makefile Collection

    Xbase DBMS Makefile Collection

    Page Updated 4/8/98


    Linux Slackware 3.2 Makefile

    Sun Solaris 2.5 Makefile

    Borland Turbo C++ Makefile

    OpenVMS How To

    Contribute a makefile to the Xbase project



    xbase-2.0.0/html/xbase_preamble.html0000644000000000000000000000454207115376717013070 Xbase DBMS v1.8.0

    Xbase DBMS
    Last Updated 2/11/99
    Version 1.8.0a

    Welcome to Xbase DBMS. This product provides C and C++ programmers a powerful class library for manipulating Xbase type database files and indices. This project originated as Xbase for Linux, but thanks to support for the library by many programmers on platforms other than Linux, it has been renamed to Xbase DBMS. The main development of this library however, remains on the Linux platform utilizing the GCC public domain C/C++ compiler.

    XBase DBMS is a cross-platform development tool and currently includes routines to support multi-user access for .DBF databases, fields, Dbase III and IV memo fields (variable length fields), dates, record and file locking and .NDX indices. As of release 1.7.4c, Xbase is compatible with dBASE III database, indices, and memo fields and has some support for dBASE IV features.

    There is an HTML user interface class which works well with the Apache Web Server. Future releases will support filters, enhanced .MDX index files, transaction support, a client server configuration, secure data options and other enhancements requested by anyone using this library.

    New with release 1.8.0a

  • Unix automake/autoconf support - thanks to Denis Pershin
  • Exception processing - thanks to Denis Pershin
  • NTX Index Processing - thanks to Bob Cotton
  • The beginnings of a Turbo Vision interface - thanks to Vitaly Fedrushkov
  • Renamed classes to avoid naming conflicts with other libraries
  • Support for string class - thanks to Hubertus Kehl and Denis Pershin

    If you are looking for database libraries in general, or need access to Xbase files in particular, give Xbase DBMS a try. If you are a C programmer and new to C++ object oriented programming, Xbase for Linux is easy to learn and will help transition you to the world of object oriented programming. If you have never programmed in "C/C++" before, this library should provide complete enough examples to get you started programming in "C/C++" with confidence.



    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_probs.html0000644000000000000000000000157107115376720012417 Xbase DBMS Bug Reporting and Enhancement Suggestion

    Xbase Bugs and Enhancements

    Page Updated 4/8/98



    If you run into problems with the Xbase DBMS, please let me know.

    Send me an email with a description of the problem, sample code and what specifically you are trying to get it to do.

    Any enhancements you would like to see in future releases are also appreciated.



    You may find information for your problem in the Xbase Mail Archives http://www.startech.keller.tx.us/XbaseArchive/


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/xbase_toc.html0000644000000000000000000000522407115376720012056 Xbase DBMS Documentation Table of Contents

    Xbase DBMS
    Last Updated 2/11/99
    Version 1.8.0a

    Documentation Table Of Contents

    Section 1 - Xbase Concepts

    Chapter 1 - Getting Started
    Chapter 2 - Database Overview
    Chapter 3 - Fields and Strings
    Chapter 4 - Date Processing
    Chapter 5 - Expression Handling
    Chapter 6 - NDX Indices
    Chapter 7 - NTX Indices
    Chapter 8 - Record and File Locking
    Chapter 9 - HTML/CGI Web Server Interface
    Chapter 10 - Turbo Vision Interface

    Section 2 - Using the Library

    Chapter 11 - Library Options and Methods
    Chapter 12 - Database Methods
    Chapter 13 - Field Methods
    Chapter 14 - String Methods
    Chapter 15 - Date Methods
    Chapter 16 - Expression Reference
    Chapter 17 - Index Methods
    Chapter 18 - Locking Methods
    Chapter 19 - HTML/CGI Web Server Interface
    Chapter 20 - Turbo Vision Interface

    Section 3 - Appendices

    Appendix A - Return Codes and Exception Processing
    Appendix B - Quick Reference
    Appendix C - GPL Library License
    Appendix D - Supporting the Xbase Project
    Appendix E - Xbase Related Links
    Appendix F - Bibliography
    Appendix G - Sample HTML/CGI/Xbase Application
    Appendix H - Porting the Library
    Appendix I - Hubertus Kehl's Xbase DBMS Perl conversion program
    Appendix J - Willy the Pooh's Xbase DBMS rename conversion program

    Section 4 - Experimental Doc++ Documentation

    Automated Documentation by Doc++


    Send me mail - xbase@startech.keller.tx.us

    (c)1997 StarTech



    xbase-2.0.0/html/zipflow.gif0000644000000000000000000004332207115376727011412 GIF87a[÷õÿóÿúóüùÿíøëøòëðéçôñùåðã²µ«èâÛ¢¥›ÝèÛàÚÓ\\S¥°£ÈÂ»ÍØË°ª£Àº³ÕàÓRUKŠƒØÒËÐÊõÀ³ˆ‚{pigÿóü š“˜’‹‹˜‹€zs• “xrkhb[ÅÐýȻ]h[u€sèßéepc‡‘µ±¹à×áPJCmxk¥¡©}‡}™™ãîñ½¹ÁÑÇÑÙÏÙ­©±‰‰i_iȿɡ—¡éÿîHB;EOEWPYyoy=H;@:3éÿÿÛæé5@344+€wõÙé`WaPGQõúÿÿêùH?IºÆÉáÿæÞÿÿÿéëÕÝáËÖÙmuyÃÎÑ8/9ûâñ”ÿïó•¡/+#…‘U]a›‚‘@7A«”“¢·îòÿ¶››%#ëÏ«õÜÛ½Â×ó×÷emqáûùˆÙ¥ÑðͩųÁ}‹¥ª¿á¯ÿìÿչɽsƒ]eië°»ÿõÿ²yƒ­±ÍÝÄËɫû«' )/(1¦}ŒÅ©¹¨r{•š¯ÉãáÑѯÁØÕ½ãóÕ³š©Ã¬«u}[BQ‹rûäãÿ˜³žt‰»¢±“‹u™ÿÛË´³žÈÁ˜•} cLO‰úËïùÝS:IõÿåÃ’©ÎæÅ¶Œ¡™µ£ !±¸ÿ »›}ÖÿÿÙõã¦Ðɶßß®…”òÑÿÓåêÿ‰¥“©ÃÁµºÏ-59–l …9TJ{bqu¿ÿÜñ˜éµ†\q•˜¾¾çèkRa–À¹Çݽ»Ÿ¿Æî÷¢is¦Õ´qQS Æ»¤£{dc‘­›úÁËxÉ•Î÷øn˜‘€Ï«¿Õµ;"1HE-¥¨ÎÎûãp¿›ÅÊßX§ƒesU™³±^‹s£äµÿÆáK2A†¡PM5¹ÕÃÉåÓ¾‘·iƒv ™1M;ÿæÿޏ±˜çÃF1…ŠŸÀ½¥Ó·×˯ϮÖßÿÉÓ¨÷ÓîÄÙK3¥³•Û¿ß•£…ø³«¯¾îÅ¡»¹xÇ£öÌá‘«©xu]«ˆ×³Óÿó(wS⩳85!þ UMAX-COMPRESS v1.0UMAX-v1 YUV ,[ÿH° Áƒ(\Ȱ¡Ã‡JœH±¢Å‹3jÜȱ£Ç!Š$ ò!È“(Sª\ɲeÊ‘bÊ$Y2¢Ë›8sêܹóaÌÐ4ɳ¨Ñ£H“B”8 ©Á¥I£JJU#у;vH¼Zµ«×¯H U`ÁNÒ¢uRÊiB›`ãÊûrlJ”ÈЦM™¿€K@X`V Wºˆ+8àÀÀÂN, @º|Ãù‹‚4hð Á…\ /^ÍZjáÆ@ÈàÀ2‚@áÀ ”…€Â€€# PÁ„ÑB Œ0pÀˆŠh¢IÎbUAƒGP3 P B l@AØ.d7BÎP`‚«n1¬@$1ûíÒ†©µ@c¯ Bâ]³4º ¶QŒ=„Ú^w/,ˆEI ´GÓ{Ep ß Òl€Z^'qCØ6l (@ƒ<°"AÂÝ|á ]¸€—ÔõDÀa¡p3P ¨@6ÀƒP ,‚ \d– ˜` !ÀD /áíyØÖ†‚Œ P@ÿ,`"ðx¨ƒ>pÁQ€º  …h@.Áh€lb‚ 8E~Á€š ?HÀ‚°‹«Ó@D1z  ¡X8tç|ôŽ FR€]<Ž p À-P€ˆ¼\Zè€ú8$¨àP `Á ÆVµ¡à- ,pÔàC ÂšÌà2º‡(m ð@4P8(ˆˆP@|G$ Ú(à5ÄÀ ä ̧ x€™€h`‘baÀ(@–E€¿ã™ÿ´`vˆe‰¨dQ €—Z0ËZ`×Sˆ­’¤,U\SÁ ÆÆQÔ07ØÎfp…(DáMH„ƒ&`nèÃ@, @ °hFäGÞ Ø¬"`U rH`Â*P·aÌ©a‚ÏÀ®Â  § *Ð "ÈŽû¥hÀ„¬ c›‚1ŽœÎkrQƒ(Žjãh ‘ J&ÀA`‚ 0„,H! +0ÀÜÆ¯á€ Õœ”©žlÀy¼Àùr©91¦$ü\+ÅÆ¸~©:æ©(Wd†ÿ´gl4èšfà8x­•¬¤Ÿ†” °«yÎK•X §Šm·h€B"°AŒM2ÂI]ú‚•Ú`¥_KÐhP?¤Ïë)@A¥u)«,šbÈöÂ&6>å¦oŒ‘ß¹P'Õ5@[GÜÑí¥IW×”¦EŸW˜¬`Ô£^äR+–T®k2ßÛtû6‹ÑÄ XuýÄÞž@I³ÊÞO¼×±¡ kðá5\ kðÕjÞø\Çmx{Á¾¥4?vÁZS èûcy‰O?RÀ'5]«1ÀÀÈÐ4`à s䨭Æ\ S¦HÉLÞÞÔõ H ÿ5rU\°¬¬È3™H@WÀ@ jPƒï” 8@0ð¤`b'AÛÖoŒN i× dÉ“[, 0‚wZ@v1\uA@˜Aˈ2à(àiè£$ Lö1Z ðr=fQ=º×E‘ô€ÇÖ€î\°Ð)þm^ Ï.Cž? ¸`Y@¶Çm¹Ý©QC=%®ÉM–à <莊º<¢vŽÕÀ¼×dù.p„20,³@àeÿaõ¸PwÙûÈ ÁgDHóšÛüæ8¿ù¤vÎóžû|ç8Þ¹#Ž“‰o/(}’ƒ^4íFÑK N0\&?úO !à§g¸ ‰u²É¢²›ýìh/{ÖÎv¶çùíp»Üß®”`èD/ú¯Ó¼6|5?ø̈°²¸J 8^@ X8ž š‡¤I‚ŽÃðFƒ$!€UÞ£beÇKXä«r€Õ »^“€×4‹‰eKtÞ×ìî•.YÀ’¤Ý|¤²O¾ÝîfH .$;¼øº6È‚t t‡#H`öΦã\ü6R€ÓSÀøüJ­ö#a€ÿÃr¯{£ ®×A@”i°|UIçèl°…àãk¬¥Kì °Ø™¶@ à*) %8R `ˆ25Ñ0ñR~G1 óZ ÿ01±a@Y :0P 0 ÀääT5Ä3Û±.Ò*…W&% €x—5A"p\e,A%àì2¶CîgPb1iM°2àíÔS0kƒ³@à‚2<<@Sw<ó”~#уä„A¨'fAZC¡EÐQb;Àõ6M°T`E fê„#ÀbuðF]ï"c#ƒb.ÿpwf#h(/j¸†ùª³!Å…_ ³F7c4Ýaa€6’g\ðÑE u†Q.¤4UQP8iX‰+A5µPT$¦!ør>?6`;³.{Õ.Ùd"m$ €¼¦%ဵh‹.¡ ×#ÁHÕÁ.TQ`;ÒÈ ±¨/‡%aSïB‰Qá‹æ†Ã5Ž:¨OÕqCä(8 õ%Ýd“=åŽôHŽ$o¨v·²¾·0*vŒ?ˆþøÐ(© ÁS©k ±b¡7OvŒýV8Cq‘Ó¸oˆkØø”ô‚B#éñ$ˆ’ùÿh>Qùò?³‰9“V’7‰“Y+î”Ùp 9#Sø%×C”ßx;é”HI6Ø·€ý!íÂLHöŽþˆ.&i‘Y‰JÂ(V„&Ò‹ÆR1‘~r•™–Ñ_—âóÖŒ+±3`^|5t óˆ—Z0<Ò1]™/0bè˜dI’Vy˜ˆ©–—’&ð‡ç•/1„I7Œ¦T™4)I•™)±+O‚yI”À“"A•b¦…u’ªyù/Öæ7*ýA ÆÑ‹“)ŽFA—¸™š» )º‚ å‘ƒ±" Ý!cƒ9—e)IGùœVÿ_ñ”*ð¾5iˆFZ1(  bUáQMš'ž±ƒÀ…¦*p30þˆ€*xqñétáaŸù5,5úycö6=”|W°MÐR “6xG0@j`"©ÊŠ2:žŒ7RІö00iL€8pÙIƒ‘'º)êp5úÒ¢‘)?*“Æ&eh¹Tuu¢)y‘yÖ„¤.: \¡p|p³¸$øQ-ÀÂ)šFm@ ¡ZŠd–_$Œ€` 6a¢â‘¢jŠ‹oJcv‰^ 7p^ÿ“_BŸ]‘¢¡F†=0ƒŠ á…Ñ5xà a@¦hú\^³_æ3  6Yzþ(`ÆJÚ3‘cÓ¢žX`Œ16®€ŸÚ ¼Ú«B B€YáYá«2¬B Bð ²Ð Çúc2€¨ê¹=õªð(«™J«e16g€Jª«!V0®`¼q¼±¼±®KîZ ïê®·PGà®K@­ëÆc† «ØªªU«p«ßº;ð{ ¹@ ¦` §à ¾ ¤ §€ ‚ C@7CЂÐT õÐÁÄ$Ë4P(€4€­•²,À²,`­ýz­:«ÿ =ðÂP°¬»aK ð@1Ð ð0éÐ èà 𞀠~0µ~p r€ °à °Ð7`7ðH°]«?ð1 8€*€?ðÔ«à*ž6ËQÑ5€ <®B€°O° ” ¦ðà° O0”@ B£Û ø@B R *Õ 6V91K3Àb'ûª3K³ú9·±Š³`€·q‹¢º…: pPO ÀP€8ð:p³ ?À»7 1€Ìp:ðº63@SpJÔR``-F§ÚZºÙ°M16:›·Bº=ÑÿÚŽqRòA°j}I 'pw@)¯aQà¡@S W¡S02  ¢Ûª|úœpËQ`à­«»g24Mq@vX€0À£ç¡Qbºi%p5¢7–€àÀ=`DÁx©1ÀcoཫQeß×§ u·R62Ö&‰àS0eîu@¾1Lã§1tðp&œC‰¨*Ì­Á*$}FÅ,t¾y+[00p²Aó¶ zA¾!fLЗK|ÂM,6O|À‰a@ex|@pÀŒEz1D3ÀD1º2-rmÚÿ7”)Ÿ à§pProÌÄ«JÀo«­ñ$0492{ˆWwL20 Ø%“!.ÀÁUSuCÖ¦–R»rÉuÇ)¼ÂtÜ$ ¤\£žk£§e!mé—& «6ÇËá?ò#£"ÍÛzzÐJ·çø!Ð’UwyÉ(,ÎÜÂü-ßò$Ö;`µµ3€âƒ?©ˆY”s«`pœüÌ!á¥Yq:¡ðœ½ ÏôüËŒ,Œ†æ##µÉÏUéÏJÝ AInöPÑ}Ü@©°Ñ˜Ðј - ª0Òìà2 î2<“ ‡–™ÙÏûÏ ňÿa[Ãa0@àðnðÓn0B=@=Ôsp¢! °Ô˜¡L½Ô³št ½hþ¬¨g@Ót±¯)ûbjï^3®b}dmd}Öd@, À”( /mÍ95Ö”ÝüÎ ÓX­ÕsñÍ]Æ×Eò*ÝÒu—0ÝQapY-ÐrÁ׌mÕ¶²Ò÷•Ï»YØu؉­«ÍØ­Íc‰¤f« J0mÍ=æº,Á¦Ñ æà­­p›Ú¶ØQô «p` t@ ßLÛµ½n/0…¾ÂÀ]‰Áf^l[à6Ö<ºœÜÊ i @ð6pÀ7KÝèÿÖÝw&ÉŠhøz½Þ i|j Ü7iô;‘é]*î q)@‘Ëó}f|™vþÝ#Ž €jPà~àN#Ç"õ½ß‹Ñ!ð>á^ánİj0`ÄiÜáiœááu×#) Ä®ª%Œna±"€Ì'Žâeé'nJÐà3.faãRÁl Ùãö\1Þ)¯QßÀ}–8 ‘8_ýÙo”‡w㤹bÞÙ•¸ƒêìxòê£cÿÙ¥Hb€Ç1Ù¤É+&ÎÓŠp5ªò%­kƒåúŽ~>}®žÐãˆM `@™f@PB0k  #@V ЙvB} HÐTO `ëÐ P…°¾(Ø#ê=@)€Ç• ç¬*L`>0I~Â9Ÿ+ªðøà?óh# 1ê’­†ÏHD†dHͦ‘î À>4… À”D§!AÝNDÄäeHnˆ5EKÀ0 0$0éqÞ^ÔAbX.–¹&1^0nc„=Ž>îÉ©œXæ3QA(¸f³v‚„ˆ ²S¤:- F!¤ÿBÒu>0ë¶‹t#ÐEЋTQ9nõªÀó$a²Æ> €4ð8°?ÇûÕËQH .–Ô9- hî䞎æ>f³³YÀ pÀEeêÑê{ÔOœS3—Ñ€¨q…ƒp–±Ê¼Ÿ½T? ’2Ç6>°ÒCí¹µZg /Òeÿt6%ñõ=Y~äYªa' ò@$~‰t¶ƒZ –Lê2‰b‘/ÙO à ˜^2%¡ð}dUÓ0 ]^Ç6IgkÍeÞ>P>@÷H #[~þñ.òdæ†mM;0EÿÐ$ñ5¤Zt%}dPE^¶Eð‚êAMŽ-@D P ™Ð ™À÷Kp㆜4P0€Å  Ø`€/*"Ä( ÀÆ 6~¹ÀH’%MžD™RåJ–-]¾„y2@ 6Ø€ÇF 6®0"`EV°°Á¡Ð l| !€… žzèð1fÌŸò P„Q(QãP6M:ºäpøP€L|ü ±EŽ»+æb¼ø±cHÂ[ FœX±Ê"HxP€f‚\ÐÀÀ +TlÐA£€Š½7X|PED©$€(PÿcZŸÌ(à ’ PÀ:¬X9£F ¹jР#†‘ÎÇ0ð0áö¹‚=y[üxò·tÄÃ…-P`°ÑB F™Üx‘äs}^¬`bÝªŠ€ @x «Ç xïÊ鯹òÁfà»®VXá! x… p0 ¡.r®º¹¸ Œ£ïÀ Bg¤‘$ˈ€§€{ª,˜p A) ¨A©.°Œ5 €΂ñ/«øa…Xh¬€ˆ¡ ZQ€6¸á(â»àø`€8ÀFï`´­F=÷¼m€ê<à€X „ÿ Àr˜¡È ?SJB&*Øè‚Ú@R +˪”p®$lº¬<È pxa$lXʽ ð‹xè©,h¯ !ƒAi0<©ä³XcaZ`@€„:p`PŠ˜`®Lt´†Žü …* Çø¸@J*`-F½©Ÿ6ò ‚3p@V@¿þ2‚ zàC€ à¡… .h„2u „:½sØc'¦8%NÀ"( €28€„>bl@A‡Š¢Aæ$,@+ÐÀ‚FÁ‚ €ó©§ "¨ B¶éDŒ¸Á‡ üºˆ"ÿ^Ø¢x(` œ%8$@ÀБ‚}ÆŠÏ>;ƒ&0a>8Œ!€‡f`¡€bÐD#S7º@‚t†,€¤‚’S¹JôâF¸@6èâ†.Áa‘8¸¨i&jÀ!Eƃ. ŠÆ$h ‚­¤c; mÝ`耢-á„ÞOt‚Èà„`8`- ‚€­ü² :°´Ö|†0È¿*D°.g ‚.B[äB¬ø‹…¼˜î†YD„/,øâ&Zð•Pd€ÚÝw»Càž°6 0 nHÔ\Ð1á1ÀÀp‚ÿ˜D‚$H€<€ÅÍ&Aا.’$Ô€pS©Ô Áä­[‰\Ppä¡ f€‚l@‘‡€»N%Љ2À:ˆ:M$è ´H0€8 ZpÀH’<ëdœ@¹àÙXNy"O§Jä¸'>7¹^r¢¹¼ D0ƒÌfrÄ©  GKA–ÈÄ¿<Ñ‘å”3@Æ_‘dP%ÐàH€ü*“½â$'¿ç•ð„OŽI¨c ÄÇ^,h™ je:åÞ^ð@h ˆp € ˆ0‘2€"ÙÈG6S1Èä >ÐÁ‘tÿ’N#Y(G’IBerôêbIÊb•'7ž*€°Ð, ˆA²À´Ä`>¨Á ª&0˜<øMT€€ˆÀØ@h°e.S΄¨a2 €@ ca´& ðCÑk$¸ à€Làø2€i"`Œ½âèÈ Çñ01 ppÐ$ ò|APùöÄ 60š˜œ°F9A€tUÜ`2˜KC—Q®¾€ @„D•D‚Л@JÀR”!8Ú>PR| p… à‚P1”•4%B¶Ã!=}ªpš ƒ,¬àÿWÈ‚RX`&€ HxAFB\Æ*XOD \.R«ŒìjjWr‚aþ©!(ãHÐÁ ` 8£Ü¨¸€L€yD8‹ŠÐL|}'K($ @VÓ“Ñ@'?FÐAhJ¤ƒ*Ðà—eB@H*7Û€vEÌï4àŽxRm|Oƒ]9à ¸&¡®ˆŽAÒ H , ®˜@ ì€ÐëŠj}ÖrËÓܵÀµ± ‚YƒƒÔ@9`A þ¢-ЀC1Ø1c`" •q*ÀŽFP6ðÈׯ#Q@ &€X4“Aà6 @@.ÿ™õN€(¸`­&0.Ö4YÜÌ(„(ÌÉ€„5€iN™`†‚›„$8O™RÄà{cù ƒ¢ YźÍo"àW% - ìÜ»LBÀ¤(²„eÔ\Á²¹b^Q‰äò8èÈЄN3p„µf6Û8Pšää= fù$\äâ6-éi-§ù=ÙÑS¸S¦!™‘SŠ4xtÔTB¦Òñ} ”ûiL_SPƒÒô=¬Ì°àì ~5¨Uã®9r±äJBBëXÓôÖ=6J”]MnoòW<‚Rºb >=!›Ô8§­„hKû#´–صã»íHjs¹Ûn7RMcT—rOà¶5ÿ®0Ñ0 Ö{Í&ï6ÇÖá›Ôf·!fæZû›¹;JlíPŽwÜ$i› ~6&n„„ˆD,bQ‰QЂÇ8Æ ±†5Ìœæp°…-®A6t¢¼pÂ2Ø0t¢=Y Bºd®#Œ§zØ5~É–àžb£»ãWgâÇ9Ù¶‘?±ä…ë*P‰JD"€¸CÚÓî7ü ;Üý‚‹5 HAÞõžwvŽÀïAø l@# @ bǤ…»¤ßiAºÊiu¬Wž™0Á¯»ŽÀ¯?z#ÀBèE?zÒC§g&ñ€Ó·þôÄ&LŒ½Rmk3Ò 7I,¿ÿû‡n››×#gž<ÁøÇG>ò… ×sàrhþé2l¦›ùé°Ÿï‰ÇPAì£=˜X¦ösÂ%€Â(”BXE8‚%8‚,ÔÂ-äÂ#XŽ ƒ#0 B† 2r&ôã8ÿ³«‹Â!á¸24C4l&5t(C;d"9”·3„(=d$À*ôƒC‡âÃkóÃ4DÜÄE4ÄC¬´D¬ÃÝk Ί ÞƒÄH¤ÃG"BØÃ=ø£¼$ÚªL¼1IäDËÃ> 8@ì£DR´1Säú¶sC Þ;ÁÔ¨>Y¼1ê1§V´¤û{¢\ÜE[ëEbüE`LŒÝ“ì*c¤´ÍóEWL LŒ/il+8°Ê‹:Øë©r D0”…ÃM]XÞ3ƒˆÕWsC‹±8"~KX6Sd€& ‚A¼ºÕØÉ”Ô!Qé¸pÚ§…Ú¨•ÚpZªU­Z©uÚð€ø=Ú!ðûÖ)°‰à7àKà€-Z1X¢}ÖÀ=‘m +©˜ÐÛ½õÛ¿Ý[áÀí[¾e”ÈÃÍÁeÜÈHuØOåNM™Ùq5pCB!± wu¤Æ;”ÐÀ"˜8ìKZŽÃæÂH±í“Jš !HÙPbÈDHÏØÍl¼¾ÿм H @€¾T¥Ùií¸Ô]Iò+œn5ÝÀš ØºÓ°MÕ"4%–p-h05a½ÛäU]T%ç…½Å0‡ “]€jú‹‡/I:Öåw©µUtIäEÝòÝ¿æuÝñè$ ¡H(ƒ_!ÄÌFS…]AÏ;Þk$ßå>Ö¥Üô%à±á‘@·ª¡‚¹8ÉÜÙGzÖ¦£È ”V þ_ Þ< àtœ Ü‚Õ?Õ —tyH<0¼KÐ (@¡™ª`”¸:åÝÝ6œN À:€(…¨ÀH°¥€nØ'¸1ÿÈüú8¢'8½ï4¹  €Ø!Uܸà(fÞ°õÖ>!‰.²wÐ9øBðN¸& ‚p†g Gõ4µ ¼ ã_<ñ‘ Ø´ma˜ ‰'àý[©bÙ$ß¡`•ŽKð °"mË7Š[ù»€ÐEŽU§b§ðˆH3áN¾c‚å²26ˆÛ+(°PD×QŠ pð«]ã6yVq㩞z¯‡ý>>¼`*^ÉõdÞ¼P–‘yŒpв¤–í €_‰f=iácÅ‘À$$“¢$L3`$õôåÆcòçòø1hB€øµ(ª“«s?`¾-x3ÿhNÒz„à›HÆqJX³eb#ra¥¦ƒ‘ohàh‚¶"0´Ã´V<†¦ `-A­ÙjóKÆûŽJVAí5`aÚi`ha&Hš+ ’ÉAÁÄ(ª$P€cޏa ñÖèåøÃfìÃé©^<ùé2,i62°(• ¬Ó:Ü&˜³©èì‘LêsºÞœ`“Óœ¶Þ_öj¡&à`eNÚ@mjBÔZ®Vn ’iÅ𤠀{û¶|ê” ¥ð ‰ Ö꣸£µ[ò€ˆt(×3Ø(Ò¨¦ëÇ> ì³P™hÃà¢XR™plÇk.ð267z“½ÿ÷B"!*¬›ÛP:Üjåy,UØ ! ˆp€]1Â=V׉téܧ !V·§SMÎ=ò#iŠ6„Æ”H®ÂQ @kÓ¦hå~¡‰çÕV‰N)ƶ¤$¢u4ÚàênÚÑš!%9Të> '@p'€Æ‡¹ hîlK‰só4ð³õ¶·ñX€èkÆØèRºÈÒ…’ð€`bw-ˆ(Eñb€a:@9djÀÀ ”À(WèKLà(‰KÈÎf7šùn‰Aiêa\.§ôg[“ɱdòa€œ0¹)Õ•GÝ•GÅŠ°€ty2”$8¦ÿõ2sŽRkŠB)4<˜j—h—Gø(ÛŠgõ] PÀ? ¸C£½ü. ·òXϸ€…cTû…‹T´’ Èç KÇôKÿѹ€NïÕ𦤊doMò6BYrøc^Ù5#G X:û2 r7 F5“0²±¬WR2ŸQ’€ ]ÅŒ|‘ïÞ¼Vié¿p=Ë"Øpm©8û4p–’@0ü¾aóCk:l‹¬Ë˜j# -5Zõz¹Dš¹×"ÊŒz‚ˆ œ¸ˆDZ0"AÀ¤`d¢!ÌŽc´Rg æ×ÉÔZM³˜1CËçÀÙ3“ÿ]ßdÉ }4õÃP@`LD‹ËwÙR­ èßpÍÖ Ð6D8ZÇú‹‹O Xln©Àj6Dšßy5 Ž¬TxÍŽccõ’ ¶¹£HÛ€§ Ãñ)}vr -Lj Ñ’Š h€òš=ðt;Sß‘H€ ðZÎ €Žhæ!(ˆ P¨€›±‰ƒŸè¼¸©º\‘ŸïµoñX7¬*Ù¹0YÁºÅõ†pÖxû­eÏ#˜'Ž ¡èÐ !62ZÖÈz-( p#&—øüÞ¿FüæNï| ؉ášüð®—°«x.ªH’`ÿ$0€žüM2¬?‰P€z“ŬDÄ·N[o”ÈðæWŒa±ö -à©©ËߨˆØ&ûÍÇ @<ýµk8w²QG6б ˜cÖà÷¢Ÿ¸— à% ¡œ±@À$#XÐðÁ¢Æà!Ĉ,H1±!Ä‹7rì˜ñ ¡`‘)LôÙ …‘&˜0áâDM›'\ÜLqóP <]`p0!£FJhêôé žR!!@ Aˆ¨0‚«‚*xh*A˜E<@Ð §S©:uˆÆ¥zL¨p5@Mÿ¦8@, Lµ0„„9˜±…>/R^˜wÁŽCS½÷ô^J4<°× È>p€öë ¸ah'>áø$LóF­”®Ó"Ì+7B‡-64 „‡ #­¡ðà‚‡6H(À`C‹îM X‡þz@æÎ9NP`!€ ˜S‚0eM`@ *tFYƒ q–—L´!F)ܶˆ‡!¦@zD@A ˆÀÔÁå`ÐÁˆÀ@ áBRö£Bž¸tM¡—@u.èÔUª`\ ŽMýÀÿM5eÿ}E`š ¯ ‰Ô‘)9 €ˆ)8e,¨™&‚ (,T… vB ¦%5Àå5æRraÙÂÀ ðP H€À•èqõÀA0`A0! œ9*C„>W$Àé`ˆ`«Ö-ihh±Z@q­ê%D.ˆé‘—TuðW\0•A´À£#ˆç#<Ä@gp‘„ xáƒ(ðч /ø€Ä 7xQÅ ™vT @äÀrƒšÊÔT  bÀ} ˆP /daÔE±E04ñ‚tÈÀ…&œ&€È<ñ)OP"È!‡L*É?Úq²ÿ@®@§TÑXѸeSÍÑ€ ±QôÌ"và•Æ*—º{t\Ȳ€Zh Á#P B TPÀ6üHE"ôQÀ 1ø°Â 3Ô@÷3Ø Ã3ltÑ%X¼!@wRC>5¶Ð#`P¿=t€'±/@ `’pˈXäE0~@ñ9è sP2餮E©=U ŽQÄ Œ(–PP”!°vÂÞ)ôPÄ X"Bå-Ú¥‚pJÐòHSåZSð_– ´VóÀC þJ ÀFLF™ SàƒUT± Lxqà Uà°Bÿ¹FÌз˜ø1~¯÷nt˜€žÔ”ÁQiê B£›ä„WиÆrJÙp6›S9/ØC¸ƒ2°"„ Sˆ\Z0•< ¸* ¥€`à€ 2ô`X‘<‚£9ˆòé tP+]@*ëáA*À€a@Ò‰v@XÛP€„à@9x rpƒÔÀhœ~,"œ Å™ Hâ@ ~ì#r)HäTIØ€Šà²¨XÀ€Œ*K”6©Œ HUPÔ{-ÅD¨ ¬$ÊÀ†p*CˆÊU†Ð”™ÿÈ„mz£€<H-sÊ[àˆ P€àe@ð8`_¿q€ ŒœZ;Íê)Ö Bó¨DÌ¥ ’4`P@ Ø{ «Ü`! “B6 ¡s]+ H° 6€ƒÄ I¨¬`˜"a "xÉK|’šä¤¡ÍI "*Ñp§ Z ª îpC €¶v(@ À"ð’X ,–ØÙRvÀeôÃÐØ¤¡ =ð´§zP× T8Àa¨D%*0xQˆ¥^ ©èQÕƒ€”<¿°®.l@Ö"0d†À)P>P ˜@ÿ´€£µ$€@p2”ƒTˆÄ"AODšÙGßôVé´À2¢ŠÂBd+CI™ þ˜ðàí!o8Ô‘ÞP¶²–b©$¸0 ,ˆù‹lX!©S*úYhÙ·ÿa ¨¸ƒ1ŒáuÔ¡¶¶­­(rÛˆÝîv¾ýíä!†áŠá Æý‚4Àå2WO±@Ò*l‘è@h2À<Ä$¸I˜Ö³,5`¼EZÒt5Wè(m>OÑU¾3ÝÌ6¥d€!ÀGãÒ "UàJßœK# €I¤ø)Ö|ïš %"š12:s[í|-·2—¹Q%™2¬a ŸÎ¥J}*ÿ¨^ GTŠ€u󋼿/KpŽâäaÉhëuʰ悀ØêA,Ô?`S@A¤0 !MŒS–¾È1Úá&–.p˜xÖëŠ %‘.3³P&T4ÿ¨9Kù« VàµÒÑùGJ¸³D5Ô¥nÌÝü!•gÞ4¤˜qhr”4(.Ë£fò¬óË[ó“1€.Ê€ä#ç˜Ï{Є4d! *À'tpƒ¨ ît'Åj€„SÏ?x f`„äÀ 1€§(ƒ‚2Z¨ `Õ[鲟ވ"u&UFB‚fw$!`6³#bmÿ 0.ü@ 4„@ '@@ÝÀš @^ÈÀXßM¾(`ÞÙLSöUÍÎ,€±„¢˜ ʸ‚4è@+ _ pàƒ ¸O?B¬o`ƒ¸ñS1XY jpƒP} ÂÁ²ï`™*ÛÔ>ilóòÌR4+6Š€œ %ø@HP˜à˜‰2ƒ8à&8@`4ÀxMÒéf(h™ßOI@ fp>-{ XSX€¨ mü¼.nƒ.ˆ½B÷ –#ØÀ7ÐúNƒ¨¡òp†ñ®˜јå¨aÎjM%ÂÉOÿ~Å.ŸyDð`&˜v.’LàôNJ‚ @W: ¦Ýƒa6¹6ˆù«ð_ÈÖfò pƒÉ¨ %]TD| ¨@I0BÄ»ð‡,â7Ãè|ÔE‰å€×ÇAé—¯A¡ÂÁ¿br ÍD¾ 1Cà€ùÓ¿þô7þñï ´~ÿû/ÿÁ[ ”ÀÞ|æ=Ä(@ÝŒå¤è@¸@Ô xÌP1-ÝÔ)€W ¬Þ¬žéA@ÒA^šLEëPZ’@zÚ쨅HXàÅ€`ŸtÁßÕÀŒJ†m„\ è®…ÿÊ ÁLàQÆ üHÃýÈB´ß²Y[ü)f!JüiaÖŸ½®Ù†á žŠ¡ÜÇ¡àC`a˜…ÙP ÁÁBÁF |¸Õ 4@@€¤ÀYõ@ÀÔ´[ÿŒY ×)<¶¬Ù„À0€°­YÞÑÀü XœPA¶„Ü¿ á ü[°@¨,ÞB ŸÅMaãñÊãYPd]eE„mô¢m£0 #£1¢ ¨†rJš1a8@¼4„,ÀSµžpd€´Û4Î_îÕp°†åÀTµü¥F<ÿ‡YÈ,Ö—ÒãeH¡>ŽJƒdb†Ù’Ð@B"cd“²ÊåɳʠD^³M dDL¤›]„k$E,ÝÌ.&ÚâLä:Àô¼#{ ÙB„Ê›’PFÂX)âÉ<ÚÒ,NH>*„ÅÚL²ä²9ä˜ð$Gè.# äaÄQXNç%E¶ùIJdhL„˜„ÆSäÊÑ8`€À¬¤ÍV˜]ƒ±EztɇDÄQ.#ZŠH u°JZNÝìÜ´qÒ˜4…ÌLUråŸt “œ5MnO¾%Z*È‹é•óHtÀ“Ä…aêèµÍÇÖ0X‘`œèÿ×T]*G,@uì×VFfd‚˜;ZÓ‚¬f5aᬘfä…ºI–©8U)æA¾\ >h@ƒHx|@P ìÄÐQˆ«³&XãU€«ÿ,À™Ttt¨kŸ±ë½<+­Þâ`ÀÇÜ $D Œ[¯Ökˆ¸ }%Vx4ˆÆv„k@î¾ÅW‘ ¬ÂŠþ벽á ǘ"d8Ý}ø‰ *˜w6¦·îQÈBÄÀê)N’”YºÒœÂêÊ.¬»"Í^Ä%D@dÒ©Ø.:ÇDdã0eÀÌRi"ÀÊ\ÐÍHå\$À`Ȉ¡4[<âÒ2­º¬©$Çè!æÑzT@ؘ‘‚hS˜"x@t@’lÐ}˜msF@XÍ”´§˜µíÛ:kÓæ¥ÿÿâÔmßjåá\—ñEY’|g…Ê…”<@|vÀ°\@Kèã^i‰¡è½Pnå èåÊ®®FmÞ@Ϥ.Ž&þ9îãJ€ÚÊm¬àȦ°G‘ሎ’®ÿÐníÂ-´êfŽ\W”4'¦íï­\r‚(m¤*ˆ-‚ÐÅ‚¤&ÀšŠôN/¡´¬ÓXYB¢ÐÈÊjŠ$•&t¾VÞWõF¯Ûºï~À/æJ @jv ƒ$[—îѰ(Ò, Û°£ã.B~Hk%›&»Œ«(IãéääRpÉíÚâË=o-r«ñº'´‰ilí[¶¯¿ÉG2¨IGÚÜÈdš‰Š»ÿœCf@˜ž°ûưå(" §¥ ŸÆE1|%.òboÔâ’àåšåDéXˆ€jZmŽ9 ŠÎ6§~¦EödCŒ¸én¥B€Ì?*„YœPÆŸj硃ïwf›‘û9¡$9Lc™—Ö.”¿°¦ú›:]t@zåhãN‡«¿zØŸ¬×_þå߬çÎbg:©¿¥ŠOªK°/–zV±»±;$»²/;³7»³+»X©ù®¶© ‹§Wðy©ðËmдW.§£:šOï“p·—»³UûS”T¸ƒÿúz¹aÕš{³rºº¯ïÛªfü¾¥®Ã;’W»u€;½/í¸k»¾ïú,CÄ&lB<„‚!lÂÀ7ü‘üCŒÂ2„Â;lÂ48<Æ vÁ‡1éÃ(Âf¼ÈÇr@PÔ-X¼ÊŸ°ÒZÎ)@ HûÊÏ|历´-ѼÎ#±Ä¹ ¤˜bÂî<Ñ›ôÄù+ø@œ=Óû*œ8ËÔ…ênHÛæn®´%µEÔ `”Á'C1|Â'”Aœ=ÚgÖò‰7½Ûß-.…ÖÌ=r¯fáÙ.K9ÖãVÀÔüýÔ€€à þ¸ÀôÀÞäûÛ—û[Ф¦T˜ä/Ž3ÿ—W˜èHþr@oðÏ⾟ÉEÓðµ=R9†Yœæ§~s=D ØAƒ~ƃØèGqét‘ p†áþºâÌ‹Ã~ÑÓŠ(«¨ñ¿ÈˆLÉè~› @ëSàëû~Ã?d³æ¿_ë×™†é‰çC?ÓÓÅ='Kçç+÷/>DÞ¼â+dp†)¤~^ùþù+…`PºÜBĹ“ÌCÈ?@8`Aƒ&T¸aC‡!F”8‘bC @à"Œ0r¤’'O 41¡bK—/aÆ”9sæE…%0ÀÀ€`Á€ ”P+JšD‰R%KšO¡F•:uÿªÍ„`,A¡„ƒ!\˜€`"…‰\DAªtéȦTáÆ•;w®U„ R¡å«@ˆ” BQl\À¶í[º!G–lñ#B=>À €àC†(LHQ@â4Y·%éxrkׯáÚ-8’F’$*nI’cCo>”&bCÀÕn¬„½œyó–² ¡…"@x°Â… HNIãt€téL4Xàœ}{÷¡”nAÁˆ ,˜/p!ƒà¥èa & A ( ¶Rï½!\.>‚>h  BàŒ0 i$P!€ *˜m1ã\/ÂY¤kÂ8ÿH(j(2˜ „ @Abà "H`,Å™l2ªB …ø€ Hp -‹J3BH:ÈÀ…N "¥ôTtÒÍ7+‚Š® ƒˆ˜€¶Ð¡nÀ‚ (áÌd©Ñ%áŒTRÊB<ˆ :H F` …íf0`…-`<o56i­VÖà`‰#¸m‡“G!ämÄÁ†“{8€"IÌàÀ Ð@D8H·€ µV_7±5ÿÀ_’¶­— +ê=‚¤+€é@ð^ó¤Ëw߉YÄö¸’Fψ9–.Á…ñ¥–â‘#´˜$d`,µÕ*裖Š•ä™ÛëWe”‚À£`>Hfš–°gFZb‰zëÅ9cyv™g˜ZêÉLVº­=î¸c‰§îú±ªËÙ!„P£Q„ÔÏaóX˜k¯áŽm踢ŽÛî'熫î»ù–IΩöî[ðçò¦*ðÁèo©OÜq†ªñÇ)?(r¨&¯\s.*óÍ)?@¬—´.Ý<ŒRp ôÕ3h4ÒM/½AèiõÕ?b‚Ö êyhc‡¸ÎÛ¼ôz€“)x­êaŸ 7þn1Ò}ðϞzè©Ïþ@¶Û_üðñ= éÉØoßàGà}øpàNøÛ/ª¨ø§?Wø# ¿¼/u¼C_âZ6í-°{Þ[à÷Ƨ ¶ b*Þ)½ˆ,ok/ÃàABŽ„%4á Q˜B®…-tá aCΆ5´áD;xbase-2.0.0/libtest/0000777000000000000000000000000007316217176010006 5xbase-2.0.0/libtest/Makefile.in0000644000000000000000000002264507316217175011777 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ GLINC = @GLINC@ GLLIB = @GLLIB@ LD = @LD@ LIBDL = @LIBDL@ LIBJPEG = @LIBJPEG@ LIBNSL = @LIBNSL@ LIBOBJS = @LIBOBJS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ NM = @NM@ PACKAGE = @PACKAGE@ PAMINC = @PAMINC@ PAMLIBPATHS = @PAMLIBPATHS@ PAMLIBS = @PAMLIBS@ RANLIB = @RANLIB@ TVPROGS = @TVPROGS@ VERSION = @VERSION@ XPMINC = @XPMINC@ XPMLIB = @XPMLIB@ XSUBDIRS = @XSUBDIRS@ X_INCLUDES = @X_INCLUDES@ X_LDFLAGS = @X_LDFLAGS@ doxygen = @doxygen@ topdir = @topdir@ x_includes = @x_includes@ x_libraries = @x_libraries@ INCLUDES = -I$(topdir) $(all_includes) LDADD = -L$(topdir)/xbase/.libs -lxbase INSTALL_PROGRAM = @INSTALL@ noinst_PROGRAMS = indextst exptest locktest testdate testhtml.cgi indextst_SOURCES = indextst.cpp exptest_SOURCES = exptest.cpp locktest_SOURCES = locktest.cpp testdate_SOURCES = testdate.cpp testhtml_cgi_SOURCES = testhtml.cpp noinst_HEADERS = EXTRA_DIST = makefile.g95 libtest.ide testhtml.html README MAINTAINERCLEANFILES = Makefile.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../xbase/xbconfig.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I../xbase CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ indextst_OBJECTS = indextst.o indextst_LDADD = $(LDADD) indextst_DEPENDENCIES = indextst_LDFLAGS = exptest_OBJECTS = exptest.o exptest_LDADD = $(LDADD) exptest_DEPENDENCIES = exptest_LDFLAGS = locktest_OBJECTS = locktest.o locktest_LDADD = $(LDADD) locktest_DEPENDENCIES = locktest_LDFLAGS = testdate_OBJECTS = testdate.o testdate_LDADD = $(LDADD) testdate_DEPENDENCIES = testdate_LDFLAGS = testhtml_cgi_OBJECTS = testhtml.o testhtml_cgi_LDADD = $(LDADD) testhtml_cgi_DEPENDENCIES = testhtml_cgi_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ HEADERS = $(noinst_HEADERS) DIST_COMMON = README Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(indextst_SOURCES) $(exptest_SOURCES) $(locktest_SOURCES) $(testdate_SOURCES) $(testhtml_cgi_SOURCES) OBJECTS = $(indextst_OBJECTS) $(exptest_OBJECTS) $(locktest_OBJECTS) $(testdate_OBJECTS) $(testhtml_cgi_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cpp .lo .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libtest/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstPROGRAMS: clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: indextst: $(indextst_OBJECTS) $(indextst_DEPENDENCIES) @rm -f indextst $(CXXLINK) $(indextst_LDFLAGS) $(indextst_OBJECTS) $(indextst_LDADD) $(LIBS) exptest: $(exptest_OBJECTS) $(exptest_DEPENDENCIES) @rm -f exptest $(CXXLINK) $(exptest_LDFLAGS) $(exptest_OBJECTS) $(exptest_LDADD) $(LIBS) locktest: $(locktest_OBJECTS) $(locktest_DEPENDENCIES) @rm -f locktest $(CXXLINK) $(locktest_LDFLAGS) $(locktest_OBJECTS) $(locktest_LDADD) $(LIBS) testdate: $(testdate_OBJECTS) $(testdate_DEPENDENCIES) @rm -f testdate $(CXXLINK) $(testdate_LDFLAGS) $(testdate_OBJECTS) $(testdate_LDADD) $(LIBS) testhtml.cgi: $(testhtml_cgi_OBJECTS) $(testhtml_cgi_DEPENDENCIES) @rm -f testhtml.cgi $(CXXLINK) $(testhtml_cgi_LDFLAGS) $(testhtml_cgi_OBJECTS) $(testhtml_cgi_LDADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< .cpp.lo: $(LTCXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = libtest distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done exptest.o: exptest.cpp indextst.o: indextst.cpp locktest.o: locktest.cpp testdate.o: testdate.cpp testhtml.o: testhtml.cpp info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(PROGRAMS) $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-noinstPROGRAMS distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xbase-2.0.0/libtest/README0000644000000000000000000000064707117310710010574 The libtest directory includes programs which are designed for testing the basic functionality of the library. These programs are intended to be used to find bugs in the basic library functions after enhancements/updates or fixes have been applied to the library. indextst - used for testing indices exptest - used for testing the expression logic locktest - used for the debugging og the record and file locking logic xbase-2.0.0/libtest/Makefile.am0000644000000000000000000000072407203046227011751 INCLUDES= -I$(topdir) $(all_includes) LDADD = -L$(topdir)/xbase/.libs -lxbase INSTALL_PROGRAM = @INSTALL@ noinst_PROGRAMS = indextst exptest locktest testdate testhtml.cgi indextst_SOURCES = indextst.cpp exptest_SOURCES = exptest.cpp locktest_SOURCES = locktest.cpp testdate_SOURCES = testdate.cpp testhtml_cgi_SOURCES = testhtml.cpp noinst_HEADERS = EXTRA_DIST = \ makefile.g95 \ libtest.ide \ testhtml.html \ README MAINTAINERCLEANFILES = Makefile.in xbase-2.0.0/libtest/indextst.cpp0000644000000000000000000001726107203052507012265 /* indextst.cpp Xbase project source code This program creates a sample database and multiple indices. It tests the index logic. Copyright (C) 1997 StarTech, Gary A. Kunkel email - xbase@startech.keller.tx.us www - http://www.startech.keller.tx.us/xbase.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 11/29/98 - Version 1.8 upgrade */ #include /* set the stack large for dos compiles */ #ifdef __XBDOS #include extern unsigned _stklen = 100000; #endif int CheckIndex( #ifdef XB_INDEX_NDX xbNdx *indx1, xbNdx *indx2, xbNdx *indx3 #endif #if defined( XB_INDEX_NDX ) && defined ( XB_INDEX_NTX ) , #endif #ifdef XB_INDEX_NTX xbNtx *intx1, xbNtx *intx2, xbNtx *intx3 #endif ); int main() { xbShort f1, f2, f3, rc, sts = 0; char charbuf[10]; xbSchema MyRecord[] = { { "CHARFLD1", XB_CHAR_FLD, 6, 0 }, { "CHARFLD2", XB_CHAR_FLD, 6, 0 }, { "NUMFLD1", XB_NUMERIC_FLD, 6, 0 }, { "",0,0,0 } }; /* define the classes */ xbXBase x; /* initialize xbase */ xbDbf MyFile( &x ); /* class for table */ #ifdef XB_INDEX_NDX xbNdx indx1( &MyFile ); /* class for ndx index 1 */ xbNdx indx2( &MyFile ); /* class for ndx index 2 */ xbNdx indx3( &MyFile ); /* class for ndx index 3 */ #endif #ifdef XB_INDEX_NTX xbNtx intx1( &MyFile ); /* class for ntx index 1 */ xbNtx intx2( &MyFile ); /* class for ntx index 2 */ xbNtx intx3( &MyFile ); /* class for ntx index 3 */ #endif #ifndef XBASE_DEBUG cout << "XBASE_DEBUG support option not compiled into library"; return 1; #endif cout << "Creating test database and indices" << endl; if(( rc = MyFile.CreateDatabase( "IXTEST.DBF", MyRecord, XB_OVERLAY )) != XB_NO_ERROR ) cout << "Error creating database = " << rc << "\n"; else { #ifdef XB_INDEX_NDX if(( rc = indx1.CreateIndex( "IXNDX1.NDX", "CHARFLD1", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) { cout << "Error creating index 1 = " << rc << endl; exit( 1 ); } if(( rc = indx2.CreateIndex( "IXNDX2.NDX", "CHARFLD1+CHARFLD2", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) { cout << "Error creating index 2 = " << rc << endl; exit( 1 ); } if(( rc = indx3.CreateIndex( "IXNDX3.NDX", "NUMFLD1", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) { cout << "Error creating index 3 = " << rc << endl; exit( 1 ); } #endif #ifdef XB_INDEX_NTX if(( rc = intx1.CreateIndex( "IXNTX1.NTX", "CHARFLD1", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) { cout << "Error creating index 4 = " << rc << endl; exit( 1 ); } if(( rc = intx2.CreateIndex( "IXNTX2.NTX", "CHARFLD1+CHARFLD2", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) { cout << "Error creating index 5 = " << rc << endl; exit( 1 ); } if(( rc = intx3.CreateIndex( "IXNTX3.NTX", "NUMFLD1", XB_NOT_UNIQUE, XB_OVERLAY )) != XB_NO_ERROR ) { cout << "Error creating index 6 = " << rc << endl; exit( 1 ); } #endif } f1 = MyFile.GetFieldNo( "CHARFLD1" ); f2 = MyFile.GetFieldNo( "CHARFLD2" ); f3 = MyFile.GetFieldNo( "NUMFLD1" ); cout << "Populating database and indices with data" << endl; cout << "."; cout.flush(); for( int i = 0; i < 10000; i++ ){ if (i % 1000 == 0) { cout << "."; cout.flush(); } memset( charbuf, 0x00, 10 ); sprintf( charbuf, "%d", i ); MyFile.BlankRecord(); MyFile.PutField( f1, charbuf ); MyFile.PutField( f2, charbuf ); MyFile.PutLongField( f3, i ); MyFile.AppendRecord(); } cout << " Done." << endl; // Check all indices. sts += CheckIndex( #ifdef XB_INDEX_NDX &indx1, &indx2, &indx3 #endif #if defined( XB_INDEX_NDX ) && defined( XB_INDEX_NTX ) , #endif #ifdef XB_INDEX_NTX &intx1, &intx2, &intx3 #endif ); // // Appending a "Z" to the records will cause the index delete // functions to be used. // // - Bob Cotton // cout << "Reversing records." << endl; cout << "."; cout.flush(); for( xbLong j = 1; j < MyFile.NoOfRecords(); j++ ){ if (j % 1000 == 0) { cout << "."; cout.flush(); } MyFile.GetRecord(j); memset( charbuf, 0x00, 10 ); sprintf( charbuf, "Z%d", (int)j-1 ); MyFile.PutField( f1, charbuf ); MyFile.PutField( f2, charbuf ); MyFile.PutLongField( f3, j-1 ); MyFile.PutRecord(); } cout << " Done." << endl; // Check all indices sts += CheckIndex( #ifdef XB_INDEX_NDX &indx1, &indx2, &indx3 #endif #if defined( XB_INDEX_NDX ) && defined( XB_INDEX_NTX ) , #endif #ifdef XB_INDEX_NTX &intx1, &intx2, &intx3 #endif ); cout << "Index testing completed" << endl;cout.flush(); MyFile.CloseDatabase(); /* Close database and associated indexes */ return sts; } int CheckIndex( #ifdef XB_INDEX_NDX xbNdx *indx1, xbNdx *indx2, xbNdx *indx3 #endif #if defined( XB_INDEX_NDX ) && defined( XB_INDEX_NTX ) , #endif #ifdef XB_INDEX_NTX xbNtx *intx1, xbNtx *intx2, xbNtx *intx3 #endif ) { int rc; int sts = 0; #if defined( XB_INDEX_NDX ) && defined( XBASE_DEBUG ) cout << "Testing NDX index 1 "; cout.flush(); if(( rc = indx1->CheckIndexIntegrity(0)) != XB_NO_ERROR ){ cout << "Error " << rc << " with index indx1" << endl; sts++; } else cout << "OK" << endl; cout << "Testing NDX index 2 ";cout.flush(); if(( rc = indx2->CheckIndexIntegrity(0)) != XB_NO_ERROR ){ cout << "Error " << rc << " with index indx2" << endl; sts++; } else cout << "OK" << endl; cout << "Testing NDX index 3 ";cout.flush(); if(( rc = indx3->CheckIndexIntegrity(0)) != XB_NO_ERROR ){ cout << "Error " << rc << " with index indx3" << endl; sts++; } else cout << "OK" << endl; #endif #if defined( XB_INDEX_NTX ) && defined( XBASE_DEBUG ) cout << "Testing NTX index 1 ";cout.flush(); if(( rc = intx1->CheckIndexIntegrity(0)) != XB_NO_ERROR ){ cout << "Error " << rc << " with index intx1" << endl; sts++; } else cout << "OK" << endl; cout << "Testing NTX index 2 ";cout.flush(); if(( rc = intx2->CheckIndexIntegrity(0)) != XB_NO_ERROR ){ cout << "Error " << rc << " with index intx2" << endl; sts++; } else cout << "OK" << endl; cout << "Testing NTX index 3 ";cout.flush(); if(( rc = intx3->CheckIndexIntegrity(0)) != XB_NO_ERROR ){ cout << "Error " << rc << " with index intx3" << endl; sts++; } else cout << "OK" << endl; #endif return sts; } xbase-2.0.0/libtest/exptest.cpp0000644000000000000000000002054007202070764012115 /* exptest.cpp Xbase project source code This program tests the Xbase expression logic Copyright (C) 1997 StarTech, Gary A. Kunkel email - xbase@startech.keller.tx.us www - http://www.startech.keller.tx.us/xbase.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. V 1.8 4/29/99 - Initial creation of this program */ #include "xbase/xbase.h" class ExpTestor{ public: ExpTestor( xbDbf * ); xbShort TestExpression( const char * TestExpression, const char * ExpectedResult ); xbShort TestExpression( const char * TestExpression, const xbDouble ExpectedResult ); private: xbDbf *dbfPtr; }; /**************************************************************************/ ExpTestor::ExpTestor( xbDbf *dp ) { dbfPtr = dp; } /**************************************************************************/ xbShort ExpTestor::TestExpression( const char * Expression, const xbDouble ExpectedResult ) { xbExpNode * e; xbShort rc = 0; if(( rc = dbfPtr->xbase->ParseExpression( Expression, dbfPtr )) != 0 ){ cout << "Parse Error " << rc << " in expression " << Expression << endl; return 1; } e = dbfPtr->xbase->GetExpressionHandle(); // cout << "********************************" << endl << "Expression: " << Expression << endl; // dbfPtr->xbase->DumpExpressionTree( e ); if(( rc = dbfPtr->xbase->ProcessExpression(e)) != 0 ){ cout << "Error " << rc << " processing expression " << Expression << endl; return 1; } char type = dbfPtr->xbase->GetExpressionResultType(e); if( type != 'N' && type != 'L' ){ cout << "Expression " << Expression; cout << " Expected result type Numeric or Logical, actual was "; cout << type << endl; return 1; } // if( type == 'N' && ExpectedResult != dbfPtr->xbase->GetDoub()){ // cout << "Expression " << Expression; // cout << " Actual result of " << dbfPtr->xbase->GetDoub() << " does not match "; // cout << " expected result of " << ExpectedResult << endl; // return 1; // } // if( type == 'L' && ExpectedResult != (xbDouble) dbfPtr->xbase->GetInt()){ // cout << "Expression " << Expression; // cout << " Actual result of " << dbfPtr->xbase->GetInt() << " does not match "; // cout << " expected result of " << ExpectedResult << endl; // return 1; // } cout << "Expression " << Expression << " returned " << ExpectedResult; cout << " OK" << endl; return 0; } /**************************************************************************/ xbShort ExpTestor::TestExpression( const char * Expression, const char * ExpectedResult ) { xbExpNode * e; xbShort rc = 0; // char temp[5]; if(( rc = dbfPtr->xbase->ParseExpression( Expression, dbfPtr )) != 0 ){ cout << "Parse Error " << rc << " in expression " << Expression << endl; return 1; } e = dbfPtr->xbase->GetExpressionHandle(); // cout << "**********************************" << endl << "Expression: " << Expression << endl; // dbfPtr->xbase->DumpExpressionTree( e ); // cin >> temp; if(( rc = dbfPtr->xbase->ProcessExpression(e)) != 0 ){ cout << "Error " << rc << " processing expression " << Expression << endl; return 1; } char type = dbfPtr->xbase->GetExpressionResultType(e); if( type != 'C' ){ cout << "Expression " << Expression; cout << " Expected result type Character, actual was " << type << endl; return 1; } // if( strlen( ExpectedResult ) != strlen( dbfPtr->xbase->GetCharResult())){ // cout << "Expression " << Expression; // cout << " result length of " << strlen( dbfPtr->xbase->GetCharResult()) << // " different than expected of " << strlen( ExpectedResult ) << endl; // cout << "Calculated result =" << dbfPtr->xbase->GetCharResult() << "<" << endl; // return 1; // } /* if( strcmp( ExpectedResult, dbfPtr->xbase->GetCharResult())){ cout << "Expression " << Expression; cout << " Actual result of " << dbfPtr->xbase->GetCharResult() << " does not match "; cout << " expected result of " << ExpectedResult << endl; return 1; } */ cout << "Expression " << Expression << " returned " << ExpectedResult; cout << " OK" << endl; return 0; } /*************************************************************************/ main() { xbSchema MyRecord[] = { { "FLOAT1", XB_FLOAT_FLD, 9, 2 }, { "", 0, 0, 0 }, }; xbXBase x; xbDbf d( &x ); d.CreateDatabase( "TEST", MyRecord, XB_OVERLAY ); d.PutFloatField( "FLOAT1", 5 ); cout << "XBase Expression testor program.." << endl; cout << "This program test the XBase expression logic." << endl; ExpTestor * e = new ExpTestor(&d); e->TestExpression( "(25-3+2)*2", 48 ); e->TestExpression( "(25+3+2)*2", 60 ); /* test functions which return a character value result */ e->TestExpression( "CDOW( \"20000101\" )", "Saturday " ); e->TestExpression( "CHR( 101 )", "e" ); e->TestExpression( "CMONTH( \"20000101\" )", "January " ); e->TestExpression( "DATE()", x.DATE() ); e->TestExpression( "DTOC( \"20000101\" )", "01/01/00" ); e->TestExpression( "DTOS( \"20000101\" )", "20000101" ); e->TestExpression( "LEFT( \"STRING\", 3 )", "STR" ); e->TestExpression( "LTRIM( \" xxxxxx\" )", "xxxxxx" ); e->TestExpression( "LOWER( \"AAAA\" )", "aaaa" ); // RECNO is broken // e->TestExpression( "RECNO( 1 )", "o" ); e->TestExpression( "REPLICATE( \"abc\", 3 )", "abcabcabc" ); e->TestExpression( "RTRIM( \"zzz \" )", "zzz" ); e->TestExpression( "RTRIM( \"zzz \" )+\"qqq\"", "zzzqqq" ); e->TestExpression( "SPACE( 3 )", " " ); e->TestExpression( "STR( \"ccc\" )", "ccc " ); e->TestExpression( "STR( \"ccc\", 3 )", "ccc" ); e->TestExpression( "STR( -52.345 )", "-52.345 " ); e->TestExpression( "STR( -52.345, 3 )", "-52.345" ); e->TestExpression( "STR( 52.34, 4, 1 )", "52.3" ); // not sure what the STRZERO function is supposed to do /* e->TestExpression( "STRZERO( \"aaa\" )", "not sure" ); e->TestExpression( "STRZERO( \"aaa\", 3, 3, )", "??" ); e->TestExpression( "STRZERO( 22 )", "not sure" ); e->TestExpression( "STRZERO( 22, 3 )", "not sure" ); e->TestExpression( "STRZERO( 2, 3, 3 )", "not sure" ); e->TestExpression( "STRZERO( \"ddd\", 4, 6 ), "not sure" ); */ e->TestExpression( "TRIM( \"aaa \" )", "aaa" ); e->TestExpression( "UPPER( \"abcde\" )", "ABCDE" ); /* functions returning double values */ e->TestExpression( "ABS( -222 )", 222 ); // next two lines generate invalid error messages - FIX ME */ e->TestExpression( "EXP( 1 )", (xbDouble) 2.7182800 ); e->TestExpression( "LOG( 2 )", (xbDouble) 0.69314700 ); e->TestExpression( "MAX( 10, 27 )", 27 ); e->TestExpression( "MIN( 10, 5 )", 5 ); e->TestExpression( "SQRT( 9 )", 3 ); /* functions returning long values */ e->TestExpression( "ASC( \"A\" )", 'A' ); e->TestExpression( "AT( \"BC\", \"ABCD\" )", 2 ); e->TestExpression( "DAY( 20000101 )", 1 ); // next function doesn't work // e->TestExpression( "DESCEND( \"A\" )", 1 ); e->TestExpression( "DOW( 20000101 )", 6 ); e->TestExpression( "INT( 621.5 )", 621 ); e->TestExpression( "ISALPHA( \"A\" )", 1 ); e->TestExpression( "ISLOWER( \"a\" )", 1 ); e->TestExpression( "ISUPPER( \"A\" )", 1 ); e->TestExpression( "LEN( \"AAAAA\" )", 5 ); e->TestExpression( "MONTH( 20000101 )", 1 ); e->TestExpression( "VAL( \"ABC\" )", 65 ); e->TestExpression( "YEAR( \"20000101\" )", 2000 ); // e->TestExpression( "(25-3+2)*2", 48 ); e->TestExpression( "TEST->FLOAT1+1", 6 ); e->TestExpression( "TEST->FLOAT1 + 1", 6 ); e->TestExpression( "FLOAT1+1", 6 ); e->TestExpression( "FLOAT1 + 1", 6 ); e->TestExpression( "TEST->FLOAT1 < 1", (xbDouble) 0 ); e->TestExpression( "TEST->FLOAT1 > 1", (xbDouble) 1 ); } xbase-2.0.0/libtest/locktest.cpp0000644000000000000000000000175607203043261012252 /* $Id: locktest.cpp,v 1.4 2000/11/10 19:04:17 dbryson Exp $ this debugging program tests Xbase locking functions */ #include "xbase/xbase.h" #include #include int main(int, char**) { #if 0 // FIXME - seriously #ifdef XB_LOCKING_ON xbShort rc; if(2!=ac){ cout << "\nUsage: locktest filename\n"; return 1; } if(( rc = d.OpenDatabase( av[1] )) != XB_NO_ERROR ) { cout << "\nError " << rc << " opening file " << av[1] << endl; exit(0); } xbXBase x; xbDbf d( &x ); cout << "\nGoing to lock database..." << endl; rc = d.LockDatabase( F_SETLKW, F_WRLCK, 1L ); if ( rc == -1 ){ perror("Lock Error"); return 2; } cout << "Database locked\n\nEnter a keystroke to release lock\n"; char xx[4]; cin >> xx; rc = d.LockDatabase( F_SETLK, F_UNLCK, 1L ); cout << "Unlock database rc = " << rc << "\n"; d.CloseDatabase(); #else cout << "\nXB_LOCKING_ON is not compiled in\n"; #endif #endif return 0; } xbase-2.0.0/libtest/testdate.cpp0000644000000000000000000001603007203046004012224 /* $Id: testdate.cpp,v 1.1 2000/11/10 19:27:00 dbryson Exp $ Xbase project source code This program tests the xdate routines Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.0 10/10/97 - Initial release of software V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support V 1.8 11/29/98 - Version 1.8 upgrade V 1.9 7/10/99 - CPP ified the date class This program tests and demonstrates usage of the various xbDate methods Several of the tests pass either StringDate or Chardate to the method being tested - this is done to test the class methods. In actual usage, this may not be necessary due to the instance of the class already containing a date value. */ #include int main() { xbString StringDate( "19601007" ); /* oct 7 1960 */ char CharDate[9] = "19611109"; /* nov 9 1961 */ xbDate d1; /* today is default */ xbDate d2( StringDate ); /* from string data */ xbDate d3( CharDate ); /* from char data */ xbDate d4; /* another date class */ cout << "This program tests the XDATE routines" << endl; cout << "Date 1 (Sysdate) is " << d1.GetDate() << endl; cout << "Date 2 (StringDate) is " << d2.GetDate() << endl; cout << "Date 3 (CharDate) is " << d3.GetDate() << endl; cout << "This year is " << d1.YearOf() << endl; cout << "Year of xbString Date is " << d2.YearOf( StringDate ) << endl; cout << "Year of char Date is " << d3.YearOf( CharDate ) << endl; cout << "This Month is " << d1.MonthOf() << endl; cout << "Month of xbString Date is " << d2.MonthOf( StringDate ) << endl; cout << "Month of char Date is " << d3.MonthOf( CharDate ) << endl; cout << "Today is day " << d1.DayOf( XB_FMT_WEEK ) << " of the week" << endl; cout << "StringDate is day " << d2.DayOf( XB_FMT_MONTH, StringDate ) << " of the month" << endl; cout << "CharDate is day " << d3.DayOf( XB_FMT_YEAR, CharDate ) << " of the year" << endl; if( d1.IsLeapYear()) cout << "This is a leapyear" << endl; else cout << "This is not a leap year." << endl; if( d2.IsLeapYear( StringDate )) cout << "StringDate is a leapyear" << endl; else cout << "StringDate is not a leap year." << endl; if( d3.IsLeapYear( CharDate )) cout << "CharDate is a leapyear" << endl; else cout << "CharDate is not a leap year." << endl; cout << "Today is " << d1.Sysdate() << endl; if( d1.DateIsValid( "19951301" )) cout << "19951301 is a valid date" << endl; else cout << "19951301 is not a valid date" << endl; if( d1.DateIsValid( "19920229" )) cout << "19920229 is a valid date" << endl; else cout << "19920229 is not a valid date" << endl; if( d2.DateIsValid( StringDate )) cout << StringDate << " is a valid date" << endl; else cout << StringDate << " is not a valid date" << endl; cout << "Today's Julian date " << d1.JulianDays() << endl; cout << "StringDate Julian date " << d2.JulianDays( StringDate ) << endl; cout << "There are " << ( d1.JulianDays( "19951101" ) - d1.JulianDays( "19951001" )) << " days between 10/1/95 and 11/1/95." << endl; cout << "Todays Julian date (Number of days since Jan 1 0100):" << d1.JulianDays() << endl; d4 = d1; // set d4 class = to sysdate cout << "Object d4 initialized to " << d4.GetDate() << endl; cout << "This should be todays date: " << d4.JulToDate8(d4.JulianDays()) << endl; cout << "In 7 days it will be " << d4.JulToDate8(d4.JulianDays() + 7L ) << endl; cout << "Today is " << d1.CharDayOf() << endl; cout << "StringDate day is " << d2.CharDayOf( StringDate ) << endl; cout << "This month is " << d1.CharMonthOf() << endl; cout << "StringDate month is " << d2.CharMonthOf() << endl; /* various format routines using different formats, strings and chars */ xbString xbStFmt( "MM/DD/YY" ); cout << "Format (YYDDD) " << d1.FormatDate( "YYDDD" ) << endl; cout << "Format (MM/DD/YY) " << d1.FormatDate( xbStFmt ) << endl; xbStFmt = "DD/MM/YY"; cout << "Format (DD/MM/YY) " << d1.FormatDate(xbStFmt, "19730110") << endl; cout << "Format (MMMM DD,YYYY) " << d1.FormatDate( "MMMM DD,YYYY", d1.GetDate()) << endl; xbStFmt = "DDDD, MMMM DD YYYY"; cout << "Format (DDDD, MMMM DD YYYY) " << d2.FormatDate( xbStFmt, d2.GetDate()) << endl; cout << "Last day this month " << d1.LastDayOfMonth() << endl; cout << "Last day of month for StringDate is " << d2.LastDayOfMonth( d2.GetDate()) << endl; cout << "Overloaded operators test..." << endl; if( d1 == d2 ) cout << d1.GetDate() << " is equal to " << d2.GetDate() << endl; else cout << d1.GetDate() << " is not equal to " << d2.GetDate() << endl; if( d1 != d3 ) cout << d1.GetDate() << " is not equal to " << d3.GetDate() << endl; else cout << d1.GetDate() << " is equal to " << d3.GetDate() << endl; if( d1 < d2 ) cout << d1.GetDate() << " is less than " << d2.GetDate() << endl; else cout << d1.GetDate() << " is not less than " << d2.GetDate() << endl; if( d1 > d2 ) cout << d1.GetDate() << " is greater than " << d2.GetDate() << endl; else cout << d1.GetDate() << " is not greater than " << d2.GetDate() << endl; if( d1 <= d2 ) cout << d1.GetDate() << " is less than or equal to " << d2.GetDate() << endl; else cout << d1.GetDate() << " is not less than or equal to " << d2.GetDate() << endl; if( d1 >= d2 ) cout << d1.GetDate() << " is greater than or equal to " << d2.GetDate() << endl; else cout << d1.GetDate() << " is not greater than or equal to " << d2.GetDate() << endl; d1.Sysdate(); d1++; cout << "Tomorrow is " << d1.GetDate() << endl; d1-=2; cout << "Yesterday was " << d1.GetDate() << endl; cout << "There are " << d1 - d2 << " days between " << d1.GetDate() << " and " << d2.GetDate() << endl; return 0; } xbase-2.0.0/libtest/testhtml.cpp0000644000000000000000000001344507203046004012262 /* $Id: testhtml.cpp,v 1.1 2000/11/10 19:27:00 dbryson Exp $ Xbase project source code This sample program demonstrates the use of the HTML class Copyright (C) 1997 StarTech, Gary A. Kunkel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Mail: Technology Associates, Inc. XBase Project 1455 Deming Way #11 Sparks, NV 89434 USA Email: xbase@techass.com Website: xdb.sourceforge.net V 1.2 11/20/97 - Initial creation of program V 1.5 1/2/98 - Added memo field support V 1.6a 5/1/98 - Added expression support */ #define HTML_PAGE #include int main() { #ifdef XB_HTML xbLong cnt; xbHtml Page; #ifdef HTML_PAGE Page.StartHtmlPage( "Test Web Page Here" ); #else Page.StartTextPage(); #endif if( Page.PostMethod()) { Page.PrintHtml( "Post Method Used" ); Page.NewLine(); } else if( Page.GetMethod()) { Page.PrintHtml( "Get Method Used" ); Page.NewLine(); } else { Page.PrintHtml( "No Get Method or Post Method used" ); Page.NewLine(); } Page.ItalicOn(); Page.PrintHtml( "Sample Italic Data" ); Page.NewLine(); Page.ItalicOff(); Page.BoldOn(); Page.PrintHtml( "Sample Bold Data" ); Page.NewLine(); Page.BoldOff(); Page.HeaderOn( 1 ); Page.PrintHtml( "Sample Header Level 1" ); Page.NewLine(); Page.HeaderOff( 1 ); Page.HeaderOn( 2 ); Page.PrintHtml( "Sample Header Level 2" ); Page.NewLine(); Page.HeaderOff( 2 ); Page.HeaderOn( 3 ); Page.PrintHtml( "Sample Header Level 3" ); Page.NewLine(); Page.HeaderOff( 3 ); Page.HeaderOn( 4 ); Page.PrintHtml( "Sample Header Level 4" ); Page.NewLine(); Page.HeaderOff( 4 ); Page.HeaderOn( 5 ); Page.PrintHtml( "Sample Header Level 5" ); Page.NewLine(); Page.HeaderOff( 5 ); Page.HeaderOn( 6 ); Page.PrintHtml( "Sample Header Level 6" ); Page.NewLine(); Page.HeaderOff( 6 ); Page.EmphasizeOn(); Page.PrintHtml( "Sample Emphasize Data" ); Page.NewLine(); Page.EmphasizeOff(); Page.Bullet(); Page.PrintHtml( "Bullet # 1" ); Page.Bullet(); Page.PrintHtml( "Bullet # 2" ); Page.Bullet(); Page.PrintHtml( "Bullet # 3" ); Page.NewLine(); Page.NewLine(); cnt = Page.Tally( "count.dat" ); Page.PrintHtml( "This Page has been accessed " ); Page.PrintHtml( cnt ); Page.PrintHtml( " times.\n" ); Page.NewLine(); Page.PrintHtml( "\n
    Auth Type: " ); Page.PrintHtml( Page.GetEnv( "AUTH_TYPE" )); Page.PrintHtml( "\n
    Content Length: " ); Page.PrintHtml( Page.GetEnv( "CONTENT_LENGTH" )); Page.PrintHtml( "\n
    Content Type: " ); Page.PrintHtml( Page.GetEnv( "CONTENT_TYPE" )); Page.PrintHtml( "\n
    HTTP Request Method: " ); Page.PrintHtml( Page.GetEnv( "HTTP_REQUEST_METHOD" )); Page.PrintHtml( "\n
    Query String: " ); Page.PrintHtml( Page.GetEnv( "QUERY_STRING" )); Page.PrintHtml( "\n
    Remote Addr: " ); Page.PrintHtml( Page.GetEnv( "REMOTE_ADDR" )); Page.PrintHtml( "\n
    Remote Host: " ); Page.PrintHtml( Page.GetEnv( "REMOTE_HOST" )); Page.PrintHtml( "\n
    HTTP Remote User: " ); Page.PrintHtml( Page.GetEnv( "REMOTE_USER" )); Page.PrintHtml( "\n
    Script Filename: " ); Page.PrintHtml( Page.GetEnv( "SCRIPT_FILENAME" )); Page.PrintHtml( "\n
    Script Name: " ); Page.PrintHtml( Page.GetEnv( "SCRIPT_NAME" )); Page.PrintHtml( "\n
    Server Port: " ); Page.PrintHtml( Page.GetEnv( "SERVER_PORT" )); Page.PrintHtml( "\n
    Server Protocol: " ); Page.PrintHtml( Page.GetEnv( "SERVER_PROTOCOL" )); Page.PrintHtml( "\n
    Script Path: " ); Page.PrintHtml( Page.GetEnv( "SCRIPT_PATH" )); Page.PrintHtml( "\n
    CGI stdin: " ); Page.PrintHtml( Page.GetEnv( "CGI_STDIN" )); Page.PrintHtml( "\n
    CGI stdout: " ); Page.PrintHtml( Page.GetEnv( "CGI_STDOUT" )); Page.PrintHtml( "\n
    CGI stderr: " ); Page.PrintHtml( Page.GetEnv( "CGI_STDERR" )); Page.PrintHtml( "\n
    HTTP User Agent: " ); Page.PrintHtml( Page.GetEnv( "HTTP_USER_AGENT" )); Page.PrintHtml( "\n
    HTTP Content Length: " ); Page.PrintHtml( Page.GetEnv( "HTTP_CONTENT_LENGTH" )); Page.PrintHtml( "\n
    HTTP Accept: " ); Page.PrintHtml( Page.GetEnv( "HTTP_ACCEPT" )); Page.PrintHtml( "\n
    HTTP Host: " ); Page.PrintHtml( Page.GetEnv( "HTTP_HOST" )); Page.PrintHtml( "\n
    Request Method: " ); Page.PrintHtml( Page.GetEnv( "REQUEST_METHOD" )); Page.NewLine(); Page.NewLine(); Page.PrintHtml( "\n
    Dump Array..." ); Page.DumpArray(); Page.NewLine(); Page.NewLine(); Page.PrintHtml( "\n
    Retrieve Data by Field.." ); /* one way to get the data from a field - field1 */ Page.PrintHtml( "\n
    Field1 = " ); Page.PrintHtml( Page.GetDataForField( "field1" )); /* another way to get the data from a field - field2 */ Page.PrintHtml( "\n
    Field2 = " ); Page.PrintHtml( Page.GetData( Page.GetArrayNo( "field2" ))); Page.NewLine(); Page.EndHtmlPage(); return 0; #else cout << "\nXB_HTML is not compiled in\n"; #endif return 0; } xbase-2.0.0/libtest/makefile.g950000644000000000000000000000401307203052441012006 # This file is part of the XBase libraries # Copyright (C) 2000 Derry Bryson # # # 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. # # This library 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 License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact: # # Mail: # # Technology Associates, Inc. # XBase Project # 1455 Deming Way #11 # Sparks, NV 89434 # USA # # Email: # # xbase@techass.com # # See our website at: # # xdb.sourceforge.net # # Mingw32/Cygwin make file CPPFLAGS = -I.. # uncomment the following to generate debug code #DEBUG = -g # Note, if linking to the dll, you need to define XBUSINGDLL CXXFLAGS = -O2 $(DEBUG) -DXBUSINGDLL --pipe -Wall -fvtable-thunks #CXXFLAGS = -O2 $(DEBUG) -Wall --pipe -fvtable-thunks CFLAGS = -02 $(DEBUG) -DXBUSINGDLL -Wall --pipe #CFLAGS = -02 $(DEBUG) -Wall --pipe LDFLAGS = -L../xbase LIBS = -lxbasedll -lstdc++ #LIBS = -lxbase all : exptest.exe indextst.exe locktest.exe testdate.exe testhtml.exe exptest.exe : exptest.o $(CXX) -o $@ $(CXXFLAGS) exptest.o $(LDFLAGS) $(LIBS) indextst.exe : indextst.o $(CXX) -o $@ $(CXXFLAGS) indextst.o $(LDFLAGS) $(LIBS) locktest.exe : locktest.o $(CXX) -o $@ $(CXXFLAGS) locktest.o $(LDFLAGS) $(LIBS) testdate.exe : testdate.o $(CXX) -o $@ $(CXXFLAGS) testdate.o $(LDFLAGS) $(LIBS) testhtml.exe : testhtml.o $(CXX) -o $@ $(CXXFLAGS) testhtml.o $(LDFLAGS) $(LIBS) clean : -rm *.o *.exe xbase-2.0.0/libtest/libtest.ide0000644000000000000000000013467207203052052012051 Borland C++ Project File ²º¾úÎZ´`b,ž/^,@Œkßà)Ü ÉÊîî²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõ÷øùúûüýþÿ                         °±      ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ • ˜ ™  – š › œ  ž öŸ èŽ$ AppE&xpert...莰DoDoèŽ ±libtest˜è޲.莳.def莴.rtf莵 .ha莶.hrc获.rhI莸.inc莹.asi莺.obj莻.lib莼.resèŽ(½StripAutoDependsèŽ,¾Remove &AutoDependsèŽ@¿)Remove all [AutoDepend] nodes from a nodeèŽÀ.cppèŽÁ.rcSèŽÂ.exeèŽÃ.dllèŽÄ.c¬èŽÅ.casèŽ$Æ &C CompiležèŽÇ.asmèŽ$Èž AppExpertDllèŽÉ$TASMèŽ Ê$IMPLIB~èŽ<Ë"$NOSWAP $CAP MSG(HC312MSG) $EDNAMEèŽÌ.hlpèŽÍ.hpjèŽ Î cpp/cpp32èŽ\ÏD$NOSWAP $CAP MSG(BORL2MSG) +$RSP(-I$INC -D1;$DEF -o$OUTNAME) $EDNAMEèŽÐ.i”èŽÑ$ARGSèŽ ÒV$EDNAME†èŽÓ.kb~èŽÔ.dlgèŽÕ.txtèŽÖ.sppèŽ(×AppExpertDll.cXèŽ4Ø$SAVE ALL $TD $EXENAME $ARGNèŽ(Ù&Turbo DebuggerAèŽ<Ú%Turbo Debugger on current target nodeèŽ,Û$TD -l $EXENAME $ARGèŽÜb.exeèŽ4Ý-m"goto_line $LINE" $EDNAMEèŽ Þ$OUTNAMEèŽ ßgrep.comèŽLà3-n+ $NOSWAP$CAP MSG(GREP2MSG)$PROMPT void $SELNODES×èŽ áws32.exeèŽ â OwlCovertèŽ$ã owlcvt.exe´èŽ(äConvertOWL1SourceèŽLå3+$RSP($OWLCVT) $SELNODES $CAP MSG(BORL2MSG) $NOSWAP¡èŽLæ4Convert currently selected nodes from OWL 1 to OWL 2èŽ$ç regist32.exeèŽ,è$TARGET -RegServerrèŽDé,Register the current target as an OLE serverèŽ,ê$TARGET -UnregServerèŽ0ë&Unregister OLE ServerKèŽHì.Unregister the current target as an OLE server?èŽí.prjèŽ$î RunScriptFileèŽ,ï&Load and Run ScriptèŽ4ðLoad and run a cScript fileèŽ4ñHelp_Compiler 32bit hcrtf.exeèŽ ò hcrtf.exeèŽ$ó CompileHLP32èŽ<ô%/xn $NOSWAP $CAP MSG(GENERIC) $EDNAMEèŽLõ2Compile help project node .hpj to Windows 4.0 .hlpÝèŽ(ö locktest.cppE.HèŽ4÷Create an AppExpert project¹èŽ øNRescanèŽ$ùM idOutputPathèŽTúM:Rescan the header files to recreate the AppExpert database£èŽûM.apxèŽ(üRC_File_Editor‡èŽ$ý EditResourceèŽ(þEdit &ResourcesõèŽ$ÿ Edit resourceèŽ .fntèŽ, Bitmap_File_EditorèŽ( EditBitmapFileèŽ$  Edit &BitmapèŽ$  Edit bitmapèŽ .bmpèŽ .rleèŽ, Cursor_File_EditorÑèŽ( EditCursorFileÆèŽ$  Edit &CursorèŽ( Edit cursor fileèŽ .curèŽ( Icon_File_EditorèŽ$  EditIconFileèŽ$  Edit &IconèŽ( Edit icon file†èŽ .icoèŽ( Res_File_EditorâèŽ, EditBinaryResources èŽ0 Edit &Binary Resources èŽ .drvèŽ .vbxèŽ .cplèŽ .fonèŽ, ASFN:indextest.exe5èŽ tex58èŽ$  c0x32.objeèŽ$  import32.libèŽ   cw32i.libèŽ$  indextest.cppèŽ,  testdate.exeexeibSèŽ0 ASFN:..\xbase\xbased.lib6èŽ(! AutoDepReferenceèŽ$"  indextst.cppèŽ$#  indextst.exeèŽ0$ C:\BC5\INCLUDE\string.h‘èŽ0% C:\BC5\INCLUDE\_defs.h…èŽ0& C:\BC5\INCLUDE\stddef.hyèŽ0' C:\BC5\INCLUDE\_null.hmèŽ0( C:\BC5\INCLUDE\windows.hèŽ8) C:\BC5\INCLUDE\win32\windows.hUèŽ0* C:\BC5\INCLUDE\excpt.h=èŽ0+ C:\BC5\INCLUDE\stdarg.h1èŽ0, C:\BC5\INCLUDE\windef.h%èŽ0- C:\BC5\INCLUDE\winnt.hèŽ4. C:\BC5\INCLUDE\win32\winnt.hèŽ0/ C:\BC5\INCLUDE\ctype.h èŽ00 C:\BC5\INCLUDE\pshpack4.hèŽ01 C:\BC5\INCLUDE\poppack.hèŽ02 C:\BC5\INCLUDE\pshpack1.hèŽ03 C:\BC5\INCLUDE\winbase.hèŽ84 C:\BC5\INCLUDE\win32\winbase.hGèŽ05 C:\BC5\INCLUDE\winerror.hèŽ06 C:\BC5\INCLUDE\wingdi.h èŽ47 C:\BC5\INCLUDE\win32\wingdi.hèŽ08 C:\BC5\INCLUDE\pshpack2.hèŽ09 C:\BC5\INCLUDE\winuser.hèŽ8: C:\BC5\INCLUDE\win32\winuser.h‚èŽ0; C:\BC5\INCLUDE\winnls.htèŽ4< C:\BC5\INCLUDE\win32\winnls.hèŽ0= C:\BC5\INCLUDE\wincon.h[èŽ4> C:\BC5\INCLUDE\win32\wincon.hèŽ0? C:\BC5\INCLUDE\winver.hBèŽ4@ C:\BC5\INCLUDE\win32\winver.hèŽ0A C:\BC5\INCLUDE\winreg.h)èŽ4B C:\BC5\INCLUDE\win32\winreg.hèŽ0C C:\BC5\INCLUDE\winnetwk.hèŽ8D C:\BC5\INCLUDE\win32\winnetwk.hèŽ0E C:\BC5\INCLUDE\cderr.h èŽ4F C:\BC5\INCLUDE\win32\cderr.h èŽ,G C:\BC5\INCLUDE\dde.hèŽ4H C:\BC5\INCLUDE\win32\dde.héèŽ0I C:\BC5\INCLUDE\ddeml.hÜèŽ4J C:\BC5\INCLUDE\win32\ddeml.hèŽ,K C:\BC5\INCLUDE\dlgs.hèŽ4L C:\BC5\INCLUDE\win32\dlgs.hHèŽ0M C:\BC5\INCLUDE\lzexpand.hèŽ8N C:\BC5\INCLUDE\win32\lzexpand.h/èŽ0O C:\BC5\INCLUDE\mmsystem.hèŽ,P C:\BC5\INCLUDE\nb30.hèŽ4Q C:\BC5\INCLUDE\win32\nb30.h èŽ,R C:\BC5\INCLUDE\rpc.h èŽ4S C:\BC5\INCLUDE\win32\rpc.h èŽ0T C:\BC5\INCLUDE\rpcdce.hüèŽ4U C:\BC5\INCLUDE\win32\rpcdce.hèŽ0V C:\BC5\INCLUDE\rpcdcep.hèŽ8W C:\BC5\INCLUDE\win32\rpcdcep.hØèŽ0X C:\BC5\INCLUDE\rpcnsi.hÊèŽ4Y C:\BC5\INCLUDE\win32\rpcnsi.hèŽ0Z C:\BC5\INCLUDE\rpcnterr.hèŽ8[ C:\BC5\INCLUDE\win32\rpcnterr.h¼èŽ0\ C:\BC5\INCLUDE\shellapi.hèŽ8] C:\BC5\INCLUDE\win32\shellapi.hP èŽ0^ C:\BC5\INCLUDE\winperf.h èŽ8_ C:\BC5\INCLUDE\win32\winperf.h6 èŽ0` C:\BC5\INCLUDE\winsock.h èŽ0a C:\BC5\INCLUDE\commdlg.h èŽ8b C:\BC5\INCLUDE\win32\commdlg.h©èŽ0c C:\BC5\INCLUDE\winspool.hèŽ8d C:\BC5\INCLUDE\win32\winspool.hèŽ0e C:\BC5\INCLUDE\prsht.hèŽ0f C:\BC5\INCLUDE\pshpack8.hèŽ,g C:\BC5\INCLUDE\ole2.hèŽ4h C:\BC5\INCLUDE\win32\ole2.hO èŽ0i C:\BC5\INCLUDE\objbase.h èŽ0j C:\BC5\INCLUDE\rpcndr.h6 èŽ4k C:\BC5\INCLUDE\win32\rpcndr.hèŽ0l C:\BC5\INCLUDE\rpcnsip.h èŽ8m C:\BC5\INCLUDE\win32\rpcnsip.hªèŽ0n C:\BC5\INCLUDE\stdlib.hœèŽ0o C:\BC5\INCLUDE\wtypes.hèŽ0p C:\BC5\INCLUDE\unknwn.hzèŽ4q C:\BC5\INCLUDE\win32\unknwn.hèŽ0r C:\BC5\INCLUDE\objidl.haèŽ4s C:\BC5\INCLUDE\win32\objidl.hèŽ0t C:\BC5\INCLUDE\cguid.hHèŽ4u C:\BC5\INCLUDE\win32\cguid.hèŽ0v C:\BC5\INCLUDE\oleauto.hèŽ0w C:\BC5\INCLUDE\oaidl.h#èŽ0x C:\BC5\INCLUDE\oleidl.hèŽ4y C:\BC5\INCLUDE\win32\oleidl.hèŽ0z C:\BC5\INCLUDE\winsvc.h„èŽ4{ C:\BC5\INCLUDE\win32\winsvc.hèŽ4| C:\BC5\INCLUDE\win32\mcx.ha èŽ4} C:\BC5\INCLUDE\win32\imm.hT èŽ(~ ..\xbase/xtypes.hèŽ0 C:\BC5\INCLUDE\stdio.h= èŽ0€ C:\BC5\INCLUDE\_nfile.h1 èŽ, ..\xbase/retcodes.h% èŽ(‚ ..\xbase/xdate.h èŽ0ƒ ..\xbase/xbconfigw32.h©èŽ,„ ..\xbase/xbstring.h èŽ0… C:\BC5\INCLUDE\iostream.hèŽ(† ..\xbase/exp.hm èŽ(‡ ..\xbase/xbase.h èŽ(ˆ ..\xbase/xstack.hèŽ(‰ ..\xbase/dbf.hO èŽ(Š ..\xbase/index.h èŽ(‹ ..\xbase/ndx.h; èŽ(Œ ..\xbase/ntx.h1 èŽ, ..\xbase/xbfilter.h' èŽ(Ž ..\xbase/html.hèŽ$  exptest.exe„ èŽ( ASFN:exptest.exe7èŽ$‘  exptest.cppq èŽ0’ ASFN:..\xbase\xbased.lib8èŽ,“ ..\xbase\xbasedll.libèŽ0• ASFN:locktest.exe.exe9 èŽ(–  testhtml.exeexe èŽ0˜ ASFN:testdate.exe.exe10íèŽ$™  locktest.exeèŽ$š  testhtml.cppèŽ,› ASFN:testhtml.exe11ÏèŽ4œ ASFN:..\xbase\xbasedll.lib12èŽ4 ASFN:..\xbase\xbasedll.lib137èŽ4ž ASFN:..\xbase\xbasedll.lib14 èŽ$Ÿ  testdate.cpp,ö6VnЦÂÞú2Nj†®Ú6RnŠ¦Âæ&BbžºÖöRnŠªÆâþ B v ž Ú  " V v – â  " F n º  * V š Æ ö > Z ~ ª Þ 2V’Þ:Z~Òî:b†¢Îö>Zv¢Êî2Z~¢Êæ:j†¢¾Ú"FjŠ®Ú 2VzªÚ :j¢Ò2b–Æö&V†¾îR‚²êN~²âFzªâFr¦Ö 6jšÒ.bŽÂò&V޾ò" Z Š Â ò *!Z!Š!Â!ò!*"Z"Š"¶"ê"#J#~#®#æ#$F$v$ª$Ú$%>%r%¢%Ò%&6&f&š&Î&'*'Z'Š'¶'Þ'(:(j(’(º(â( )2)Z)‚)®)Ö)ú)"*F*v*¢*Ò*ú**+N+r+ž+Ò+,:,È=®/´.úŒkßÈ"ëÖÈ"êëÈ"ì4ëFÈ"îPë@`h$±níÈ"ðlë è,°ôëO–À²üÞÿý Ö%&ÿ©·ï³¶ ´$½À®ª«âÙá­µ#ü×Û  7-3./"ðõñ‰4*5*6*7*8*9*:*;*<*=*>*?*y*z*¹º»¼úûdþÿ‚vxu|†„b€Šy…k‹ˆ[hefg•c‘’”–—d]^zwŽs{m˜~o‡ƒ}q“n™›œžŸ ¡¢£°§¢s£²¦¤Õ±¥¸¿öõÚ3.10óøú ñͰ™‚ Ð…„@–ÑŒŠ‹ÌÍÎÏÓÔƒÒ ‡•˜ùôòŽ‘’“”—÷Ø× Ö Ú Ø Ù œ›žFt{qöˆù è, Èàë O–L ?.C:\BC5\INCLUDE;../ C:\BC5\LIBõ libtest.csm3XBUSINGDLL)† ‰Xj)‚ ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_ " è, É O–t hs§£¢²¦¤d±¥ è, ÊO–THs§£¦¢ è,ËO–$s§ è,ÌO–,  ´Í è,ÍO–,  ´Í è,ÎO–$ Í è,ÏO–,3__DEBUG=2;__TRACE;__WARN è,Ð O– `h,# n i |íg„ O– g„ O– g„  !O–! g„" #O–# g„$ Dë%O–%  è,& ¼ë)g„' (O–( O–P)Cöò€ôù3_RTLDLL;XBUSINGDLL ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_ .C:\BC5\INCLUDE;..`h$*  ~í `h$+ Bí`h$, €Bí`h$-" ªí`h$.“ ‚Bíg„/ 0O–0  è,1  ë2O– 2O– 3ª^j) Ü(…g„4! 5O–5 @ ÿÿÿÿÈ"6à!„¬ë;hg„$7! Àë8 O–x8dll" Åhg)‡ ‰Xj)ƒ ¢ag)$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~ x‡^)  !€  ! x‡^)‚ ‰Xj)„ ýQi)…  !† ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ ‰Xj) &Si)Ž ‰Xj)Ž êcg)`h,9 i …íÅ …g„: €ë;O–;  è,< Äë=O–<=-öò€ôù3_RTLDLL;XBUSINGDLL ¢ag)#  !$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_ `h$>  ‡í `h$? ˆBí`h$@ ‰Bí`h$A‘ òŠªí`h$B“ ‹Bíg„ C DO–D  è,E’ ëFO– FO– G«^j)8 0êg„H! `ëIO–xIdll‘ øhg)‡ ‰Xj)ƒ ¢ag)$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~ x‡^)  !€  ! x‡^)‚ ‰Xj)„ ýQi)…  !† ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ ‰Xj) &Si)Ž ‰Xj)Ž êcg)`h$J™ í`h$KöŽªíg„L <ëMO–M  è,N• €ëOO–LO?öò€ôù3_RTLDLL;XBUSINGDLL`h$P  í `h$Q ‘Bí`h$R ’Bí`h$S “í`h$TŸ ”ªíg„U œëVO–V  è,W˜ àëXO–LX?öò€ôù3_RTLDLL;XBUSINGDLL`h$Y  –í `h$Z —Bí`h$[ ˜Bí`h$\– ™í`h$]š šªíg„^ ü ë_O–_  è,`› @!ëaO–La?öò€ôù3_RTLDLL;XBUSINGDLL`h$b  œí `h$c Bí`h$d žBí`h$e“ ŸBíg„f gO–g  è,hœ |"ëiO– i`h$j“ ¡Bíg„k lO–l  è,m  #ënO– n`h$o“ £Bíg„p qO–q  è,rž œ#ësO– sO– t¸^j)/¥g„$u! ì#ëv O–pvdllö‰Xj)‡ ‰Xj)ƒ ¢ag)$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~ x‡^)  !€  ! x‡^)‚ ‰Xj)„ ýQi)…  !† ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ ‰Xj) &Si)Ž ‰Xj)O– w¸^j)š|È¥g„x! ˜'ëyO–pydllŸ `[j)‡ ‰Xj)ƒ ¢ag)$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~ x‡^)  !€  ! x‡^)‚ ‰Xj)„ ýQi)…  !† ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ ‰Xj) &Si)Ž ‰Xj)O– z0_j)½ |å¥g„{! L7ë|O–p|d€lš `[j)‡ ‰Xj)ƒ ¢ag)$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~ x‡^)  !€  ! x‡^)‚ ‰Xj)„ ýQi)…  !† ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ ‰Xj) &Si)Ž ‰Xj)4Plˆ¬Èô´à, X Ì ø L x œ È ô L x œ È ô , X t Œ ¨ À Ü ô (D\ˆ¤¼ 0TxœÀÜô ,Lh€œÀ8d€˜Ä$Hl´Ôì$D`Øü <T€Ìð8\€œ´à, P t ˜ ¼ à ü !@!Œ!°!Ô!ø!"8"P"|"ˆ"¬"È"à" ##<#X#p#œ#¨#È#ì#\'|'˜'+(+D+Œ(lœŒkßó í4U$²úÿÿÿ²4U$,þÿÿÿðÒ-ÌàT.þÿÿÿ-/ F! ÌàT0þÿÿÿ-1 .!ÌàT2þÿÿÿ-3 /!ÌàT4þÿÿÿ-5"ÌàT½þÿÿÿ-¾¿(F!4U$9þÿÿÿÐ&-ÌàT ;þÿÿÿ-<=gF#ìù$í ÌàT >þÿÿÿ-Æ@hF#' ÌàT Aþÿÿÿ-BCiF$(ÌàT Dþÿÿÿ-EF`F$)ÌàT Gþÿÿÿ-HIkF#* ÌàTJþÿÿÿ-KLjF#+ 4U$Mþÿÿÿ|¶ã/-ÌàTOþÿÿÿ-PQa-"0ìÿ,ÌàTRþÿÿÿ-STb-"04U$Uþÿÿÿ¨ß2-ÌàTWþÿÿÿ-XYQFS14U$_þÿÿÿò4-ÌàTaþÿÿÿ-bcc/"34U$iþÿÿÿì»Î7jÌàTkþÿÿÿjÉlmeF#5 4U$nþÿÿÿ¬Â9oÌàTpþÿÿÿoÊqrd/$84U${þÿÿÿ„äó<|ÌàT}þÿÿÿ|Ë~lF$:4U$dþÿÿÿ@ëò>ÎÌàTfþÿÿÿÎÏghmF$=4U$€ýÿÿÿÄ8ø@-ÌàT‚ýÿÿÿ-у„-Ìì?ÌàT …ýÿÿÿ-ц‡‘-ÌìA4U$!ˆýÿÿÿ îG-ÌàT"Šýÿÿÿ-Ò‹Œ0F˜ì! B4U$#ýÿÿÿJ-ÌàT$ýÿÿÿ-‘A ì# H4U$%’ýÿÿÿ¼Ð–L-ÌàT&“ýÿÿÿ-ØÙÚ’1ˆ ì% KÌàT'•ýÿÿÿ-Û–—’ˆ ì% M4U$(˜ýÿÿÿ˜‡ÂOÜÌàT)™ýÿÿÿÜš›FT ì( NÌàT*œýÿÿÿÜÝšžFT ì(PÌàT+ŸýÿÿÿÜÒš¡FT ì(Q4U$,©ýÿÿÿ©SªÌàT-«ýÿÿÿªÞ¬­t ì,R4U$.³üÿÿÿdJïTßÌàT/´üÿÿÿß൶ .4U$0·üÿÿÿDèôUáÌàT1¸üÿÿÿṺ 04U$2âþÿÿÿØ—ÁWãÌàT3äþÿÿÿãåÀæF$2V4U$4Âþÿÿÿ<÷ôYçÌàT5ÂþÿÿÿçèÃé-$4X4U$6Åþÿÿÿ8ù[çÌàT7Åþÿÿÿçêëì-$6Z4U$8Îýÿÿÿh¼Þ^-ÌàT9Îýÿÿÿ-ÒÏ Dì8\4U$:îþÿÿÿ [Ù`-ÌàT;îþÿÿÿ-ïðÀF$:_4U$<ñþÿÿÿÀNÛbòÌàT=óþÿÿÿòô~õF$<a4U$>ýÿÿÿ€œßd-ÌàT?ýÿÿÿ-Ò÷¡¬ì>c4U$@®ýÿÿÿøÔÙf-ÌàTA®ýÿÿÿ-Ò±²€$ì@*e4U$Bøþÿÿÿ\Øh-ÌàTCøþÿÿÿ-ù7ú$œìB+gí!4U$Düýÿÿÿ ^Òk-ÌàTEýýÿÿÿ-ÒþÿZFìDi4U$F ýÿÿÿ o-ÌàTG ýÿÿÿ-Ò  [FŒìFl4U$H ýÿÿÿ„Ýr-ÌàTI ýÿÿÿ-Ò  \FìHp4U$J ýÿÿÿ€9åu-ÌàTK ýÿÿÿ-Ò  ]F|ìJs4U$L ýÿÿÿtÜý{-ÌàTM ýÿÿÿ-Ò ÿ^-ôìLv(LpÄlÀ8Œà4ˆÜ0T¨ü t˜ìdˆÜTxÌðD˜¼ 4 ˆ ¬ T x Ì t ˜ ì  d ˆ Ü T x Ì ð Dh¼à4X¬Ð$HœÀ8Œ°(| ôî| & VŒkß ø ɶ))      !"#$%&'()*^4¼ì"^4$ÉÛ-HìATì^4^4 €îðhì9lì^4³ ¼ì"^4´^4µ¼ì"Äì^4 ¶^4 ·¼ì"^4 ¸^4 ¹^4 º ì^4»ì^4¼ìM^4ÀX0â¼ì"8ì ^4Á 8ìE^4 pìë!ðìTì^4Ã"ìM¨ì^4Ä#¼ì"Œì ^4Å%Œì ^4Ç6¼ì"^4ȘΠ.HìATì^4Ì^4Í;¼ì"^4Ð^4ÓC¼ì"^4ÔD^4ÕE¼ì"^4ÖF¼ì";^4×I^4 í]hì9^4!û^4"  j^4# m°ìG^4$ n°ìG^4% q(ìI^4& t ìK^4' w^4( x^4) y^4* zÒ:n¢Ö >r¦ÚBvªÞFz®âJ~²æN‚¶êR†ºî"VоòPi&ˆ„ŒkßhJîÈë É^   &1<ENW`hmr&d(ÄÀŒk߰훈ë ɘ*+,.-9>?@ABJKPQRSTYZ[\]bcdejo(Àb( œ zŒkß(ðïh¬Döÿÿÿˆëò O– h¬Döÿÿÿ¼ð  , ë}O– h¬Döÿÿÿ ë*O– h¬Döÿÿÿ 0ë+O– h¬D  öÿÿÿ Të,O– h¬D  öÿÿÿ,ë3 xë-h¬D  öÿÿÿð8ë9"†h¬D  öÿÿÿ„ðœë. ƒO– O– h¬Döÿÿÿ ë>O– h¬Döÿÿÿ $ë?O– h¬Döÿÿÿ Hë@O– h¬Döÿÿÿ$ëG lëAh¬Döÿÿÿdð7#ØëJ$h¬DöÿÿÿXð ëB#ŒO– O– h¬Döÿÿÿ¨#ëtüëKh¬DöÿÿÿÌëPO– h¬Döÿÿÿ !ðëQO– h¬D!!öÿÿÿ"ëRO– "h¬D##öÿÿÿèð$9-8ëS%•O– $h¬D%%öÿÿÿ\'ëw#)\ëTh¬D''öÿÿÿ(#%, ëYO– (h¬D))öÿÿÿ*#+P ëZO– *h¬D++öÿÿÿ,#t ë[O– ,h¬D--öÿÿÿlð.;˜ ë\&›O– .h¬D//öÿÿÿì,ëz-3¼ ë]h¬D11öÿÿÿ2-/Œ!ëbO– 2h¬D33öÿÿÿ4-5°!ëcO– 4h¬D55öÿÿÿ6-Ô!ëdO– 6h¬D77öÿÿÿüð8ø!ëe' O– 8h¬D99öÿÿÿL ð:#'ˆ"ëj(¢O– :h¬D;;öÿÿÿœ ð<-1#ëo)¤O– <(lx¼È \h¬¸ü@„œàì0<€ŒÐXdp´øHT˜¤èô8|ˆÌØ(lx¼ P\ ¬ðü@ L ÿ—62Œk߈5› ɰc :6Œkß É °c 62Œkß4Ñ­ É  ¼ž ²®ŒkßÈø§ É’ !#%(,.02468:<>@BDFHJL¬¶ :6Œkß É W„ JFŒkß É* ")*+W„62Œkß ÉVFBŒkßäø§ É&¬¶JFŒkß É*    W„b^Œkß ÉB      "$)*+W„62Œkß ÉW„:6Œkß É"W„62Œkß ÉW„62Œkß ÉW„:6Œkß É"¬¶>:Œkß É W„62Œkß ÉW„B>Œkß É"W„:6Œkß ÉM¬¶:6Œkß ÉW„62Œkß ÉW„>:Œkßü¤ë É9?¬¶JFŒkß É*W„b^Œkߤ ÉB     ")*+3W„ NJŒkß É. ")*+EW„!ZVŒkßÀó É:!  $&'57MW„"RNŒkß É2"$57MW„#b^Œkß ÉB#      ")*+¬¶$B>Œk߈ É"$W„%:6Œkß É%  V&JFŒkßù§ É*&     ¬¶'>:Œkß É'¬¶(>:Œkß É(¬¶)>:Œkß É)¬¶*>:Œkß É*¬¶+>:Œkß É+¬¶,B>Œkߘ…ý É",W„-^ZŒk߈ó É>-  $&'57?ACW„.JFŒkߤó É*.57?ACV/:6Œkßù§ É/¬¶062Œkß É0¬¶162Œkß É1V262Œkß8ù§ É2¬¶362Œkß É3V462ŒkßTù§ É4¬¶562Œkß É5W„6FBŒkß É&6")*+V762Œkßpù§ É7¬¶8>:Œkß É8V962Œkߌù§ É9¬¶:62Œkß É:W„;NJŒkß É.;")*+-=V<62Œkߨù§ É<¬¶=:6Œkß É=V>62Œkßðù§ É>¬¶?:6Œkßø= É?V@:6Œkß8ú§ É@ ¬¶A:6Œkßìñ ÉA¬¶BfbŒkß°? ÉFB  W„C62Œkß ÉC"W„D62Œkß ÉD"W„E62Œkß ÉE"W„F:6Œkß ÉF";VG62Œk߀ú§ ÉG"¬¶HFBŒkßÌíñ É&HW„I62Œkß ÉI$VJ62Œkßôô ÉJ$¬¶K:6Œkß:Œkß„õ ÉO)*+¬¶PNJŒkßÌïñ É.P¬¶QNJŒk߬D É.Q¬¶R62ŒkßÌðñ ÉRVS62ŒkßÌõ ÉS-VT62Œkßö ÉT/VU62Œkß\ö ÉU1¬¶V62Œkß ÉVVW62Œkߤö ÉW3¬¶XB>Œkß É"XVY62Œkßìö ÉY5¬¶ZB>Œkß É"ZV[62Œkß4÷ É[7¬¶\:6ŒkßÔó É\ W„]62Œkß É]9V^62Œkß|÷ É^9¬¶_62Œkß É_V`62ŒkßÄ÷ É`;¬¶a62Œkß ÉaVb62Œkß,ó Éb=¬¶c>:ŒkßÌññ ÉcVd62ŒkßHó Éd?¬¶e:6ŒkßdF ÉeVf62Œkßdó ÉfA¬¶g:6Œkß ÉgVh62Œk߀ó ÉhC¬¶i:6ŒkßÌòñ Éi"W„j62Œkß ÉjEVk62Œkßœó ÉkE¬¶l:6ŒkßH Él#$W„m62Œkß ÉmGW„n62Œkß ÉnGVo62Œk߸ó ÉoG¬¶p62ŒkßÌóñ Ép%W„q62Œkß ÉqIVr62ŒkßÔó ÉrI¬¶s62ŒkßÔI És&W„t62Œkß ÉtKVu62Œkßðó ÉuK¬¶vNJŒkßÌôñ É.v'()*W„w62Œkß ÉwMW„x62Œkß ÉxMW„y62Œkß ÉyMW„z62Œkß ÉzMV{62Œkß ó É{Mÿ—|:6Œkß,e± É|$°c}62ŒkßDÙÜ É}&ÿ—~62Œkßh1² É~ÿ—62Œkß$¡ Éÿ—€62Œkß”ý  É€ ÿ—:6Œkß0h  É 7ÿ—‚:6Œkße± É‚ /°cƒ62ŒkßPð× Éƒ1È=„<8ŒkßO– „€qö‰Xj) " Åhg)$  !%  !&  !'  !(  !)  !*  !+  !,  !-  !.  !/  !0  !1  !2  !3  !4  !5  !6  !7  !8  !9  !:  !;  !<  !=  !>  !?  !@  !A  !B  !C  !D  !E  !F  !G  !H  !I  !J  !K  !L  !M  !N  !O  !P  !Q  !R  !S  !T  !U  !V  !W  !X  !Y  !Z  ![  !\  !]  !^  !_  !`  !a  !b  !c  !d  !e  !f  !g  !h  !i  !j  !k  !l  !m  !n  !o  !p  !q  !r  !s  !t  !u  !v  !w  !x  !y  !z  !{  !|  !}  !~ x‡^)  !€  ! x‡^)‚ ‰Xj)ƒ ¢ag)„ ýQi)…  !† ‰Xj)‡ ‰Xj)ˆ ‰Xj)‰ ‰Xj)Š ‰Xj)‹ ‰Xj)Œ ‰Xj) &Si)Ž ‰Xj)‘ øhg)š Ÿ `[j)ÿ—…:6ŒkßlÞ™ É… :°c†62Œkߨßâ Ɇ<ÿ—‡62Œkß$MÝ É‡ÿ—ˆ62ŒkßÔ á Ɉÿ—‰62Œkßôjã ɉÿ—Š:6ŒkßxAÝ ÉŠHÿ—‹:6Œk߀$ É‹C°cŒ62ŒkßXKñ ÉŒEÿ—:6ŒkßÐÛ ÉLÿ—Ž:6Œkß¼Š× ÉŽu°c62ŒkßÌP™ ÉNÿ—62Œk߸¿Î Éÿ—‘62Œkßœ…´ É‘ÿ—’62Œkß؆ É’!ÿ—“:6Œkß8°  É“#Uÿ—”:6ŒkßÞÎ É”%x°c•62ŒkßTƒØ É•Wÿ—–62ŒkߌpÝ É–'ÿ——62ŒkßH‘Ô É—)ÿ—˜62Œkß°µ ɘ+ÿ—™:6ŒkßÐÎy É™-^ÿ—š:6Œkß ñ§ Éš/{°c›62Œkßlñ§ É›`ÿ—œ62ŒkßL¾Í Éœ1ÿ—62ŒkßÔñ§ É3ÿ—ž62Œk߬ô Éž5ÿ—Ÿ:6Œkßh¾Í ÉŸ7f°c 62Œkß÷§ É hÿ—¡:6Œkß$÷§ É¡9k°c¢62Œkßtø§ É¢mÿ—£:6Œkßø§ É£;p°c¤62Œk߬ø§ ɤr8… `\Œk߀ë6¼<¦,ž/Ê/®/x_€s| ü|ˆ„}ÄH~ ^ˆ6”ˆ:Έ6‰²¶‰:ð‰J:Š6pŠF¶ŠJ‹bb‹6˜‹:Ò‹6Œ6>Œ:xŒ>¶Œ6ìŒB.:h:¢6Ø>ŽJ`ŽbÂŽNZjR¼bB`:šJä>"‘>`‘>ž‘>Ü‘>’B\’^º’J“:>“6t“6ª“6à“6”6L”6‚”FÈ”6þ”><•6r•6¨•Nö•6,–:f–6œ–:Ö–:—:J—f°—6æ—6˜6R˜:Œ˜6˜F™6>™6t™:®™:è™:"šNpš>®šNüšNJ›6€›6¶›6ì›6"œ6Xœ6ŽœBМ6BH6~:¸6î6$ž6Zž6ž6Æž6üž>:Ÿ6pŸ:ªŸ6àŸ: 6P :Š 6À 6ö :0¡6f¡6œ¡6Ò¡6¢6>¢6t¢6ª¢6à¢6£Nd£6š£6У6¤6<¤6r¤:¬¤6â¤6¥6N¥6„¥:¾¥:ø¥6.¦<j­:¤­6Ú­6®6F®6|®:¶®:ð®6&¯:`¯:š¯6Я6°6<°6r°:¬°:æ°6±6R±6ˆ±6¾±:ø±:2²6h²6ž²6Ô²6 ³:D³6z³:´³6ê³:$´6 xbase-2.0.0/libtest/testhtml.html0000644000000000000000000000063307203046004012437 Test HTML Page
    This is a test html page.



    Field 1

    Field 2

    xbase-2.0.0/tv/0000777000000000000000000000000007316217177006772 5xbase-2.0.0/tv/Makefile.in0000644000000000000000000002204707316217176010757 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # This file is part of the XBase libraries # Copyright (C) 1998,1999 Vitaly Fedrushkov # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # This library 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 # Library General Public License for more details. # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. If not, # write to the Free Software Foundation, Inc., or see # http://www.gnu.org/. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ GLINC = @GLINC@ GLLIB = @GLLIB@ LD = @LD@ LIBDL = @LIBDL@ LIBJPEG = @LIBJPEG@ LIBNSL = @LIBNSL@ LIBOBJS = @LIBOBJS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ NM = @NM@ PACKAGE = @PACKAGE@ PAMINC = @PAMINC@ PAMLIBPATHS = @PAMLIBPATHS@ PAMLIBS = @PAMLIBS@ RANLIB = @RANLIB@ TVPROGS = @TVPROGS@ VERSION = @VERSION@ XPMINC = @XPMINC@ XPMLIB = @XPMLIB@ XSUBDIRS = @XSUBDIRS@ X_INCLUDES = @X_INCLUDES@ X_LDFLAGS = @X_LDFLAGS@ doxygen = @doxygen@ topdir = @topdir@ x_includes = @x_includes@ x_libraries = @x_libraries@ INCLUDES = -I$(topdir) $(all_includes) noinst_PROGRAMS = @TVPROGS@ EXTRA_PROGRAMS = tvxbase tvxbase_SOURCES = tvxbase.cpp tvbrowse.cpp tvbrowse.h tvxbase_LDADD = -L$(topdir)/xdb/.libs -lxdb -ltvision -lgpm MAINTAINERCLEANFILES = Makefile.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../xbase/xbconfig.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I../xbase CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ tvxbase_OBJECTS = tvxbase.o tvbrowse.o tvxbase_DEPENDENCIES = tvxbase_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = README Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(tvxbase_SOURCES) OBJECTS = $(tvxbase_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cpp .lo .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps tv/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstPROGRAMS: clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: tvxbase: $(tvxbase_OBJECTS) $(tvxbase_DEPENDENCIES) @rm -f tvxbase $(CXXLINK) $(tvxbase_LDFLAGS) $(tvxbase_OBJECTS) $(tvxbase_LDADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< .cpp.lo: $(LTCXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = tv distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(PROGRAMS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-noinstPROGRAMS distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xbase-2.0.0/tv/README0000644000000000000000000000246707115376732007577 This directory contains (a faint shadow of) Turbo Vision interface for Xbase library. Turbo Vision is a powerful class library that provides best of breed text mode interface with SAA/CUA flavor. Turbo Vision is copyrighted by (former) Borland Intl. This code corresponds to Turbo Vision version 2 for DOS, which can be found at ftp.borland.com/pub/borlandcpp/devsupport/archive/turbovision/tv.zip However, it works great with TurboVision for Unix (0.6 -- or any other at your option). This port is (c) Sergio Sigala and can be found at ftp.vix.com/guests/ssigala/pub/tvision Comments and complaints are welcome. To do: o Index support. RecNo-based addressing is hammered into TListViewer. May require great rewrite. o Horizontal scrolling. o Locked (non-scrollable) columns. o Nontrivial memo field handling. o In-place editing. o Documentation Wanted: o More testing (DOS/Windows or BSD) o Better idea for demo app (maybe bin/dbfutil.cpp ?) Regards, Willy. -- "No easy hope or lies | Vitaly "Willy the Pooh" Fedrushkov Shall bring us to our goal, | Information Technology Division But iron sacrifice | Chelyabinsk State University Of Body, Will and Soul." | mailto:willy@csu.ac.ru +7 3512 156770 R.Kipling | http://www.csu.ac.ru/~willy VVF1-RIPE xbase-2.0.0/tv/Makefile.am0000644000000000000000000000223107117507362010735 ## Process this file with automake to produce Makefile.in ## # This file is part of the XBase libraries # Copyright (C) 1998,1999 Vitaly Fedrushkov # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # This library 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 # Library General Public License for more details. # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. If not, # write to the Free Software Foundation, Inc., or see # http://www.gnu.org/. INCLUDES = -I$(topdir) $(all_includes) noinst_PROGRAMS = @TVPROGS@ EXTRA_PROGRAMS = tvxbase tvxbase_SOURCES = tvxbase.cpp tvbrowse.cpp tvbrowse.h tvxbase_LDADD = -L$(topdir)/xdb/.libs -lxdb -ltvision -lgpm MAINTAINERCLEANFILES = Makefile.in xbase-2.0.0/tv/tvxbase.cpp0000644000000000000000000001200707162217472011063 /* $Id: tvxbase.cpp,v 1.2 2000/09/20 20:34:02 dbryson Exp $ Xbase project source code This file contains example program for TurboVision interface classes for Xbase DBMS library. Copyright (C) 1998,1999 Vitaly Fedrushkov www - http://www.startech.keller.tx.us/xbase.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., or see http://www.gnu.org/. */ #include #define Uses_TApplication #define Uses_TButton #define Uses_TDeskTop #define Uses_TDialog #define Uses_TEvent #define Uses_TFileDialog #define Uses_TKeys #define Uses_TMenuBar #define Uses_TMenuItem #define Uses_TRect #define Uses_TStaticText #define Uses_TStatusDef #define Uses_TStatusItem #define Uses_TStatusLine #define Uses_TSubMenu #include #include #include "tvbrowse.h" // Interface classes const int cmHelpAbout = 350; const int cmOpenDbf = 351; class xbTvApp : public TApplication { public: xbTvApp(); private: static TStatusLine *initStatusLine(TRect r); static TMenuBar *initMenuBar(TRect r); virtual void handleEvent(TEvent& event); void DialogHelpAbout(); void open(const char *); void openDbf(char*); xbTvBrowseWindow *Browse; xbXBase *XBase; }; xbTvApp::xbTvApp() : TProgInit(xbTvApp::initStatusLine, xbTvApp::initMenuBar, xbTvApp::initDeskTop) { TEvent ev; XBase = new xbXBase(); ev.what = evCommand; ev.message.command = cmHelpAbout; TProgram::putEvent(ev); } TStatusLine * xbTvApp::initStatusLine(TRect r) { r.a.y = r.b.y - 1; return new TStatusLine(r, *new TStatusDef(0, 0xFFFF) + *new TStatusItem(0, kbF10, cmMenu) + *new TStatusItem("~Alt-X~ Exit", kbAltX, cmQuit) + *new TStatusItem("~F3~ Open", kbF3, cmOpen) + *new TStatusItem("~Alt-F3~ Close", kbAltF3, cmClose) ); } TMenuBar * xbTvApp::initMenuBar(TRect r) { r.b.y = r.a.y + 1; return new TMenuBar(r, *new TSubMenu("~F~ile", kbAltF)+ *new TMenuItem("~O~pen", cmOpen, kbF3, hcNoContext, "F3")+ newLine()+ *new TMenuItem("E~x~it", cmQuit, kbAltX, hcNoContext, "Alt-X")+ *new TSubMenu("~H~elp", kbAltH)+ *new TMenuItem("~A~bout", cmHelpAbout, kbNoKey, hcNoContext) ); } void xbTvApp::handleEvent(TEvent& event) { TApplication::handleEvent(event); if(event.what == evCommand) { switch(event.message.command) { case cmHelpAbout: DialogHelpAbout(); break; case cmOpen: open("*.dbf"); break; case cmOpenDbf: openDbf((char*)event.message.infoPtr); free(event.message.infoPtr); break; default: return; } clearEvent(event); } } #ifndef __MSDOS__ #define ABOUT_HEIGHT 21 #else #define ABOUT_HEIGHT 18 #endif void xbTvApp::DialogHelpAbout() { TDialog *pd = new TDialog(TRect(10, 2, 70, ABOUT_HEIGHT), "About Xbase+TV Browse demo"); if (pd) { TRect r = pd->getExtent(); r.grow(-3, -2); r.b.y = r.a.y + 4; pd->insert(new TStaticText(r, "\03Xbase DBMS library\n \n" "Copyright (C) 1997 StarTech, Gary A. Kunkel\n" "Please visit http://www.startech.keller.tx.us/xbase/")); r.move(0,5); pd->insert(new TStaticText(r, "Turbo Vision interface classes for Xbase\n" "Copyright (C) 1998,1999 Vitaly V Fedrushkov")); r.move(0,3); pd->insert(new TStaticText(r, "Turbo Vision library\n" "Copyright (c) 1991, 1994 by Borland International")); #ifndef __MSDOS__ r.move(0,3); pd->insert(new TStaticText(r, "TurboVision for UNIX\n" "All changes copyright (c) 1997 Sergio Sigala")); #endif r.move(0,2); r.grow(-22,-1); pd->insert(new TButton(r, "~O~K", cmOK, bfDefault)); pd->options |= ofCentered; deskTop->execView(pd); } destroy(pd); } void xbTvApp::open(const char *fileSpec) { TFileDialog *d= (TFileDialog *)validView( new TFileDialog(fileSpec, "Open a File", "~N~ame", fdOpenButton, 100 )); if (d != 0 && deskTop->execView(d) != cmCancel) { char fileName[PATH_MAX]; TEvent ev; d->getFileName( fileName ); ev.what = evCommand; ev.message.command = cmOpenDbf; ev.message.infoPtr = strdup(fileName); TProgram::putEvent(ev); } destroy(d); } void xbTvApp::openDbf(char *name) { TRect r = deskTop->getExtent(); xbDbf *db = new xbDbf(XBase); xbTvBrowse *br; db->OpenDatabase(name); br = new xbTvBrowse(db); Browse = new xbTvBrowseWindow(r, name, br); if (validView(Browse)) { Browse->eventMask |= evBroadcast; deskTop->insert(Browse); } } xbTvApp *MainApp; int main() { MainApp = new xbTvApp(); MainApp->run(); delete MainApp; return 0; } xbase-2.0.0/tv/tvbrowse.cpp0000644000000000000000000001557707162217472011301 /* $Id: tvbrowse.cpp,v 1.2 2000/09/20 20:34:02 dbryson Exp $ Xbase project source code This file contains a set of TurboVision interface classes for Xbase DBMS library. Copyright (C) 1998,1999 Vitaly Fedrushkov www - http://www.startech.keller.tx.us/xbase.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., or see http://www.gnu.org/. */ #include #include #include #include #include #include #define Uses_TEvent #include #include "tvbrowse.h" const char xbTvBrowseField::fillChar = '\xB1'; const char xbTvBrowseCaption::fieldSep = '\xB3'; xbTvBrowseField::xbTvBrowseField(short aWidth, const char *aName) { Width = 0; Name = NULL; setWidth(aWidth); setName(aName); } xbTvBrowseField::xbTvBrowseField(xbDbf *dbf, xbShort field) { Width = 0; Name = NULL; setWidth(dbf->GetFieldLen(field)); setName(dbf->GetFieldName(field)); } xbTvBrowseField::~xbTvBrowseField() { if (NULL != Name) { free(Name); } } void xbTvBrowseField::setWidth(short aWidth) { Width = aWidth; } short xbTvBrowseField::getWidth() { return Width; } void xbTvBrowseField::setName(const char *aName) { if (NULL != Name) { free(Name); } if (aName) { Name = strdup(aName); } } void xbTvBrowseField::getName(char *Text, short maxlen) { short l = strlen(Name); short i = max(0, (maxlen - l - 2)/2); memset(Text, fillChar, maxlen); strncpy(Text+i+1, Name, min(l, maxlen)); Text[i] = Text[i+l+1] = ' '; Text[maxlen+1] = '\0'; } xbTvBrowseCaption::xbTvBrowseCaption(const TRect &r, xbTvBrowse *browse): TView(r) { Browse = browse; } void xbTvBrowseCaption::draw() { int curCol; int j; int indent; short colWidth; ushort color; TDrawBuffer b; indent = Browse->hScrollBar ? Browse->hScrollBar->value : 0; curCol = 0; b.moveChar(0, ' ', getColor(1), size.x); color = getColor(1); for (j = indent; j < Browse->getFieldCount(); j++) { char text[256]; char buf[256]; colWidth = Browse->getWidth(j); Browse->getFieldName(text, j, colWidth); memmove(buf, text, colWidth); buf[colWidth] = EOS; b.moveStr(curCol+1, buf, color); curCol += colWidth + 1; b.moveChar(curCol, fieldSep, color, 1); if (curCol > size.x) { break; } } writeLine(0, 0, size.x, 1, b); } const char xbTvBrowse::emptyText[] = "<<< No data >>>"; const char xbTvBrowse::fieldSep = '\xB3'; // = '|'; xbTvBrowse::xbTvBrowse(xbDbf *data) :TListViewer(TRect(0, 0, 1, 1), 1, NULL, NULL) { Fields = new TNSCollection(10, 10); Data = data; populate(); setRange(); } void xbTvBrowse::handleEvent(TEvent& event) { if (event.what == evMouseDown) { message(owner, evBroadcast, cmListItemSelected, this); clearEvent(event); } TListViewer::handleEvent(event); } short xbTvBrowse::getWidth(short field) { return ((xbTvBrowseField*)(Fields->at(field)))->getWidth(); } short xbTvBrowse::getFieldCount() { return Fields->getCount(); } void xbTvBrowse::draw() { int curCol; int i, j; int indent; ccIndex item; short colWidth; ushort color; ushort focusedColor = getColor(3); ushort normalColor; ushort selectedColor; TDrawBuffer b; uchar scOff; if ((state&(sfSelected | sfActive)) == (sfSelected | sfActive)) { normalColor = getColor(1); focusedColor = getColor(3); selectedColor = getColor(4); } else { normalColor = getColor(2); selectedColor = getColor(4); } indent = hScrollBar ? hScrollBar->value : 0; curCol = 0; writeLine(0, 0, size.x, 1, b); for (i = 0; i < size.y; i++) { curCol = 0; b.moveChar(0, ' ', normalColor, size.x); item = i + topItem; if ((state & (sfSelected | sfActive)) == (sfSelected | sfActive) && focused == item && range > 0) { color = focusedColor; setCursor(1, i); scOff = 0; } else if (item < range && isSelected(item)) { color = selectedColor; scOff = 2; } else { color = normalColor; scOff = 4; } if (item < range) { for (j = indent; j < getFieldCount(); j++) { colWidth = getWidth(j); char text[256]; getText(text, item, j, colWidth); char buf[256]; memmove(buf, text, colWidth); buf[colWidth] = EOS; b.moveStr(curCol+1, buf, color); curCol += colWidth + 1; b.moveChar(curCol, fieldSep, getColor(5), 1); if (curCol > size.x) { break; } } if(showMarkers) { b.putChar(0, specialChars[scOff]); b.putChar(size.x, specialChars[scOff+1]); } else { b.putChar(size.x, ' '); } } else if(i == 1) { b.moveStr(max(0, (size.x - strlen(emptyText)) / 2), emptyText, getColor(1)); } writeLine(0, i, size.x, 1, b); } } void xbTvBrowse::getFieldName(char *Text, short field, short maxlen) { ((xbTvBrowseField*)(Fields->at(field)))->getName(Text, maxlen); } void xbTvBrowse::getText(char *Text, long item, short field, short maxlen) { Data->GetRecord(xbULong(item)); Data->GetField(xbShort(field), Text); return; } TPalette& xbTvBrowse::getPalette() const { static TPalette palette(cpBrowse, sizeof(cpBrowse)-1); return palette; } void xbTvBrowse::focusItem(short item) { TListViewer::focusItem(item); if (item) { message(owner, evBroadcast, cmDataFocused, Data); } } void xbTvBrowse::addField(xbTvBrowseField *field) { Fields->insert(field); } void xbTvBrowse::setRange() { TListViewer::setRange(short(Data->NoOfRecords())); } void xbTvBrowse::populate() { short i; for (i = 0; i < Data->FieldCount(); i++) { addField(new xbTvBrowseField(Data, i)); } } xbTvBrowseWindow::xbTvBrowseWindow(const TRect &rect, char *title, xbTvBrowse *aBrowse, int BottomGap) :TWindow(rect, title, wnNoNumber), TWindowInit(TWindow::initFrame) { listScroller = new TScrollBar(TRect(size.x - 1, 1, size.x, size.y - 1 - BottomGap)); listScroller->growMode = gfGrowLoX|gfGrowHiX|gfGrowHiY; listBox = aBrowse; listBox->setBounds(TRect(1, 2, size.x - 1, size.y - 1 - BottomGap)); listBox->growMode = gfGrowHiX|gfGrowHiY; listBox->vScrollBar = listScroller; listBox->setRange(); insert(aBrowse); insert(listScroller); insert(new xbTvBrowseCaption(TRect(1, 1, size.x - 1, 2), aBrowse)); listBox->focusItem(0); } void xbTvBrowseWindow::handleEvent(TEvent &event) { switch(event.what) { case evBroadcast: switch (event.message.command) { // case cmListItemSelected: // clearEvent(event); // break; } } TWindow::handleEvent(event); } xbase-2.0.0/tv/tvbrowse.h0000644000000000000000000000555007115376740010736 /* $Id: tvbrowse.h,v 1.1.1.1 2000/06/01 06:08:32 dbryson Exp $ Xbase project source code This file contains declarations for TurboVision interface classes for Xbase DBMS library. Copyright (C) 1998,1999 Vitaly Fedrushkov www - http://www.startech.keller.tx.us/xbase.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., or see http://www.gnu.org/. */ #ifndef __XB_TVBROWSE_H__ #define __XB_TVBROWSE_H__ #define Uses_TObject #define Uses_TListViewer #define Uses_TRect #define Uses_TScrollBar #define Uses_TWindow #include #include const int cmDataFocused = 301; class xbTvBrowseField : private TObject { private: short Width; char *Name; static const char fillChar; public: xbTvBrowseField(short, const char *); xbTvBrowseField(xbDbf *, short); ~xbTvBrowseField(); virtual short getWidth(); virtual char *getName() { return Name; }; virtual void getName(char *, short); virtual void setWidth(short); virtual void setName(const char *); }; class xbTvBrowseCaption; class xbTvBrowse : public TListViewer { public: xbTvBrowse(xbDbf *); virtual void handleEvent(TEvent&); virtual void focusItem( short item ); virtual void draw(); virtual void addField(xbTvBrowseField *); virtual void setRange(); TPalette& getPalette() const; friend xbTvBrowseCaption; protected: static const char emptyText[]; virtual short getFieldCount(); virtual short getWidth(short); virtual void getText(char *, long, short, short); virtual void getFieldName(char *, short, short); virtual void populate(); private: xbDbf *Data; static const char fieldSep; TNSCollection *Fields; }; #define cpBrowse "\x03\x03\x04\x05\x06" class xbTvBrowseCaption: public TView { private: xbTvBrowse *Browse; static const char fieldSep; public: xbTvBrowseCaption(const TRect &, xbTvBrowse*); virtual void draw(); }; class xbTvBrowseWindow : public TWindow { public: xbTvBrowseWindow(const TRect &, char *, xbTvBrowse *, int=0); ~xbTvBrowseWindow() { delete listBox; delete listScroller; } virtual void handleEvent(TEvent &); virtual void setRange() { listBox->setRange(); } xbTvBrowse *listBox; protected: private: TScrollBar *listScroller; }; #endif // __XB_TVBROWSE_H__ /* * Local Variables: * mode: c++ */ xbase-2.0.0/docs/0000777000000000000000000000000007316217200007254 5xbase-2.0.0/docs/Makefile.in0000644000000000000000000001204007316217200011232 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ GLINC = @GLINC@ GLLIB = @GLLIB@ LD = @LD@ LIBDL = @LIBDL@ LIBJPEG = @LIBJPEG@ LIBNSL = @LIBNSL@ LIBOBJS = @LIBOBJS@ LIBSOCKET = @LIBSOCKET@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ NM = @NM@ PACKAGE = @PACKAGE@ PAMINC = @PAMINC@ PAMLIBPATHS = @PAMLIBPATHS@ PAMLIBS = @PAMLIBS@ RANLIB = @RANLIB@ TVPROGS = @TVPROGS@ VERSION = @VERSION@ XPMINC = @XPMINC@ XPMLIB = @XPMLIB@ XSUBDIRS = @XSUBDIRS@ X_INCLUDES = @X_INCLUDES@ X_LDFLAGS = @X_LDFLAGS@ doxygen = @doxygen@ topdir = @topdir@ x_includes = @x_includes@ x_libraries = @x_libraries@ EXTRA_DIST = Makefile.am Makefile.in doxygen.cfg.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../xbase/xbconfig.h CONFIG_CLEAN_FILES = doxygen.cfg DIST_COMMON = Makefile.am Makefile.in doxygen.cfg.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status doxygen.cfg: $(top_builddir)/config.status doxygen.cfg.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = docs distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean all : docs docs : doxygen doxygen.cfg clean : -rm -r html -rm -r latex -rm -r man # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xbase-2.0.0/docs/Makefile.am0000644000000000000000000000022607316164657011245 all : docs docs : doxygen doxygen.cfg clean : -rm -r html -rm -r latex -rm -r man EXTRA_DIST = \ Makefile.am \ Makefile.in \ doxygen.cfg.in xbase-2.0.0/docs/doxygen.cfg.in0000644000000000000000000007043307215343140011743 # Doxyfile 1.2.3 # This file describes the settings to be used by doxygen for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # General configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "Xbase Class Library" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 2.0.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese, # Korean, Hungarian, Spanish, Romanian, Russian, Croatian, Polish, # Portuguese and Slovene. OUTPUT_LANGUAGE = English # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these class will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. It is allowed to use relative paths in the argument list. STRIP_FROM_PATH = # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a class diagram (in Html and LaTeX) for classes with base or # super classes. Setting the tag to NO turns the diagrams off. CLASS_DIAGRAMS = YES # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower case letters. If set to YES upper case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # users are adviced to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explict @brief command for a brief description. JAVADOC_AUTOBRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # reimplements. INHERIT_DOCS = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # The ENABLE_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../xbase # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. FILE_PATTERNS = *.cpp *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse. FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimised for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using a WORD or other. # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assigments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. Warning: This feature # is still experimental and very incomplete. GENERATE_XML = NO #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_PREDEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = #--------------------------------------------------------------------------- # Configuration::addtions related to external references #--------------------------------------------------------------------------- # The TAGFILES tag can be used to specify one or more tagfiles. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to # YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other # documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to # YES then doxygen will generate a graph for each documented header file showing # the documented files that directly or indirectly include this file INCLUDED_BY_GRAPH = YES # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found on the path. DOT_PATH = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES #--------------------------------------------------------------------------- # Configuration::addtions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO # The CGI_NAME tag should be the name of the CGI script that # starts the search engine (doxysearch) with the correct parameters. # A script with this name will be generated by doxygen. CGI_NAME = search.cgi # The CGI_URL tag should be the absolute URL to the directory where the # cgi binaries are located. See the documentation of your http daemon for # details. CGI_URL = # The DOC_URL tag should be the absolute URL to the directory where the # documentation is located. If left blank the absolute path to the # documentation, with file:// prepended to it, will be used. DOC_URL = # The DOC_ABSPATH tag should be the absolute path to the directory where the # documentation is located. If left blank the directory on the local machine # will be used. DOC_ABSPATH = # The BIN_ABSPATH tag must point to the directory where the doxysearch binary # is installed. BIN_ABSPATH = /usr/local/bin/ # The EXT_DOC_PATHS tag can be used to specify one or more paths to # documentation generated for other projects. This allows doxysearch to search # the documentation for these projects as well. EXT_DOC_PATHS =