commit 89c4cdb2d702028a4a5b32e62da4a9d49c9f65a7 Author: slidedraw Date: Wed Mar 20 15:31:36 2002 +0000 Initial revision diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..2bccd7e --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Charles Wyble diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + 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) + + 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) year 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. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..b42a17a --- /dev/null +++ b/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + 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 awhile. 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/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' 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. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + 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. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--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. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..e899a40 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = cole xlhtml ppthtml +EXTRA_DIST = README-xlhtml README-ppthtml + diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..3962c2b --- /dev/null +++ b/Makefile.in @@ -0,0 +1,360 @@ +# Makefile.in generated automatically by automake 1.4-p4 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +COLE_MAJOR = @COLE_MAJOR@ +COLE_MICRO = @COLE_MICRO@ +COLE_MINOR = @COLE_MINOR@ +HOST_ALIAS_NAME = @HOST_ALIAS_NAME@ +HOST_CANONICAL_NAME = @HOST_CANONICAL_NAME@ +HOST_CPU = @HOST_CPU@ +HOST_OS = @HOST_OS@ +HOST_VENDOR = @HOST_VENDOR@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +SUBDIRS = cole xlhtml ppthtml +EXTRA_DIST = README-xlhtml README-ppthtml +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ +Makefile.am Makefile.in NEWS aclocal.m4 config.guess config.h.in \ +config.sub configure configure.in install-sh missing mkinstalldirs + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --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 + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi +stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h \ + $(SHELL) ./config.status + @echo timestamp > stamp-h 2> /dev/null +$(srcdir)/config.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 config.h + +maintainer-clean-hdr: + +# 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) config.h.in $(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)config.h.in$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$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 +all-recursive-am: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +install-exec-am: +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: uninstall-recursive +all-am: Makefile config.h +all-redirect: all-recursive-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +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-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 + +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 \ +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 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-am \ +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: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..139597f --- /dev/null +++ b/README @@ -0,0 +1,2 @@ + + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..e68ffc8 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,145 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p4 + +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. + +# 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([,]))]) + +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + diff --git a/cole/AUTHORS b/cole/AUTHORS new file mode 100644 index 0000000..55e74da --- /dev/null +++ b/cole/AUTHORS @@ -0,0 +1,16 @@ + +Current maintainer: +******************* + +Roberto Arturo Tena Sanchez + + +Authors (Copyright owners): +*************************** + +Roberto Arturo Tena Sanchez +Andrew Scriven + + +See the file `THANKS' to see the contributors. + diff --git a/cole/BUGS b/cole/BUGS new file mode 100644 index 0000000..9cb436f --- /dev/null +++ b/cole/BUGS @@ -0,0 +1,31 @@ + +Report bugs to the maintainer (see the file `AUTHORS' for details). +Please, along with your detailed report, send the cole's output when compiled +using `--enable-verbose' (see the files `README' and `INSTALL' for details). + + +Current bugs: +************** + +None. + + +Fixed bugs: +************ + +Reported that cole can't read files biggers that 8Mb. UPDATE: oledecod.c is +changed now to read additional blocks to the bbd. This fixes the bug. + +Reported strange bug in cole 0.1.0 using Solaris using `../demo sprsheet.xls' +in examples directory. We need more test there! UPDATE: Seems to be fixed in +cole 1.0.0 with the endianess care code. + + +Possible bugs: +************** + +* cole is not reentrant safe (it's in TODO): + What happend if, in any program, one user tries to decode and/or code + two files (the same or diferent)? Because static vars, will it get + broke? I think yes, mmmh... + diff --git a/cole/COPYING b/cole/COPYING new file mode 100644 index 0000000..eeb586b --- /dev/null +++ b/cole/COPYING @@ -0,0 +1,340 @@ + 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. diff --git a/cole/ChangeLog b/cole/ChangeLog new file mode 100644 index 0000000..7bef452 --- /dev/null +++ b/cole/ChangeLog @@ -0,0 +1,539 @@ +1999-09-24 Arturo Tena + + * /usr/local/cvsroot/cole/NEWS: Documentation updated. + +1999-09-23 Arturo Tena + + * /usr/local/cvsroot/cole/TODO: Update documentation. + +1999-09-03 Arturo Tena + + * /usr/local/cvsroot/cole/examples/demo.c: + Fixed bug in open file name (x05 used instead 005). + +1999-09-02 Arturo Tena + + * /usr/local/cvsroot/cole/doc/tmpl/cole-unused.sgml: + Documentation updates. + +1999-08-31 Arturo Tena + + * /usr/local/cvsroot/cole/BUGS: Fixed --enable-verbose flag. + +1999-08-13 Arturo Tena + + * /usr/local/cvsroot/cole/README-CVS: Little bug fixed. + +1999-08-06 Arturo Tena + + * /usr/local/cvsroot/cole/utils/.cvsignore, /usr/local/cvsroot/cole/cole.c: + Changed documentation and ignored generated files. + +1999-08-05 Arturo Tena + + * /usr/local/cvsroot/cole/NEWS: Added news for cole 2.0.1. + +1999-08-02 Arturo Tena + + * /usr/local/cvsroot/cole/configure.in: + Changed version from 1.0.0 to 1.0.1. + + * /usr/local/cvsroot/cole/utils/Makefile.am, /usr/local/cvsroot/cole/utils/cole_extract.c: + New util. + +1999-07-29 Arturo Tena + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/cole.c: + Generated cole.h now includes stdio.h in order to get size_t. + +1999-07-27 Arturo Tena + + * /usr/local/cvsroot/cole/ChangeLog-from1to2, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/doc/legal.sgml: + Documentation updates. Added the ChangeLog-from1to2 for the ChangeLog entry "Updated to have the cole 2.0.0 tree. Old files have the tag before-cole-2-0-0-develop". + + * /usr/local/cvsroot/cole/doc/legal.sgml, /usr/local/cvsroot/cole/doc/tmpl/cole-unused.sgml, /usr/local/cvsroot/cole/doc/using.sgml, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/doc/bugs.sgml, /usr/local/cvsroot/cole/doc/introduction.sgml: + Documentation update, typo fixed. + +1999-07-26 Arturo Tena + + * /usr/local/cvsroot/cole/examples/.cvsignore, /usr/local/cvsroot/cole/utils/.cvsignore, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/oledecod.c: + Fixed a bug that prevented that the configure flag `--enable-verbose' be used. + + * /usr/local/cvsroot/cole/utils/cole_isfs.c, /usr/local/cvsroot/cole/utils/cole_tree.c, /usr/local/cvsroot/cole/examples/demo.c, /usr/local/cvsroot/cole/examples/directory.c, /usr/local/cvsroot/cole/examples/file.c, /usr/local/cvsroot/cole/examples/filesystem.c, /usr/local/cvsroot/cole/doc/tmpl/api.sgml, /usr/local/cvsroot/cole/doc/tmpl/cole-unused.sgml, /usr/local/cvsroot/cole/doc/compile.sgml, /usr/local/cvsroot/cole/doc/introduction.sgml, /usr/local/cvsroot/cole/doc/legal.sgml, /usr/local/cvsroot/cole/doc/using.sgml, /usr/local/cvsroot/cole/doc/cole-sections.txt, /usr/local/cvsroot/cole/doc/HACKING, /usr/local/cvsroot/cole/doc/cole-manual.sgml, /usr/local/cvsroot/cole/olecod.c, /usr/local/cvsroot/cole/oledecod.c, /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/internal.h, /usr/local/cvsroot/cole/cole.c, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/NEWS: + Added -O0 to, and deleted -Werror from, --cole-debug configure flag. + Fixed some little things to not get many warnings when used --cole-debug. + (cole_frewind, cole_fsize): Created. + Tests for cole_fseek, cole_fsize and cole_frewind in examples/file.c. + (cole_ferror, cole_fclearerror): Deleted, since they are not necessary because fread and fwrite returns the exact error, if any. + (__OLEcode): Prototype deleted from internal.h, now it's useless. Comment about exit codes is now in olecod.c. + Created _COLE_TYPE_FILE, _COLE_TYPE_DIR and _COLE_TYPE_ROOT. + (cole_direntry_isdir, cole_direntry_isfile): Now uses _COLE_TYPE_FILE and _COLE_TYPE_DIR. + Documentation update. + +1999-07-24 Arturo Tena + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/internal.h, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/cole.c: + New errors: COLE_EFSEEKDELTA and COLE_EFSEEKFLAG. + New field in struct _COLEFILE: filesize. + New type: COLE_SEEK_FLAG. + (cole_fseek): Created. + (cole_fopen_direntry): Fill filesize. + (cole_feof): Change to use filesize. + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/cole.c: + Now position the file position indicator before every read, in preparation for cole_fseek. + + * /usr/local/cvsroot/cole/examples/file.c, /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/doc/HACKING, /usr/local/cvsroot/cole/cole.c (cole_ftell): + Created. + + * /usr/local/cvsroot/cole/internal.h, /usr/local/cvsroot/cole/cole.c (cole_fopen_direntry, cole_fread, cole_feof): + Added file pointer position pos field to struct _COLEFILE and modified related functions. + +1999-07-23 Arturo Tena + + * /usr/local/cvsroot/cole/support.h: Changed preferences for types. + + * /usr/local/cvsroot/cole/TODO: Documentation updated. + + * /usr/local/cvsroot/cole/examples/README-examples, /usr/local/cvsroot/cole/doc/introduction.sgml, /usr/local/cvsroot/cole/THANKS, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/AUTHORS, /usr/local/cvsroot/cole/BUGS, /usr/local/cvsroot/cole/NEWS, /usr/local/cvsroot/cole/README: + Documentation updates. + + * /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/examples/demo.c: + Added version example. + + * /usr/local/cvsroot/cole/examples/file.c, /usr/local/cvsroot/cole/examples/read.c, /usr/local/cvsroot/cole/examples/travel.c, /usr/local/cvsroot/cole/doc/HACKING, /usr/local/cvsroot/cole/doc/using.sgml, /usr/local/cvsroot/cole/examples/Makefile.am, /usr/local/cvsroot/cole/examples/directory.c, /usr/local/cvsroot/cole/TODO: + Changed example names. Updated documentation. + + * /usr/local/cvsroot/cole/utils/iscolefs.c, /usr/local/cvsroot/cole/utils/cole_isfs.c, /usr/local/cvsroot/cole/utils/cole_isfs_fast.c, /usr/local/cvsroot/cole/utils/cole_tree.c, /usr/local/cvsroot/cole/utils/coletree.c, /usr/local/cvsroot/cole/examples/travel.c, /usr/local/cvsroot/cole/examples/version.c, /usr/local/cvsroot/cole/utils/Makefile.am, /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/examples/Makefile.am, /usr/local/cvsroot/cole/examples/filesystem.c, /usr/local/cvsroot/cole/examples/read.c, /usr/local/cvsroot/cole/TODO: + New examples, some utils changed its name. + + * /usr/local/cvsroot/cole/examples/text.doc: Incrusted one object. + + * /usr/local/cvsroot/cole/utils/iscolefs.c, /usr/local/cvsroot/cole/cole.c: + Changed error names to COLE_E, ended the change in all code. + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/doc/tmpl/api.sgml, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/cole.c: + Changed some errors names to COLE_E, missing a lot. + + * /usr/local/cvsroot/cole/doc/tmpl/api.sgml, /usr/local/cvsroot/cole/examples/read.c, /usr/local/cvsroot/cole/BUGS, /usr/local/cvsroot/cole/TODO: + Documentation changes. + + * /usr/local/cvsroot/cole/cole.c (__cole_locate_filename_indirentry): + Now cole_locate_filename works with a filename of a directory ending with '/'. + +1999-07-22 Arturo Tena + + * /usr/local/cvsroot/cole/cole.c, /usr/local/cvsroot/cole/examples/read.c, /usr/local/cvsroot/cole/TODO (__cole_recurse_tree): + Fixed bug that prevent to cole_fopen() to open files in subdirectories. + + * /usr/local/cvsroot/cole/examples/read.c, /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/internal.c, /usr/local/cvsroot/cole/internal.h, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/cole.c: + Error codes COLE_FILENAMEISNOTFILE, COLE_BROKENFILENAME and COLE_FILENAMEISNOTFILE created. + Created COLE_LOCATE_ACTION_FUNC type. + (cole_perror): Added messages for new error codes. + (__cole_locate_entry): renamed to cole_locate_filename and made public. + (cole_fopen): Now use cole_locate_filename(), and can open files in subdirectories. + +1999-07-21 Arturo Tena + + * /usr/local/cvsroot/cole/doc/Makefile.am, /usr/local/cvsroot/cole/internal.c, /usr/local/cvsroot/cole/internal.h, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/cole.c, /usr/local/cvsroot/cole/Makefile.am (__cole_locate_entry): + first hacks, it doesn't work yet. + olecod.c is not compiled now. + Now dist target works again. + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/cole.c: + Created COLE_RECURSE_VISIT_DIR_FUNC type. + (cole_recurse_tree): Added visitdir argument. All callers changed. + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/cole.c: + Created COLE_RECURSE_DIR_FUNC and COLE_RECURSE_DIRENT_FUNC types. + (cole_recurse_tree, __cole_recurse_tree): changed function pointer arguments to COLE_RECURSE_DIR_FUNC and COLE_RECURSE_DIRENT_FUNC. All callers changed. + + * /usr/local/cvsroot/cole/cole.c (cole_recurse_tree): + now takes colerrno argument of cole_closedir appropiately. + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/cole.c (cole_recurse_tree): + Changed `COLERRNO *' at the end, to be standard. + +1999-07-20 Arturo Tena + + * /usr/local/cvsroot/cole/doc/.cvsignore, /usr/local/cvsroot/cole/examples/.cvsignore, /usr/local/cvsroot/cole/utils/.cvsignore, /usr/local/cvsroot/cole/.cvsignore: + Ignore generated files in CVS. + + * /usr/local/cvsroot/cole/examples/demo.c, /usr/local/cvsroot/cole/examples/travel.c, /usr/local/cvsroot/cole/doc/cole-sections.txt, /usr/local/cvsroot/cole/cole.c, /usr/local/cvsroot/cole/cole.h.in (cole_opendir): + Renamed to cole_opendir_rootdir. + +1999-07-17 Arturo Tena + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/internal.c, /usr/local/cvsroot/cole/cole.c (__cole_locate_entry): + new functions, only created the squeleton. + (cole_recurse_tree, __cole_recurse_tree): new functions. + (__cole_print_tree_inroot, __cole_print_tree_indirentry, __cole_print_tree_indir, __cole_print_tree_outdir): new functions. + (cole_print_tree): rewritten using cole_recurse_tree and __cole_print_tree_inroot, __cole_print_tree_indirentry, __cole_print_tree_indir and __cole_print_tree_outdir calls. + (__cole_print_tree): deleted. + +1999-07-16 Arturo Tena + + * /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/examples/demo.c, /usr/local/cvsroot/cole/examples/read.c, /usr/local/cvsroot/cole/examples/travel.c, /usr/local/cvsroot/cole/cole.c, /usr/local/cvsroot/cole/TODO (cole_fread, cole_dir_getsize, cole_direntry_getsize): + Sizes are now size_t, which is more correct. + +1999-07-15 Arturo Tena + + * /usr/local/cvsroot/cole/utils/.cvsignore, /usr/local/cvsroot/cole/.cvsignore: + Added ignore files for CVS. + + * /usr/local/cvsroot/cole/cole.c (__cole_print_tree): + Changed tree print style to somewhat better looking. + +1999-07-14 Arturo Tena + + * /usr/local/cvsroot/cole/cole.c (cole_print_tree): + Fixed bug, now returns zero or no zero apropiately. + +1999-07-13 Arturo Tena + + * /usr/local/cvsroot/cole/utils/coletree.c, /usr/local/cvsroot/cole/utils/iscolefs.c, /usr/local/cvsroot/cole/examples/travel.c, /usr/local/cvsroot/cole/utils/Makefile.am, /usr/local/cvsroot/cole/examples/demo.c, /usr/local/cvsroot/cole/examples/read.c, /usr/local/cvsroot/cole/examples/topsrcdir.h.in, /usr/local/cvsroot/cole/doc/tmpl/internals.sgml, /usr/local/cvsroot/cole/examples/Makefile.am, /usr/local/cvsroot/cole/examples/README-examples, /usr/local/cvsroot/cole/doc/tmpl/.cvsignore, /usr/local/cvsroot/cole/doc/tmpl/api.sgml, /usr/local/cvsroot/cole/doc/tmpl/cole-unused.sgml, /usr/local/cvsroot/cole/doc/introduction.sgml, /usr/local/cvsroot/cole/doc/legal.sgml, /usr/local/cvsroot/cole/doc/using.sgml, /usr/local/cvsroot/cole/doc/cole-sections.txt, /usr/local/cvsroot/cole/doc/compile.sgml, /usr/local/cvsroot/cole/doc/gpl.sgml, /usr/local/cvsroot/cole/doc/cole-manual.sgml-old, /usr/local/cvsroot/cole/doc/bugs.sgml, /usr/local/cvsroot/cole/doc/cole-manual.sgml, /usr/local/cvsroot/cole/doc/HACKING, /usr/local/cvsroot/cole/doc/Makefile.am, /usr/local/cvsroot/cole/version.c.in, /usr/local/cvsroot/cole/support.h, /usr/local/cvsroot/cole/test.c, /usr/local/cvsroot/cole/test.sh, /usr/local/cvsroot/cole/oledecod.h, /usr/local/cvsroot/cole/support.c, /usr/local/cvsroot/cole/olecod.h, /usr/local/cvsroot/cole/oledecod.c, /usr/local/cvsroot/cole/internal.h, /usr/local/cvsroot/cole/olecod.c, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/demo.c, /usr/local/cvsroot/cole/internal.c, /usr/local/cvsroot/cole/cole.h.in, /usr/local/cvsroot/cole/cole.lsm, /usr/local/cvsroot/cole/cole.m4, /usr/local/cvsroot/cole/cole.spec.in, /usr/local/cvsroot/cole/cole.c, /usr/local/cvsroot/cole/cole.h, /usr/local/cvsroot/cole/acconfig.h, /usr/local/cvsroot/cole/autogen.sh, /usr/local/cvsroot/cole/cole-config.in, /usr/local/cvsroot/cole/README-CVS, /usr/local/cvsroot/cole/README-samples, /usr/local/cvsroot/cole/THANKS, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/NEWS, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/BUGS, /usr/local/cvsroot/cole/DOWNLOAD, /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/AUTHORS, /usr/local/cvsroot/cole/.cvsignore: + Updated to have the cole 2.0.0 tree. Old files have the tag before-cole-2-0-0-develop. + +1999-06-25 Arturo Tena + + * /usr/local/cvsroot/cole/oledecod.c: + Little hack to read files larger than 7Mb. + + * /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/doc/Makefile.am, /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/NEWS: + Fixed, now it compiles under Solaris, doc target disabled. + +1999-06-24 Arturo Tena + + * /usr/local/cvsroot/cole/NEWS: Added entry for 1.0.1 release. + + * /usr/local/cvsroot/cole/ChangeLog: + ChangeLog removed, it can be removed using rcs2log. + +1999-06-23 Arturo Tena + + * /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/doc/Makefile.am: + Hack to allow Solaris make doesn't regenerate cole-manual directory. + + * /usr/local/cvsroot/cole/TODO: Updated. + + * /usr/local/cvsroot/cole/doc/Makefile.am: + Fixed test -e doesn't work in some systems. + +1999-06-18 Arturo Tena + + * /usr/local/cvsroot/cole/TODO: Updated TODO. + + * /usr/local/cvsroot/cole/cole.lsm: Updated .tar.gz size + + * /usr/local/cvsroot/cole/cole.lsm: Fixed metalab directory name. + +1999-06-17 Arturo Tena + + * /usr/local/cvsroot/cole/ChangeLog: *** empty log message *** + + * /usr/local/cvsroot/cole/doc/cole-manual.sgml: + "Officially" end the documentation. + + * /usr/local/cvsroot/cole/doc/Makefile.am: Integrated db2html call. + + * /usr/local/cvsroot/cole/TODO: Typo fixed. + + * /usr/local/cvsroot/cole/TODO: Updated TODO. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/doc/Makefile.am: + Now it includes cole.lsm in the distribution. + + * /usr/local/cvsroot/cole/HACKING: Updated libtool version. + + * /usr/local/cvsroot/cole/cole.lsm: + Test with Emacs version control system. + + * /usr/local/cvsroot/cole/cole.lsm: Test with vc CVS Emacs functions. + + * /usr/local/cvsroot/cole/cole.lsm: Test with emacs vc CVS mode. + + * /usr/local/cvsroot/cole/doc/cole-manual.sgml, /usr/local/cvsroot/cole/oledecod.h, /usr/local/cvsroot/cole/support.c, /usr/local/cvsroot/cole/support.h, /usr/local/cvsroot/cole/olecod.h, /usr/local/cvsroot/cole/oledecod.c, /usr/local/cvsroot/cole/olecod.c, /usr/local/cvsroot/cole/autogen.sh, /usr/local/cvsroot/cole/cole.h, /usr/local/cvsroot/cole/cole.spec.in, /usr/local/cvsroot/cole/README-samples, /usr/local/cvsroot/cole/THANKS, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/NEWS, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/README-CVS, /usr/local/cvsroot/cole/BUGS, /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/Makefile.am: + filters@centauri.lci.ulsa.mx erased from code. Little documentation style changes. + +1999-06-16 Arturo Tena + + * /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/cole.lsm: + Updated TODO and cole.lsm. + + * /usr/local/cvsroot/cole/doc/cole-manual.sgml, /usr/local/cvsroot/cole/doc/Makefile.am, /usr/local/cvsroot/cole/support.c, /usr/local/cvsroot/cole/support.h, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/cole.lsm, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/ChangeLog, /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/NEWS, /usr/local/cvsroot/cole/BUGS: + Added 2 examples to documentation. Changed version number from 0.2.0 to 1.0.0. Changelog truncated, it will be autogenerated anyway. Now install all the necessary headers. README updated. Added .lsm file, to MetaLab archive. Fixed make clean, it now don't delete documentation. + +1999-06-15 Arturo Tena + + * /usr/local/cvsroot/cole/examples/.cvsignore, /usr/local/cvsroot/cole/examples/Makefile.in, /usr/local/cvsroot/cole/doc/cole-manual.sgml: + Updated documentation: added one example. + +1999-05-21 Arturo Tena + + * /usr/local/cvsroot/cole/examples/Makefile.in, /usr/local/cvsroot/cole/examples/Makefile.am, /usr/local/cvsroot/cole/doc/Makefile.am, /usr/local/cvsroot/cole/doc/cole-manual.sgml, /usr/local/cvsroot/cole/test.sh, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/configure.in: + cole documentation a lot improved a lot. Fixed make distcheck target. + + * /usr/local/cvsroot/cole/doc/API: Changed to cole-2.0 tree. + +1999-04-29 Arturo Tena + + * /usr/local/cvsroot/cole/doc/cole-manual.sgml: + Changed most-recent-stable-version entity to this-release. + + * /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/doc/cole-manual.sgml: + Updated documentation, not finished yet: missing API. + + * /usr/local/cvsroot/cole/test.sh: Removed Id tag. + + * /usr/local/cvsroot/cole/doc/Makefile.am: Added RTF rule. + + * /usr/local/cvsroot/cole/doc/.cvsignore, /usr/local/cvsroot/cole/.cvsignore: + Ignore *.swp files. + + * /usr/local/cvsroot/cole/README: Little typo. + +1999-04-28 Arturo Tena + + * /usr/local/cvsroot/cole/doc/Makefile.am: + Added forgotten clean-local rule on doc/. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/configure.in: + Updated required autoconf and automake versions, and removing ranlib test in configure because it's not needed. + +1999-04-27 Arturo Tena + + * /usr/local/cvsroot/cole/doc/.cvsignore, /usr/local/cvsroot/cole/.cvsignore: + Ignore autogenerated files in CVS commit. + + * /usr/local/cvsroot/cole/README-CVS: Added CVS instructions. + + * /usr/local/cvsroot/cole/doc/Makefile.in, /usr/local/cvsroot/cole/mkinstalldirs, /usr/local/cvsroot/cole/stamp-h.in, /usr/local/cvsroot/cole/missing, /usr/local/cvsroot/cole/ltmain.sh, /usr/local/cvsroot/cole/ltconfig, /usr/local/cvsroot/cole/install-sh, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/config.sub, /usr/local/cvsroot/cole/config.guess, /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/autogen.sh, /usr/local/cvsroot/cole/coleconfig.hin, /usr/local/cvsroot/cole/Makefile.in: + Removed autogenerated files, now must use autogen.sh each time we checkout from CVS. + +1999-04-22 Arturo Tena + + * /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/doc/Makefile.in, /usr/local/cvsroot/cole/coleconfig.hin, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/acconfig.h, /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/Makefile.am: + Downgrade to automake-1.3, autoconf-2.12 and libtool-1.2b, for compatibility. + +1999-04-16 Arturo Tena + + * /usr/local/cvsroot/cole/doc/API: Little API cleanup. + +1999-04-15 Arturo Tena + + * /usr/local/cvsroot/cole/doc/API: Little changes. + +1999-04-14 Arturo Tena + + * /usr/local/cvsroot/cole/doc/API: Better API, more self-consistent. + + * /usr/local/cvsroot/cole/ChangeLog: ChangeLog updated. + + * /usr/local/cvsroot/cole/ChangeLog: Snapshot cole-SNAP-19990414. + + * /usr/local/cvsroot/cole/doc/API: New API purpose. + + * /usr/local/cvsroot/cole/ChangeLog: ChangeLog updated. + + * /usr/local/cvsroot/cole/ChangeLog: Snapshot cole-SNAP-19990414. + + * /usr/local/cvsroot/cole/doc/cole-manual.sgml, /usr/local/cvsroot/cole/doc/Makefile.in, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/coleconfig.hin, /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/Makefile.in: + It now compile on tenix.lci.ulsa.mx again. + +1999-04-12 Arturo Tena + + * /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/USING, /usr/local/cvsroot/cole/doc/cole-manual.sgml: + Agregationg stuff to documentation. + + * /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in: + Replacing version with release. + + * /usr/local/cvsroot/cole/Makefile.in: + Removed USING file from EXTRA_DIST. + + * /usr/local/cvsroot/cole/Makefile.am: + Deleting USING file for EXTRA_DIST. + +1999-04-07 Arturo Tena + + * /usr/local/cvsroot/cole/doc/Makefile.in, /usr/local/cvsroot/cole/doc/Makefile.am: + cole-manual dir now is make if not found. + + * /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/doc/Makefile.am, /usr/local/cvsroot/cole/doc/Makefile.in, /usr/local/cvsroot/cole/doc/cole-manual.sgml, /usr/local/cvsroot/cole/HACKING: + cole-manual.sgml added. + + * /usr/local/cvsroot/cole/README: Fixed typo. + +1999-04-06 Arturo Tena + + * /usr/local/cvsroot/cole/BUGS, /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/NEWS, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/README-samples, /usr/local/cvsroot/cole/THANKS, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/cole.spec.in, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/AUTHORS: + Better and updated documentation and cole.spec.in. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/cole.spec.in, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in: + Added a working cole.spec.in. + +1999-04-03 Arturo Tena + + * /usr/local/cvsroot/cole/ChangeLog: ChangeLog updated. + + * /usr/local/cvsroot/cole/ChangeLog: Snapshot cole-SNAP-19990403. + + * /usr/local/cvsroot/cole/configure: CVS configure confict. + + * /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/configure: + Fixed VERSION_INFO defines. + + * /usr/local/cvsroot/cole/configure.in: Little changtes in comments. + + * /usr/local/cvsroot/cole/Makefile.am: Little changes to commentes. + +1999-04-02 Arturo Tena + + * /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/Makefile.am: + Added rule to allow includes be installed + + * /usr/local/cvsroot/cole/ChangeLog: ChangeLog updated. + + * /usr/local/cvsroot/cole/ChangeLog: Release cole-0.2.0. + + * /usr/local/cvsroot/cole/ChangeLog: ChangeLog updated. + + * /usr/local/cvsroot/cole/ChangeLog: Snapshot cole-SNAP-19990402. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Typo fixed. + + * /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/Makefile.am: + Little ChangeLog changes. + + * /usr/local/cvsroot/cole/ChangeLog: ChangeLog updated. + + * /usr/local/cvsroot/cole/ChangeLog: Release snapshot cole-19990402. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Some trickies to get Release entry in ChangeLog in the releases files itself. + + * /usr/local/cvsroot/cole/ChangeLog, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Run aclocal, automake and autoconf before make distcheck run them when doing target make cvs-snap and make cvs-dist. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Fixed writting more usefull entries in ChangeLog code. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Write more usefull log entries in ChangeLog when releasing or making a snapshot. + + * /usr/local/cvsroot/cole/ChangeLog: Updated ChangeLog to release + + * /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/Makefile.am: + Updated make cvs-dist to use cvs export. Fixed. + + * /usr/local/cvsroot/cole/ChangeLog: Updated ChangeLog to release + + * /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/Makefile.am: + Updated make cvs-dist to use cvs export. + + * /usr/local/cvsroot/cole/ChangeLog: Updated ChangeLog + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Removing some not necessary make distcheck from make cvs-snap target. + + * /usr/local/cvsroot/cole/ChangeLog: Updated ChangeLog + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Typo error fixed. + + * /usr/local/cvsroot/cole/Makefile.in: + Once again commiting Makefile.in. If I have more problems, I will remove it from CVS. The same goes to configure. + + * /usr/local/cvsroot/cole/Makefile.in: + Add updated autogenerated files. Now I know why Gnome & KDE doesn't have Makefile.in and configure files in CVS. =/ + + * /usr/local/cvsroot/cole/ChangeLog: + Added ChangeLog again. I'm seeing if we can ignore it via .cvsignore, but automake requires it + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/ChangeLog: + Added changelog rule wich generate ChangeLog using rcs2log. + + * /usr/local/cvsroot/cole/.cvsignore: + Added to ignore ChangeLog (will be autogenerated when making the distributions). + + * /usr/local/cvsroot/cole/THANKS, /usr/local/cvsroot/cole/AUTHORS: + Changed contributor from AUTHORS to THANKS. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/configure: + Fixed the maintainer targets + + * /usr/local/cvsroot/cole/NEWS, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in: + Changed VERSION var to not contain SNAP word. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + First cvs-snap target try. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Removing CHANGES from EXTRA_DIST list. + + * /usr/local/cvsroot/cole/NEWS: Little typo. + + * /usr/local/cvsroot/cole/NEWS, /usr/local/cvsroot/cole/CHANGES, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Added some maintainer targets. Not all have been checked. + + * /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in: + Now make dist incorporate examples directory: we have to update automake =). README little updated. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/ltconfig, /usr/local/cvsroot/cole/ltmain.sh, /usr/local/cvsroot/cole/stamp-h, /usr/local/cvsroot/cole/test.sh: + Added some missing files. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in: + Added make check target. Some typo fixed. + +1999-04-01 Arturo Tena + + * /usr/local/cvsroot/cole/VERSION.in: + Removed because I couldn't get working. + + * /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/VERSION, /usr/local/cvsroot/cole/VERSION.in, /usr/local/cvsroot/cole/configure: + Now it have a working soname (compatibility version) system. This is usefull when working with shared libraries. VERSION file will be autogenerated. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/coleconfig.hin, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in: + Added libtool support. Shared libraries are disabled by default. + + * /usr/local/cvsroot/cole/Makefile.am, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/NEWS, /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/coleconfig.hin, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/missing, /usr/local/cvsroot/cole/ChangeLog: + Now cole is semi-automakeified. Only missing make check target. + + * /usr/local/cvsroot/cole/Makefile.am: Missing Makefile.am =) + + * /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in: + Changes just before run automake --add-missing + + * /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/acconfig.h, /usr/local/cvsroot/cole/coleconfig.hin, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in: + Introduced compatibility issues. + + * /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/configure.in: + Added a bunch of configuration stuff, such as version defines and compatibility version defines. + +1999-03-30 Arturo Tena + + * /usr/local/cvsroot/cole/examples/present.sdd, /usr/local/cvsroot/cole/examples/sprsheet.sdc, /usr/local/cvsroot/cole/examples/sprsheet.xls, /usr/local/cvsroot/cole/examples/text.doc, /usr/local/cvsroot/cole/examples/text.sdw: + Added a bunch of binary examples. Hope cvs handle this ok. =) + +1999-03-28 Arturo Tena + + * /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/Makefile.in: + Cleaning up configure stuff. + + * /usr/local/cvsroot/cole/Makefile.in: + Fixed install mesage reporting wrong libdir. + + * /usr/local/cvsroot/cole/ChangeLog: + ChangeLog removed, it will be autogenerated from cvs instead. + +1999-03-27 Arturo Tena + + * /usr/local/cvsroot/cole/ChangeLog: Added ChangeLog + + * /usr/local/cvsroot/cole/AUTHORS, /usr/local/cvsroot/cole/BUGS, /usr/local/cvsroot/cole/CHANGES, /usr/local/cvsroot/cole/COPYING, /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/INSTALL, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/README-samples, /usr/local/cvsroot/cole/THANKS, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/USING, /usr/local/cvsroot/cole/VERSION, /usr/local/cvsroot/cole/acconfig.h, /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/cole.h, /usr/local/cvsroot/cole/coleconfig.hin, /usr/local/cvsroot/cole/config.guess, /usr/local/cvsroot/cole/config.sub, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/demo.c, /usr/local/cvsroot/cole/install-sh, /usr/local/cvsroot/cole/mkinstalldirs, /usr/local/cvsroot/cole/olecod.c, /usr/local/cvsroot/cole/olecod.h, /usr/local/cvsroot/cole/oledecod.c, /usr/local/cvsroot/cole/oledecod.h, /usr/local/cvsroot/cole/stamp-h, /usr/local/cvsroot/cole/stamp-h.in, /usr/local/cvsroot/cole/support.c, /usr/local/cvsroot/cole/support.h, /usr/local/cvsroot/cole/test.c: + Imported sources from snap cole-0.2.0 + + * /usr/local/cvsroot/cole/AUTHORS, /usr/local/cvsroot/cole/BUGS, /usr/local/cvsroot/cole/CHANGES, /usr/local/cvsroot/cole/COPYING, /usr/local/cvsroot/cole/HACKING, /usr/local/cvsroot/cole/INSTALL, /usr/local/cvsroot/cole/Makefile.in, /usr/local/cvsroot/cole/README, /usr/local/cvsroot/cole/README-samples, /usr/local/cvsroot/cole/THANKS, /usr/local/cvsroot/cole/TODO, /usr/local/cvsroot/cole/USING, /usr/local/cvsroot/cole/VERSION, /usr/local/cvsroot/cole/acconfig.h, /usr/local/cvsroot/cole/aclocal.m4, /usr/local/cvsroot/cole/cole.h, /usr/local/cvsroot/cole/coleconfig.hin, /usr/local/cvsroot/cole/config.guess, /usr/local/cvsroot/cole/config.sub, /usr/local/cvsroot/cole/configure, /usr/local/cvsroot/cole/configure.in, /usr/local/cvsroot/cole/demo.c, /usr/local/cvsroot/cole/install-sh, /usr/local/cvsroot/cole/mkinstalldirs, /usr/local/cvsroot/cole/olecod.c, /usr/local/cvsroot/cole/olecod.h, /usr/local/cvsroot/cole/oledecod.c, /usr/local/cvsroot/cole/oledecod.h, /usr/local/cvsroot/cole/stamp-h, /usr/local/cvsroot/cole/stamp-h.in, /usr/local/cvsroot/cole/support.c, /usr/local/cvsroot/cole/support.h, /usr/local/cvsroot/cole/test.c: + New file. + diff --git a/cole/ChangeLog-from1to2 b/cole/ChangeLog-from1to2 new file mode 100644 index 0000000..8c7869c --- /dev/null +++ b/cole/ChangeLog-from1to2 @@ -0,0 +1,55 @@ + +2.0.0x Seems to me that all public calls that need colerrno have it. + +2.0.0w Added cole_feof, cole_ferror and cole_fclearerr calls. Added COLERRNO to more public calls. + +2.0.0v Created cole_opendir_direntry. Changed COLEDIR->dir to COLEDIR->entry, in all source. Renamed cole_direntry to cole_visiteddirentry. Changed cole_print_tree implentation to call cole API 2.x, instead old verbosePPSTree. Changed verbosePPSTree to be static to oledecod.c, private. Added COLERRNO *colerrno to more public calls. + +2.0.0u Added COLERRNO * colerrno to some public calls that need it. Added the target regenerate-all to doc/Makefile, it calls templates, sgml and html. Created cole_perror call. Changed `file system' by `filesystem' in sources. sbfilename is now stored in COLEFS->sbfilename instead tree[0].filename, which need add a argument to __OLEdecode. + +2.0.0t Fixed a check that prevent to mount FlashPix files. Removed one argument from cole_fopen_direntry call, because was not needed. Renamed OLEdecode and OLEcode to __OLEdecode and __OLEcode. More documentation. + +2.0.0s More documentation. + +2.0.0r Documentation changes and doc/Makefile targets now modifies source files, because the GNU standards says that if a file is in distribution and is modifed, must be leaved in distribution. And yes, they're right =). Improved configure flags. More documentation. + +2.0.0q Now can use inline functions if compiler accept it. + +2.0.0p Documentation is now autogenerated from sources by gtk-doc. + +2.0.0o Documentation changes. Fixed autoconf.sh bug. + +2.0.0n Deleted test.c and test.sh, because both were outdated. coleconfig.h generated file moved to the more standard name config.h. Deleted acconfig.h, because the autoconf version used generate the entries appropiately in config.h. Documentation little updated. Deleted examples/mount.c because was not useful. Updated cole.spec.in. README rewritten. Moved HACKING file to doc directory. Deleted cole.lsm, because it's hard to maintain. README-samples renamed to README-examples and moved to examples directory. cole.spec.in works now. cole.m4 is installed now. Added CANONICAL_HOST_NAME, HOST_ALIAS_NAME, HOST_CPU, HOST_VENDOR, HOST_OS configure vars. Created cole_host_info var. Changed dump memory function. Added a util: iscolefs. + +2.0.0m demo.c is now in examples, but it's not a test. Added the filename argument to cole_fopen. Created cole_fopen_direntry and cole_fread calls. + +2.0.0l Changed OLEdecode sign, now exposes BDepot, SDepot, sbfile and input. Those are saved while mounting. freeOLEtree doesn't take care about them, but are disposed and closed when umounting. Reordered timestamps in demo and travel, because we have 2 timestamps! start field of pps_entry is now public. + +2.0.0k Changed oledecod.c and cole.c so: + 1) only the sbfile is extracted at mount time (no extract all the + files). + 2) sbfilename is stored in tree[root].filename. + 3) remove sbfile at umount time. + 4) no try to remove the files when doing freeOLEtree when umounting. +2.0.0j Changed COLEFILE by COLEFS and colefile by colefilesystem in all the + source code. Changed file field by fs field in struct _COLEDIR in + cole.h.in and cole.c. Created cole_fopen and cole_fclose calls. +2.0.0i Little cosmetic changes in cole.h.in, besides added + cole_direntry_getsec1, cole_direntry_getsec2, cole_direntry_getdays1 and + cole_direntry_getdays2 calls in demo.c. +2.0.0h Added cole_direntry_isdir, cole_direntry_isfile, cole_direntry_getsize, + cole_direntry_getsec1, cole_direntry_getsec2, cole_direntry_getdays1 and + cole_direntry_getdays2 calls. +2.0.0g Added a utils directory. Added cole_opendir, cole_closedir, + cole_direntry, cole_nextdirentry and cole_direntry_getname calls. + Added COLEDIR and COLEDIRENT opaque data types. +2.0.0f Added AM_PATH_COLE m4 macro in cole.m4, with versioning C macros and + global variables exported. Added cole-config script. +2.0.0e Changed API 2 code to cole.c. Added a test in examples directory. +2.0.0d Deleted olecod.h and wrote it in include.h. +2.0.0c Deleted oledecod.h and wrote it in include.h. +2.0.0b Reorganizated includes: now cole.h have all that a user needs. +2.0.0a Created cole_mount, cole_umount and cole_debug_verbose_tree calls in + oledecod.c and oledecod.h. Modified demo.c too. +2.0.0pre-a Added code to decode Extended Block Depot. + diff --git a/cole/DOWNLOAD b/cole/DOWNLOAD new file mode 100644 index 0000000..b50f202 --- /dev/null +++ b/cole/DOWNLOAD @@ -0,0 +1,6 @@ + +cole's WWW home page is in: + + +There you will find references to the most recent version of cole' source code. + diff --git a/cole/INSTALL b/cole/INSTALL new file mode 100644 index 0000000..b42a17a --- /dev/null +++ b/cole/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + 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 awhile. 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/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' 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. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + 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. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--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. diff --git a/cole/Makefile.am b/cole/Makefile.am new file mode 100644 index 0000000..339d48e --- /dev/null +++ b/cole/Makefile.am @@ -0,0 +1,8 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = README-cole README-CVS DOWNLOAD ChangeLog ChangeLog-from1to2 TODO THANKS AUTHORS BUGS doc/* examples/* utils/* + +noinst_LIBRARIES = libcole.a +libcole_a_SOURCES = cole.c internal.c oledecod.c olecod.c support.c version.c internal.h support.h +AM_CFLAGS = -Wall -Wcast-align -Wpointer-arith + diff --git a/cole/Makefile.in b/cole/Makefile.in new file mode 100644 index 0000000..f08b78b --- /dev/null +++ b/cole/Makefile.in @@ -0,0 +1,276 @@ +# Makefile.in generated automatically by automake 1.4-p4 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +COLE_MAJOR = @COLE_MAJOR@ +COLE_MICRO = @COLE_MICRO@ +COLE_MINOR = @COLE_MINOR@ +HOST_ALIAS_NAME = @HOST_ALIAS_NAME@ +HOST_CANONICAL_NAME = @HOST_CANONICAL_NAME@ +HOST_CPU = @HOST_CPU@ +HOST_OS = @HOST_OS@ +HOST_VENDOR = @HOST_VENDOR@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +EXTRA_DIST = README-cole README-CVS DOWNLOAD ChangeLog ChangeLog-from1to2 TODO THANKS AUTHORS BUGS doc/* examples/* utils/* + +noinst_LIBRARIES = libcole.a +libcole_a_SOURCES = cole.c internal.c oledecod.c olecod.c support.c version.c internal.h support.h +AM_CFLAGS = -Wall -Wcast-align -Wpointer-arith +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = version.c cole.h +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +libcole_a_LIBADD = +libcole_a_OBJECTS = cole.o internal.o oledecod.o olecod.o support.o \ +version.o +AR = ar +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in \ +NEWS THANKS TODO cole.h.in version.c.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(libcole_a_SOURCES) +OBJECTS = $(libcole_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps cole/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +version.c: $(top_builddir)/config.status version.c.in + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status +cole.h: $(top_builddir)/config.status cole.h.in + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.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: + +libcole.a: $(libcole_a_OBJECTS) $(libcole_a_DEPENDENCIES) + -rm -f libcole.a + $(AR) cru libcole.a $(libcole_a_OBJECTS) $(libcole_a_LIBADD) + $(RANLIB) libcole.a + +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 = cole + +distdir: $(DISTFILES) + $(mkinstalldirs) $(distdir)/doc $(distdir)/examples $(distdir)/utils + @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 $(LIBRARIES) +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-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile 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-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile 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: diff --git a/cole/NEWS b/cole/NEWS new file mode 100644 index 0000000..3d1227a --- /dev/null +++ b/cole/NEWS @@ -0,0 +1,75 @@ + +2.0.1 Arturo Tena (1999-08): ++ Fixed bug in cole.h which didn't include stdio.h. ++ New util: cole_extract. ++ Updated documentation. + +2.0.0 Arturo Tena (1999-07): ++ New good looking API: it's modeled after `stdio.h' ANSI C calls. ++ Documentation of all public calls. ++ OLEdecode and OLEcode are now internal functions and they must be not called. ++ Write files (ie. what OLEcode() used to do) is not implemented by now. + +1.0.1 Arturo Tena (1999-06-25): +User level: ++ Fixed a bug that may prevent from compile under Solaris. + +1.0.0: +Arturo Tena +User level: ++ Autoconf-ified (now cole have configure script). ++ Automake-ified (now Makefile have standard targets). ++ Objects archived now in a static library: libcole.a. ++ Can compile a dynamic library. ++ Check endianess of machine. ++ Fix some bugs when reading damaged files. ++ Added --enable-cole-verbose option. ++ Added --enable-osf-align-check (thanks to Bernhard Reiter). ++ A cole.spec file to make a RPM package and a cole.lsm to MetaLab archive. ++ Documentation written. +Inside code: ++ Added some macros and functions in support.h ++ Change name from test to test_exitf define. ++ Create a new test and test_call_exitf define. ++ Rename max function to max3 (preparing to compile in Borland C). ++ fil_swriteU8 disappeared. ++ Clean up some files. + +0.1.0: +Arturo Tena ++ Change name from oledecod to cole. ++ Add olecod.c and olecod.h. ++ Modified demo.c to call OLEcod. ++ Changed pps->name, first character can be from 00 to 10, or so, as + originally is in ole 2 files. ++ Modified some errors in OLEdecod. ++ Create test suit, some doc files. ++ Improve this README. + +0.0.6: +Arturo Tena ++ Fix the checking while reordering pps list. ++ Add instructions on how to apply patches. + +0.0.5: +Arturo Tena ++ Fix the "Add some fool integrity checking while reading small block + depot" fix. Was > instead <=. =) ++ While reading a broken OLE file, added some checking while reordering + pps list. ++ Added return parameter to freeOLEtree function. ++ Some general clean up. + +0.0.4: +Arturo Tena ++ Fix one stupid error while erasing the OLE tree. ++ Add some fool integrity checking while reading small block depot. + +0.0.3: +Arturo Tena ++ Add one parameter to OLEdecod; max_level, which is the maximum level + stream we will extract into files. ++ Changed name from main.c to demo.c ++ Added a simple Makefile ++ Added this README file. + diff --git a/cole/README-CVS b/cole/README-CVS new file mode 100644 index 0000000..ded6531 --- /dev/null +++ b/cole/README-CVS @@ -0,0 +1,10 @@ + +If you got this source code from a CVS repository, execute `autogen.sh' +to generate `Makefile.in', `configure' and other files. + +--- + +To erase the files that `autogen.sh' created, run: + +rm config.guess config.sub ltconfig ltmain.sh missing mkinstalldirs install-sh config.h.in configure aclocal.m4 stamp-h.in INSTALL `find . -name "Makefile.in" -print` + diff --git a/cole/README-cole b/cole/README-cole new file mode 100644 index 0000000..f37948f --- /dev/null +++ b/cole/README-cole @@ -0,0 +1,54 @@ + +What is cole? +************* + +cole is a free C OLE library. + +cole is distributed under the terms of the `GNU General Public License' (GPL) +to give an impulse to the Free Software. cole distribution license is +compatible with the `Open Source' definition. + +Using cole, you can access Microsoft' `Structured Storage' files. +The most popular Microsoft's programs generate `Structured Storage' files, +incluiding the Microsoft' suite for offices. StarDivision' suite (StarOffice) +generate `Structured Storage' files too. FlashPix file format is +`Structured Storage' too. + + +What is a `Structured Storage' file? +************************************ + +Inside a `Structured Storage' file there is a filesystem, with directories +and files, which Microsoft calls `containers' and `streams'. Using cole you +can travel through such filesystem and access the files. + +cole doesn't know about internal structure of a `stream', it only reads the +raw data. You can use the Microsoft's documentation available at + or the information available at + to know the binary file format of the streams. If you +know anything in the side of StarDivision email me. FlashPix file format is +well documented. + +cole was developed using the information available at + and the OLE::Storage +Perl module from the same site, and no information from any other source +(incluiding Microsoft) has been used. + + +Compile +******* + +See the file `INSTALL' to know how to compile and install cole (a standard +`configure' script is provided). + + +Documentation +************* + +The documentation is autogenerated from the source code, and it can be found in +the directory `doc/cole-manual' of the source code. + + + The current maintainer. + (see the file `AUTHORS') + diff --git a/cole/THANKS b/cole/THANKS new file mode 100644 index 0000000..40a1741 --- /dev/null +++ b/cole/THANKS @@ -0,0 +1,21 @@ + +Thank you all of you that have contributed with this project! +Thank you for help! + +(If you can't find your name here, please email to the current maintainer). + +Thanks to: +********** + +The LAOLA guy: Martin Schwartz. Without his pretty hack + into Structure Storage and Compound Files this work could never be + possible. +The Engineering Computer Laboratory of La Salle University + Mexico, Campus Mexico City, for supporting Arturo Tena + in cole development. +Bernhard Reiter . OSF fixes. +Shaw Terwilliger . C++ fix. +Caolan McNamara . Debug and more. +Martin Scharpf . Debug. +David Rysdam. The memory dump function cole used in pre 1.x and 1.x releases. + diff --git a/cole/TODO b/cole/TODO new file mode 100644 index 0000000..215a3a0 --- /dev/null +++ b/cole/TODO @@ -0,0 +1,157 @@ + +HIGH PRIORITY: +************** + +* Review all the documentation for style errors and so on. + PLEASE, ENGLISH SPEAKERS, HELP ME HERE!!! + +* Improve example of cole_recurse_tree() in examples/filesystem.c: include + actual callback functions, not just NULLs. + +* Write tests for all calls of the API: Improve example/directory.c: + missing some calls to test. + +* Call all the calls of the API in examples/demo.c. + +* Implement more API calls, like `stdio.h' ANSI C calls. + +* Fix the bugs listed in `BUGS' file! + +* Search for `FIXME' in the source code... and fix some =). + + +MEDIUM: +******* + +* Improve tests, they must actually test the output of the public calls. + +* Investigate if it is possible to use `const' in static version variables. + +* Test cole_fopen() using wired filenames. ie "/", "//", "", etc. May be a + function that check the filename could be written. + +* Check input arguments of each call of the API, returning an colerror if + there are an error. + +* Say in the documentation that many other files can be `Structured Storage' + files too. + +* May be in cole 3.x, create a double char type in order to handle the complete + directory and file names. + +* Investigate how to avoid content of the structures COLEFILE and so on be + documented in the api document (their must be documented only in the internal + document). + +* Investigate how to force that calls begining with `_' to be in documentation + (their will be in internals). + +* Make api section is before internals section in generated documentation, but + COLEFS, COLEFILE, COLEDIR and COLEDIRENT must be documented in internals, not + in api. + +* Make cole fork safe. + +* Make reentrant safe. + +* Review Martin Schwartz mail: + ---QUOTE--- + It might be helpful to you to have a look at the perl 5 (Ole::Storage) + release file "Storage.pm" method "ole_head", giving some additional info + about big- and smallblocksize (offset 0x1e, 0x20) as well as about Extended + Block Depot for very large files (offset 0x44, 0x48). And, sorry for my + screwed up namegiving... + ---END QUOTE--- + The Extended Block Depot is implemented now, but bigblocksize and + smallblocksize are not implented yet. + +* Really use the results of the configure guesses, with #ifdef HAVE_x in code. + +* Make it compile using DJGPP and Borland C (we may need a custom Makefile and + a custom config.h). + +* Use void `swab(const void *from, void *to, size_t n);' (in fil_sread* + calls) if present, for performance, in support.c. + +* Replace cole_direntry_getday[12] and cole_direntry_getsec[12] calls with + another calls that return something useful. + +* Divide the RPM in cole and cole-devel packages (may be it's not necessary, + because cole package is not much big). + +* cole.spec is regenerated while configuring, avoid that. (UPDATE: may be + is impossible to avoid that =(). + + +NOT URGENT: +*********** + +* Use some package to discover uninitializated memory, use some profile + package, etc. + +* Support cross compiling (don't even know what this exactly means! =) ). + UPDATE: seems that cross compiling it is just useful for compilers... =) + +* Use zlib to support compressed files. + + + + + +****************** +PRE COLE 2.x TODO: +****************** + + +MEDIUM: +******* + +* Check: + + ends () doesn't should be called more than once + + if OLEdecode or OLEcode fails, then the stream tree is never freed. + +* Rewrite olecode.c to use `test(..,..)' instead of `test_exitf(..,..,dummy())'. + +* See the posiblity to convert some #defines functions to real functions, + to get objects of smaller size. + +* See mark `/* FIXME MARK 2 */' in oledecod.c. + +* Instead using assert, use assert_return or something like that: the + purpose is not abort, but return a error code (like 19, like xls2xml). + +* Check all pointer arguments checked != NULL using assert, as well other + parameters must be correct, use assert or assert_return (see up). + +* Review error checking system (that means, does all possible errors can + be captured?) + +* Add property sets read and create functions (as implemented in LAOLA): + Invent some functions to construct an pps_entry * tree. one could be: + int add_stream (char * stream_name, char * filename, pps_entry * tree) + That function would open filename, calculate its size, and write it tree + as brother. other could be: + int add_directory (char * dir_name, pps_entry * tree) + +* Function generate_real_file needs to be checked if it is all correct + there. See /* FIXME MARK 3 */ in olecod.c. + + + +NOT URGENT: +*********** + +* Check that list->size not have been used as size of file, because it's + the size of the list. + +* Change #defines func(..) and its calls in order to make parameters + between parentesis. Don't broke anything. + +* Indent all files. Use indent. Check they look ok in 80 columns. + +* Change all 4's to sizeof(U32). DANGER: take care don't brake *anything*. + +* Insert all streams in sbfile, SDepot, BDepot and Input and *after* + recalculate all sizes and blocks and all that stuff in OLEcode, instead do + it each time we insert one stream (this could lead great performance). + diff --git a/cole/cole-config.in b/cole/cole-config.in new file mode 100644 index 0000000..ed1630d --- /dev/null +++ b/cole/cole-config.in @@ -0,0 +1,71 @@ +#! /bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ + +usage() +{ + cat < + */ + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "config.h" +#include "cole.h" +#else +#include "cole.h.in" +#endif + +#include "internal.h" +#include + + + +/** + * cole_perror: + * @s: string to print before the error message. It can be NULL. + * @colerrno: error value of which a message will be printed. + * + * Prints a message on the standard error output, describing the error + * @colerrno, preceding it with the string @s, a semicolon and a space. + * It handles COLE_EERRNO value too, calling perror(3). + */ +void +cole_perror (const char *s, COLERRNO colerrno) +{ + if (s != NULL) fprintf (stderr, "%s: ", s); + switch (colerrno) { + case COLE_EMEMORY: + case COLE_ECLOSEFILE: + case COLE_EWRITE: + case COLE_EREMOVE: + case COLE_ETMPNAM: + case COLE_ESEEK: + case COLE_EERRNO: + perror ("cole"); + break; + case COLE_EOPENFILE: + fprintf (stderr, "cole - Cannot open the file\n"); + break; + case COLE_ENOFILESYSTEM: + fprintf (stderr, "cole - The file is not a OLE2 file\n"); + break; + case COLE_EINVALIDFILESYSTEM: + fprintf (stderr, "cole - The file has a short OLE2 header or it is not really an OLE2 file.\n"); + break; + case COLE_EISNOTDIR: + fprintf (stderr, "cole - The OLE2 entry is not a substorage object\n"); + break; + case COLE_EISNOTFILE: + fprintf (stderr, "cole - The substorage object is not valid\n"); + break; + case COLE_EFILENOTFOUND: + fprintf (stderr, "cole - OLE2 object not found\n"); + break; + case COLE_EOF: + fprintf (stderr, "cole - End of stream object has been reached\n"); + break; + case COLE_EMEMBERISNOTDIR: + fprintf (stderr, "cole - The OLE2 object searched for is not " + "a substorage object\n"); + break; + case COLE_EBROKENFILENAME: + fprintf (stderr, "cole - Illegal OLE object name\n"); + break; + case COLE_EFILENAMEISNOTFILE: + fprintf (stderr, "cole - The OLE2 object is not a stream\n"); + break; + case COLE_EFSEEKDELTA: + fprintf (stderr, "cole - The seek offset is an illegal value\n"); + break; + case COLE_EFSEEKFLAG: + fprintf (stderr, "cole - The Seek Flag is not valid\n"); + break; + case COLE_EREAD: + fprintf (stderr, "cole - Short read length returned...the file is probably corrupted\n"); + break; + case COLE_EUNKNOWN: + fprintf (stderr, "cole - An unknown error ocurred in the cole libary (might be a bug)\n"); + break; + default: + fprintf (stderr, "cole - An unknown error %d ocurred in the cole libabry (might be a bug)\n", + colerrno); + break; + } +} + + + +/** + * cole_mount: + * @filename: name of the file with the filesystem. + * @colerrno: error value (COLE_EMEMORY, COLE_EOPENFILE, COLE_ENOFILESYSTEM, + * COLE_EINVALIDFILESYSTEM, COLE_EUNKNOWN). + * + * Mounts the filesystem which is in @filename. + * + * Returns: a filesystem in success, or NULL in other case. + */ +COLEFS * +cole_mount (char *filename, COLERRNO *colerrno) +{ + COLEFS * ret; + + ret = (COLEFS *)malloc (sizeof (COLEFS)); + if (ret == NULL) { + if (colerrno != NULL) *colerrno = COLE_EMEMORY; + return NULL; + } + + switch (__OLEdecode (filename, &ret->tree, &ret->root, &ret->BDepot, + &ret->SDepot, &ret->sbfile, &ret->sbfilename, + &ret->file, 0)) { + case 0: + /* success */ + break; + case 10: + if (colerrno != NULL) *colerrno = COLE_EMEMORY; + free (ret); + return NULL; + case 7: + case 4: + if (colerrno != NULL) *colerrno = COLE_EOPENFILE; + free (ret); + return NULL; + case 8: + case 9: + if (colerrno != NULL) *colerrno = COLE_ENOFILESYSTEM; + free (ret); + return NULL; + case 5: + if (colerrno != NULL) *colerrno = COLE_EINVALIDFILESYSTEM; + free (ret); + return NULL; + default: + if (colerrno != NULL) *colerrno = COLE_EUNKNOWN; + free (ret); + return NULL; + } + + return ret; +} + + +/** + * cole_umount: + * @colefilesystem: filesystem to umount. + * @colerrno: error value (COLE_ECLOSEFILE, COLE_EREMOVE). + * + * Umounts the filesystem @colefilesystem. + * + * Returns: zero in success, no zero in other case. + */ +int +cole_umount (COLEFS *colefilesystem, COLERRNO *colerrno) +{ + int ret; + + ret = 0; + free (colefilesystem->BDepot); + free (colefilesystem->tree); + if (fclose (colefilesystem->file) && !ret) { + if (colerrno != NULL) *colerrno = COLE_ECLOSEFILE; + ret = 1; + } + if (colefilesystem->SDepot != NULL) { + free (colefilesystem->SDepot); + /* may no exist SDepot because there are not small files */ + /* assert (colefilesystem->sbfile != NULL); */ + /* assert (colefilesystem->sbfilename != NULL); */ + if (fclose (colefilesystem->sbfile) && !ret) { + if (colerrno != NULL) *colerrno = COLE_ECLOSEFILE; + ret = 1; + } +#if defined(__WIN32__) || (__BORLANDC__) + if (remove (colefilesystem->sbfilename) && !ret) { + if (colerrno != NULL) *colerrno = COLE_EREMOVE; + ret = 1; + } +#endif + free (colefilesystem->sbfilename); + } + free (colefilesystem); + + return ret; +} + + +/** + * cole_print_tree: + * @colefilesystem: filesystem of which the tree will be printed. + * @colerrno: error value (errors from call cole_recurse_tree()). + * + * Prints on the standard output the tree of files and directories contained + * in @colefilesystem. + * Currently this call always success. + * + * Returns: zero in success, no zero in other case. + */ +static COLE_RECURSE_DIR_FUNC __cole_print_tree_indir; +static COLE_RECURSE_DIR_FUNC __cole_print_tree_outdir; +static COLE_RECURSE_DIR_FUNC __cole_print_tree_inroot; +static COLE_RECURSE_DIRENT_FUNC __cole_print_tree_indirentry; + +int cole_print_tree (COLEFS *colefilesystem, COLERRNO *colerrno) +{ + long level; + + level = 1; + if (cole_recurse_tree (colefilesystem, &level, + __cole_print_tree_inroot, + __cole_print_tree_indirentry, + __cole_print_tree_indir, + __cole_print_tree_outdir, NULL, colerrno)) { + return 1; + } + + return 0; +} + +static int +__cole_print_tree_indir(COLEDIR *cd, void *info, COLERRNO *colerrno) +{ +/* + * ATTENTION: if you modify this function so it modifies colerrno: + * Modify colerrno comment in the functions that call it, + * ie. cole_print_tree(). + */ + (*((long*)info))++; + return 0; +} + +static int +__cole_print_tree_outdir(COLEDIR *cd, void *info, COLERRNO *colerrno) +{ +/* + * ATTENTION: if you modify this function so it modifies colerrno: + * Modify colerrno comment in the functions that call it, + * ie. cole_print_tree(). + */ + (*((long*)info))--; + return 0; +} + +static int +__cole_print_tree_inroot(COLEDIR *cd, void *info, COLERRNO *colerrno) +{ +/* + * ATTENTION: if you modify this function so it modifies colerrno: + * Modify colerrno comment in the functions that call it, + * ie. cole_print_tree(). + */ + char *entry_name; + + printf ("DIR "); + printf (" %7u", cole_dir_getsize (cd)); + printf (" %08lx-%08lx %08lx-%08lx", + cole_dir_getdays1 (cd), + cole_dir_getsec1 (cd), + cole_dir_getdays2 (cd), + cole_dir_getsec2 (cd)); + entry_name = cole_dir_getname (cd); + if (!isprint ((int)entry_name[0])) + printf (" '\\x%02x%s'\n", entry_name[0], entry_name+1); + else + printf (" '%s'\n", entry_name); + + return 0; +} + +static int +__cole_print_tree_indirentry(COLEDIRENT *cde, void *info, COLERRNO *colerrno) +{ +/* + * ATTENTION: if you modify this function so it modifies colerrno: + * Modify colerrno comment in the functions that call it, + * ie. cole_print_tree(). + */ + char *entry_name; + long level; + long i; + + level = *((long*)info); + for (i = 0; i < level; i++) { + if (i == level - 1) + printf ("\\--"); + else + printf ("| "); + } + + if (cole_direntry_isdir (cde)) + printf ("DIR "); + else if (cole_direntry_isfile (cde)) + printf ("FILE"); + else + printf ("????"); + printf (" %7u", cole_direntry_getsize (cde)); + printf (" %08lx-%08lx %08lx-%08lx", + cole_direntry_getdays1 (cde), + cole_direntry_getsec1 (cde), + cole_direntry_getdays2 (cde), + cole_direntry_getsec2 (cde)); + entry_name = cole_direntry_getname (cde); + if (!isprint ((int)entry_name[0])) + printf (" '\\x%02x%s'\n", entry_name[0], entry_name+1); + else + printf (" '%s'\n", entry_name); + + return 0; +} + + +/** + * cole_opendir_rootdir: + * @colefilesystem: filesystem of which the root directory will be opened. + * @colerrno: error value (COLE_EMEMORY). + * + * Opens the root directory of the filesystem @colefilesystem as directory. + * + * Returns: a directory in success, or NULL in other case. + */ +COLEDIR * +cole_opendir_rootdir (COLEFS *colefilesystem, COLERRNO *colerrno) +{ + COLEDIR *ret; + + ret = (COLEDIR *)malloc (sizeof (COLEDIR)); + if (ret == NULL) { + if (colerrno != NULL) *colerrno = COLE_EMEMORY; + return NULL; + } + ret->fs = colefilesystem; + ret->entry = ret->fs->root; + ret->visited_entry.dir = ret; + ret->visited_entry.entry = ret->fs->tree[ ret->entry ].dir; + + return ret; +} + + +/** + * cole_opendir_direntry: + * @coledirentry: directory entry to be opened as directory. + * @colerrno: error value (COLE_EISNOTDIR, COLE_EMEMORY). + * + * Opens a directory entry as directory. + * + * Returns: a directory in success, or NULL in other case. + */ +COLEDIR * +cole_opendir_direntry (COLEDIRENT *coledirentry, COLERRNO *colerrno) +{ + COLEDIR *ret; + + if (!cole_direntry_isdir (coledirentry)) { + if (colerrno != NULL) *colerrno = COLE_EISNOTDIR; + return NULL; + } + + ret = (COLEDIR *)malloc (sizeof (COLEDIR)); + if (ret == NULL) { + if (colerrno != NULL) *colerrno = COLE_EMEMORY; + return NULL; + } + ret->fs = coledirentry->dir->fs; + ret->entry = coledirentry->entry; + ret->visited_entry.dir = ret; + ret->visited_entry.entry = ret->fs->tree[ ret->entry ].dir; + + return ret; +} + + +/** + * cole_closedir: + * @coledir: directory to be closed. + * @colerrno: error value (). + * + * Closes the directory @coledir. + * Currently this call always success. + * + * Returns: zero in success, no zero in other case. + */ +int +cole_closedir (COLEDIR *coledir, COLERRNO *colerrno) +{ + free (coledir); + + return 0; +} + + +COLEDIRENT * +cole_visiteddirentry (COLEDIR *coledir) +{ + if (coledir->visited_entry.entry == 0xffffffffUL) + return NULL; + + return &coledir->visited_entry; +} + + +COLEDIRENT * +cole_nextdirentry (COLEDIR *coledir) +{ + if (coledir->visited_entry.entry == 0xffffffffUL) + return NULL; + + coledir->visited_entry.entry = + coledir->fs->tree [ coledir->visited_entry.entry ].next; + + if (coledir->visited_entry.entry == 0xffffffffUL) + return NULL; + + return &coledir->visited_entry; +} + + +/** + * cole_direntry_isdir: + * @coledirentry: directory entry to be tested. + * + * Tests if the directory entry @coledirentry is a directory. + * + * Returns: no zero if it is a directory, zero in other case. + */ +int +cole_direntry_isdir (COLEDIRENT *coledirentry) +{ + return coledirentry->dir->fs->tree[ coledirentry->entry ].type == + _COLE_TYPE_DIR; +} + + +/** + * cole_direntry_isfile: + * @coledirentry: directory entry to be tested. + * + * Tests if the directory entry @coledirentry is a file. + * + * Returns: no zero if it is a directory, zero in other case. + */ +int +cole_direntry_isfile (COLEDIRENT *coledirentry) +{ + return coledirentry->dir->fs->tree[ coledirentry->entry ].type == + _COLE_TYPE_FILE; +} + + +char * +cole_direntry_getname (COLEDIRENT *coledirentry) +{ + return coledirentry->dir->fs->tree[ coledirentry->entry ].name; +} + + +size_t +cole_direntry_getsize (COLEDIRENT *coledirentry) +{ + /* FIXME is it cast needed? */ + return coledirentry->dir->fs->tree[ coledirentry->entry ].size; +} + + +long +cole_direntry_getsec1 (COLEDIRENT *coledirentry) +{ + /* seconds1 is U32, long is at least U32 in all plattforms, isn't it? */ + return coledirentry->dir->fs->tree[ coledirentry->entry ].seconds1; +} + + +long +cole_direntry_getsec2 (COLEDIRENT *coledirentry) +{ + /* seconds2 is U32, long is at least U32 in all plattforms, isn't it? */ + return coledirentry->dir->fs->tree[ coledirentry->entry ].seconds2; +} + + +long +cole_direntry_getdays1 (COLEDIRENT *coledirentry) +{ + /* days1 is U32, long is at least U32 in all plattforms, isn't it? */ + return coledirentry->dir->fs->tree[ coledirentry->entry ].days1; +} + + +long +cole_direntry_getdays2 (COLEDIRENT *coledirentry) +{ + /* days2 is U32, long is at least U32 in all plattforms, isn't it? */ + return coledirentry->dir->fs->tree[ coledirentry->entry ].days2; +} + + +char * +cole_dir_getname (COLEDIR *coledir) +{ + return coledir->fs->tree[ coledir->entry ].name; +} + + +size_t +cole_dir_getsize (COLEDIR *coledir) +{ + /* FIXME is it cast needed? */ + return coledir->fs->tree[ coledir->entry ].size; +} + + +long +cole_dir_getsec1 (COLEDIR *coledir) +{ + /* seconds1 is U32, long is at least U32 in all plattforms, isn't it? */ + return coledir->fs->tree[ coledir->entry ].seconds1; +} + + +long +cole_dir_getsec2 (COLEDIR *coledir) +{ + /* seconds2 is U32, long is at least U32 in all plattforms, isn't it? */ + return coledir->fs->tree[ coledir->entry ].seconds2; +} + + +long +cole_dir_getdays1 (COLEDIR *coledir) +{ + /* days1 is U32, long is at least U32 in all plattforms, isn't it? */ + return coledir->fs->tree[ coledir->entry ].days1; +} + + +long +cole_dir_getdays2 (COLEDIR *coledir) +{ + /* days2 is U32, long is at least U32 in all plattforms, isn't it? */ + return coledir->fs->tree[ coledir->entry ].days2; +} + + +/** + * cole_fopen: + * @colefilesystem: filesystem in which @filename is in. + * @filename: name of the file to open. + * @colerrno: error value (COLE_EFILENOTFOUND, errors from calls + * cole_opendir_rootdir(), cole_fopen_direntry() and + * cole_locate_filename()). + * + * Opens the file with the name @filename in the filesystem @colefilesystem. + * Currently, @filename must begin with a '/' character, it means @filename is + * the absolute filename. + * + * Returns: a file in success, or NULL in other case. + */ +struct _cole_fopen_info { + COLEFILE *file; + int succ; + COLERRNO colerrno; +}; +static COLE_LOCATE_ACTION_FUNC _cole_fopen_action; +COLEFILE * +cole_fopen (COLEFS *colefilesystem, char *filename, COLERRNO *colerrno) +{ + struct _cole_fopen_info info; + + if (cole_locate_filename (colefilesystem, filename, &info, + _cole_fopen_action, colerrno)) { + /* couldn't locate the filename */ + /* colerrno is set */ + return NULL; + } + + if (info.succ) + return info.file; + + if (colerrno != NULL) *colerrno = info.colerrno; + return NULL; +} + +static void +_cole_fopen_action (COLEDIRENT *cde, void *_info) +{ + struct _cole_fopen_info *info; + + info = (struct _cole_fopen_info *)_info; + + if (!cole_direntry_isfile(cde)) { + info->colerrno = COLE_EFILENAMEISNOTFILE; + info->succ = 0; + return; + } + + info->file = cole_fopen_direntry (cde, &info->colerrno); + if (info->file == NULL) { + /* colerrno is set */ + info->succ = 0; + return; + } + + info->succ = 1; +} + + +/** + * cole_fopen_direntry: + * @coledirentry: directory entry to be opened as file. + * @colerrno: error value (COLE_EISNOTFILE, COLE_EMEMORY, COLE_ETMPNAM, + * COLE_EOPENFILE, COLE_EINVALIDFILESYSTEM, COLE_EREAD, + * COLE_EWRITE, COLE_EUNKNOWN). + * + * Opens a directory entry as file. + * + * Returns: a file in success, or NULL in other case. + */ +COLEFILE * +cole_fopen_direntry (COLEDIRENT *coledirentry, COLERRNO *colerrno) +{ + COLEFILE *ret; + + if (!cole_direntry_isfile (coledirentry)) { + if (colerrno != NULL) *colerrno = COLE_EISNOTFILE; + return NULL; + } + + ret = (COLEFILE *)malloc (sizeof (COLEFILE)); + if (ret == NULL) { + if (colerrno != NULL) *colerrno = COLE_EMEMORY; + return NULL; + } + ret->fs = coledirentry->dir->fs; + ret->entry = coledirentry->entry; + switch (__cole_extract_file (&ret->file, &ret->filename, + ret->fs->tree[ ret->entry ].size, + ret->fs->tree[ ret->entry ].start, + ret->fs->BDepot, ret->fs->SDepot, + ret->fs->sbfile, ret->fs->file)) { + case 0: + /* success */ + break; + case 1: + if (colerrno != NULL) *colerrno = COLE_EMEMORY; + free (ret); + return NULL; + case 2: + if (colerrno != NULL) *colerrno = COLE_ETMPNAM; + free (ret); + return NULL; + case 3: + if (colerrno != NULL) *colerrno = COLE_EOPENFILE; + free (ret); + return NULL; + case 4: + if (colerrno != NULL) *colerrno = COLE_EINVALIDFILESYSTEM; + free (ret); + return NULL; + case 5: + if (colerrno != NULL) *colerrno = COLE_EREAD; + free (ret); + return NULL; + case 6: + if (colerrno != NULL) *colerrno = COLE_EWRITE; + free (ret); + return NULL; + default: + if (colerrno != NULL) *colerrno = COLE_EUNKNOWN; + free (ret); + return NULL; + } + /* because the original fopen(3) leaves the file pointer + in the beginning */ + rewind (ret->file); + ret->pos = 0; + ret->filesize = ret->fs->tree[ ret->entry ].size; + + return ret; +} + + +/** + * cole_fclose: + * @colefile: file to be closed. + * @colerrno: error value (COLE_ECLOSEFILE, CLOSE_EREMOVE). + * + * Closes the file @colefile. + * + * Returns: zero in sucess, no zero in other case. + */ +int +cole_fclose (COLEFILE *colefile, COLERRNO *colerrno) +{ + int ret; + + ret = 0; + if (fclose (colefile->file) && !ret) { + if (colerrno != NULL) *colerrno = COLE_ECLOSEFILE; + ret = 1; + } + if (remove (colefile->filename) && !ret) { + if (colerrno != NULL) *colerrno = COLE_EREMOVE; + ret = 1; + } + free (colefile->filename); + free (colefile); + + return ret; +} + + +/** + * cole_fread: + * @colefile: file to be read. + * @ptr: memory location where the bytes will be stored. + * @size: how many bytes will be read. + * @colerrno: error value (COLE_EOF, COLE_EREAD, COLE_ESEEK). + * + * Reads @size bytes from @colefile and store them in the location given + * by @ptr. If not success, the file position indicator is not changed. + * + * Returns: in sucess the number of bytes actually readed (maximum @size) + * or zero in other case. + */ +size_t +cole_fread (COLEFILE *colefile, void *ptr, size_t size, COLERRNO *colerrno) +{ + size_t bytes_read, bytes_to_read; + long tbytes; + + /* Check to see if going past end... */ + if ((colefile->pos + size) > colefile->filesize) + tbytes = colefile->filesize - colefile->pos; + else + tbytes = size; + if (tbytes <= 0) + return 0; + bytes_to_read = (size_t)tbytes; + bytes_read = fread (ptr, 1, bytes_to_read, colefile->file); + /* assert (size && (colefile->pos + bytes_read > colefile->pos)); */ + colefile->pos += bytes_read; + /* assert (!feof (colefile->file) + && ftell (colefile->file) == colefile->pos); */ + if (bytes_read != size) { + /* Linux man page says that fread returns a `short item count + (or zero)' when an error of end of file ocurrs. A short count + OR zero? We are hopping that fread always returns zero. */ + if (feof (colefile->file)) { + if (colerrno != NULL) *colerrno = COLE_EOF; + return 0; + } else if (ferror (colefile->file)) { + if (colerrno != NULL) *colerrno = COLE_EREAD; + return 0; + } + } + /* assert (size != 0 && bytes_read != 0); */ + /* assert (bytes_read <= size); */ + + return bytes_read; +} + + +/** + * cole_ftell: + * @colefile: file of which the file position indicator will be get. + * + * Get the current value of the file position indicator for the file + * @colefile. + * + * Returns: The file position. + */ +size_t +cole_ftell (COLEFILE *colefile) +{ + return colefile->pos; +} + + +/** + * cole_fseek: + * @colefile: file of which its file position indicator will be set. + * @delta: number of bytes that the file position indicator will be moved. + * @direction: from where start to count the @delta bytes. + * @colerrno: error value (COLE_EFSEEKDELTA). + * + * Sets the value of the file position indicator for the file @colefile + * @delta bytes from the beginning of the file, forward from the current + * position, backward from the current position, or from the end of the + * file, if @direction is COLE_SEEK_SET, COLE_SEEK_BACKWARD, + * COLE_SEEK_FORWARD or COLE_SEEK_END, respectively. + * The file position indicator will always be <= @colefile->filesize. + * If you @delta is such that the previous line would not true, cole_fseek + * fails. + * + * Returns: zero in success, no zero in other case. + */ +int +cole_fseek (COLEFILE *colefile, size_t delta, COLE_SEEK_FLAG direction, + COLERRNO *colerrno) +{ + if ((int)delta < 0) { + if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA; + return 1; + } + + switch (direction) { + case COLE_SEEK_SET: + if (delta <= colefile->filesize) { + colefile->pos = delta; + return 0; + } else { + if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA; + return 1; + } + case COLE_SEEK_END: + if (delta <= colefile->filesize) { + colefile->pos = colefile->filesize - delta; + return 0; + } else { + if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA; + return 1; + } + case COLE_SEEK_BACKWARD: + if (delta <= colefile->pos) { + colefile->pos = colefile->pos - delta; + return 0; + } else { + if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA; + return 1; + } + case COLE_SEEK_FORWARD: + if (delta <= colefile->filesize - colefile->pos) { + colefile->pos = colefile->pos + delta; + return 0; + } else { + if (colerrno != NULL) *colerrno = COLE_EFSEEKDELTA; + return 1; + } + default: + if (colerrno != NULL) *colerrno = COLE_EFSEEKFLAG; + return 1; + } +} + + +/** + * cole_frewind: + * @colefile: file of which its file position indicator will be rewind. + * @colerrno: error value (error from call cole_fseek()). + * + * Sets the value of the file position indicator for the file @colefile + * in the beginning of the file. + * + * Returns: zero in success, no zero in other case. + */ +int +cole_frewind (COLEFILE *colefile, COLERRNO *colerrno) +{ + if (cole_fseek (colefile, 0, COLE_SEEK_SET, colerrno)) + return 1; + + return 0; +} + + +/** + * cole_fsize: + * @colefile: file of which its size will be returned. + * + * Returns the size in bytes of the file @colefile. + */ +size_t +cole_fsize (COLEFILE *colefile) +{ + return colefile->filesize; +} + + +/** + * cole_feof: + * @colefile: file to be tested. + * + * Tests if the end of file has been reached in @colefile. + * + * Returns: no zero if the end of file has been reached, zero in other case. + */ +int +cole_feof (COLEFILE *colefile) +{ + /* assert ((colefile->pos == colefile->fs->tree[ colefile->entry ].size) + && feof (colefile->file)); */ + return (colefile->pos == colefile->filesize); +} + + +/** + * cole_recurse_tree: + * @colefilesystem: filesystem to recurse. + * @info: arbitrary pointer passed to the functions. + * @inroot: pointer to the function that is called when start visiting root + * directory. It can be NULL. + * @indirentry: pointer to the function that is called when start visiting any + * directory entry (file or directory). It can be NULL. + * @indir: pointer to the function that is called when start visiting a + * directory. It can be NULL. + * @outdir: pointer to the function that is called when end visiting a + * directory. It can be NULL. + * @visitdir: pointer to the function that is called to know if visit a + * directory. It can be NULL. + * @colerrno: error value (errors from calls cole_opendir_rootdir(), + * cole_opendir_direntry(), cole_closedir() and + * inroot, indirentry, indir, and outdir functions). + * + * Recurse the filesystem @colefilesystem, calling the functions pointed by + * @inroot, @indirentry, @indir and @outdirectory when start visiting + * root directory, start visiting any directory entry (file or directory), + * start visiting a directory or end visiting a directory, respectively. + * If @visitdir returns no zero or it's NULL, the directory is visited, + * otherwise is not visited. + * @info is a arbitrary pointer which is passed to the functions pointed by + * @inroot, @indirentry, @indir and @outdirectory: it may be used to share + * arbitrary information between them. + * + * Returns: zero if recursed all the tree, no zero in other case. + */ +static int +__cole_recurse_tree (COLEDIR *_cd, long level, void *info, + COLE_RECURSE_DIR_FUNC *inroot, + COLE_RECURSE_DIRENT_FUNC *indirentry, + COLE_RECURSE_DIR_FUNC *indir, + COLE_RECURSE_DIR_FUNC *outdir, + COLE_RECURSE_VISIT_DIR_FUNC *visitdir, + COLERRNO *colerrno); +int +cole_recurse_tree (COLEFS *colefilesystem, void *info, + COLE_RECURSE_DIR_FUNC *inroot, + COLE_RECURSE_DIRENT_FUNC *indirentry, + COLE_RECURSE_DIR_FUNC *indir, + COLE_RECURSE_DIR_FUNC *outdir, + COLE_RECURSE_VISIT_DIR_FUNC *visitdir, + COLERRNO *colerrno) +{ + COLEDIR * cd; + + cd = cole_opendir_rootdir (colefilesystem, colerrno); + if (cd == NULL) + return 1; + + if (__cole_recurse_tree (cd, 1, info, inroot, indirentry, indir, + outdir, visitdir, colerrno)) { + cole_closedir (cd, NULL); + /* colerrno is set */ + return 1; + } + + if (cole_closedir (cd, colerrno)) { + /* colerrno is set */ + return 1; + } + + return 0; +} + +static int +__cole_recurse_tree (COLEDIR *_cd, long level, void *info, + COLE_RECURSE_DIR_FUNC *inroot, + COLE_RECURSE_DIRENT_FUNC *indirentry, + COLE_RECURSE_DIR_FUNC *indir, + COLE_RECURSE_DIR_FUNC *outdir, + COLE_RECURSE_VISIT_DIR_FUNC *visitdir, + COLERRNO *colerrno) +{ +/* + * ATTENTION: if you modify __cole_recurse_tree() so it modifies colerrno + * besides in calling inroot, indirentry, indir, outdir, cole_opendir_direntry + * or cole_closedir: + * Modify colerrno comment in the functions that call it, + * ie. cole_recurse_tree(). + */ + + /* ATTENTION: This is a recursive function */ + COLEDIRENT * cde; + COLEDIR * cd; + + if (level == 1) { + /* The following lines are only executed on Root Entry */ + if (inroot != NULL) { + if ( (*inroot) (_cd, info, colerrno) ) { + /* colerrno is set */ + return 1; + } + } + } + + /* Iterate through childrens */ + for (cde = cole_visiteddirentry (_cd); cde != NULL; + cde = cole_nextdirentry (_cd)) { + if (indirentry != NULL) { + if ( (*indirentry) (cde, info, colerrno) ) { + /* colerrno is set */ + return 1; + } + } + + /* RECURSIVE CALL */ + if (cole_direntry_isdir (cde)) { + cd = cole_opendir_direntry (cde, colerrno); + if (cd == NULL) { + /* colerrno is set */ + return 1; + } + + if (indir != NULL) { + if ( (*indir) (cd, info, colerrno) ) { + /* colerrno is set */ + cole_closedir (cd, NULL); + return 1; + } + } + + if ( (visitdir == NULL) || + ((*visitdir)(cd, info)) ) { + if (__cole_recurse_tree (cd, level + 1, info, + inroot, indirentry, + indir, outdir, + visitdir, colerrno)) { + /* colerrno is set */ + cole_closedir (cd, NULL); + return 1; + } + } + + if (outdir != NULL) { + if ( (*outdir) (cd, info, colerrno) ) { + /* colerrno is set */ + cole_closedir (cd, NULL); + return 1; + } + } + + if (cole_closedir (cd, colerrno)) { + /* colerrno is set */ + return 1; + } + } + } + + return 0; +} + + +/** + * cole_locate_filename: + * @colefilesystem: filesystem where to locate @filename. + * @filename: name of the file or directory to be located. + * @info: arbitrary pointer passed to @action. + * @action: pointer to the function that is called when founding @filename. + * @colerrno: error value (COLE_EUNKNOWN, COLE_EMEMBERISNOTDIR, + * COLE_EFILENOTFOUND, COLE_EBROKENFILENAME, errors + * from call cole_recurse_tree()). + * + * Locate the @filename in the filesystem @colefilesystem, calling @action when + * it's found. @info is arbitrary pointer passed to @action. + * Currently, @filename must begin with a '/' character, it means @filename is + * the absolute filename. + * + * Returns: zero in success, 1 in other case. + */ +struct __cole_locate_filenameinfo { + COLE_LOCATE_ACTION_FUNC *action; + void *info; + char *filename; + char *current; + int visitdir; +}; +static COLE_RECURSE_DIRENT_FUNC __cole_locate_filename_indirentry; +static COLE_RECURSE_VISIT_DIR_FUNC __cole_locate_filename_visitdir; +int +cole_locate_filename (COLEFS *colefilesystem, char *filename, + void *info, + COLE_LOCATE_ACTION_FUNC *action, + COLERRNO *colerrno) +{ + struct __cole_locate_filenameinfo _info; + COLERRNO _colerrno; + + /* FIXME allow no absolute paths */ + if (filename[0] != '/') { + if (colerrno != NULL) *colerrno = COLE_EBROKENFILENAME; + return 1; + } + + _info.action = action; + _info.info = info; + _info.filename = filename; + _info.current = filename + 1; + + if (cole_recurse_tree (colefilesystem, &_info, NULL, + __cole_locate_filename_indirentry, NULL, NULL, + __cole_locate_filename_visitdir, + &_colerrno)) { + if (_colerrno == COLE_ELAST+1) { + /* file was found */ + return 0; + } + if (colerrno != NULL) *colerrno = _colerrno; + return 1; + } + + if (colerrno != NULL) *colerrno = COLE_EFILENOTFOUND; + return 1; +} + +static int +__cole_locate_filename_visitdir (COLEDIR *cd, void *info) +{ + return ((struct __cole_locate_filenameinfo *)info)->visitdir; +} + +static int +__cole_locate_filename_indirentry (COLEDIRENT *cde, void *_info, + COLERRNO *colerrno) +{ + char *entry_name; + struct __cole_locate_filenameinfo *info; + char *pcurrent; + char *pentry_name; + + info = (struct __cole_locate_filenameinfo *)_info; + entry_name = cole_direntry_getname (cde); + for (pcurrent = info->current, pentry_name = entry_name; + *pcurrent && *pentry_name && *pcurrent != '/'; + pcurrent++, pentry_name++) { + if (*pcurrent != *pentry_name) { + info->visitdir = 0; /* don't visit this directory */ + return 0; /* don't break recurse */ + } + } + switch (*pentry_name) { + case 0: + switch (*pcurrent) { + case '/': + if (!cole_direntry_isdir (cde)) { + if (colerrno != NULL) + *colerrno = COLE_EMEMBERISNOTDIR; + return 1; /* break recurse */ + } + pcurrent++; /* jump the '/' character */ + info->current = pcurrent; + + /* check if it's the last component of filename */ + if (!(*info->current)) { + /* last component of filename reached */ + if (info->action != NULL) { + (*(info->action)) (cde, info->info); + } + + if (colerrno != NULL) *colerrno = COLE_ELAST+1; + return 1; /* break recurse */ + } + info->visitdir = 1; /* visit this directory */ + return 0; /* don't break recurse */ + case 0: + /* last component of filename reached */ + if (info->action != NULL) { + (*(info->action)) (cde, info->info); + } + + if (colerrno != NULL) *colerrno = COLE_ELAST+1; + return 1; /* break recurse */ + default: + info->visitdir = 0; /* don't visit this directory */ + return 0; /* don't break recurse */ + } + default: + switch (*pcurrent) { + case 0: + info->visitdir = 0; /* don't visit this directory */ + return 0; /* don't break recurse */ + case '/': + info->visitdir = 0; /* don't visit this directory */ + return 0; /* don't break recurse */ + default: + if (colerrno != NULL) *colerrno = COLE_EUNKNOWN; + return 1; /* break recurse */ + } + } + +} + diff --git a/cole/cole.h.in b/cole/cole.h.in new file mode 100644 index 0000000..3f5b61d --- /dev/null +++ b/cole/cole.h.in @@ -0,0 +1,227 @@ +/* + cole - A free C OLE library. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + +#ifndef __COLE_H +#define __COLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Attention: this API is documentated in the `doc' subdirectory + */ + +/* Just to get size_t */ +#include +#ifndef COLE_INTERNAL_H +#include "internal.h" // For _COLE struct definitions +#endif +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +/**************************************************************/ +/* autoconf defines size_t as unsigned if not defined. */ +/* Uncomment these ONLY if you don't have a size_t */ +/* #ifndef size_t */ +/* #define size_t unsigned */ +/* #endif */ +/**************************************************************/ +#endif + +/* + * ********************************************************************** + * version info + * ********************************************************************** + */ +#define COLE_MAJOR_VERSION @COLE_MAJOR@ +#define COLE_MINOR_VERSION @COLE_MINOR@ +#define COLE_MICRO_VERSION @COLE_MICRO@ +extern int cole_major_version; +extern int cole_minor_version; +extern int cole_micro_version; +extern char *cole_version; +extern char *cole_host_info; + +/* + * ********************************************************************** + * errors + * ********************************************************************** + */ +enum _COLERRNO { +/* & = means that you can use perror(3) call to print an error message */ +/* you can always use cole_perror to print an error message */ + COLE_EFIRST, /* Leave this at first place */ +/*&*/ COLE_EMEMORY, /* Failed malloc(3) or realloc(3) */ +/*&*/ COLE_EOPENFILE, /* Failed fopen(3) */ +/*&*/ COLE_ECLOSEFILE, /* Failed fclose(3) */ +/*&*/ COLE_EREAD, /* Failed fread(3) */ +/*&*/ COLE_EWRITE, /* Failed fwrite(3) */ +/*&*/ COLE_EREMOVE, /* Failed remove(3) */ +/*&*/ COLE_ETMPNAM, /* Failed tmpnam(3) */ +/*&*/ COLE_ESEEK, /* Failed fseek(3) */ +/*&*/ COLE_EERRNO, /* Some system call failed */ + COLE_ENOFILESYSTEM, /* File is not a filesystem */ + COLE_EINVALIDFILESYSTEM,/* Filesystem is broken, it's invalid */ + COLE_EISNOTDIR, /* Directory entry is not a directory */ + COLE_EISNOTFILE, /* Directory entry is not a file */ + COLE_EFILENOTFOUND, /* Doesn't exist a file with the given name */ + COLE_EOF, /* End of file has been reached */ + COLE_EMEMBERISNOTDIR, /* A member of the filename is not + a directory */ + COLE_EBROKENFILENAME, /* The filename is not right written */ + COLE_EFILENAMEISNOTFILE,/* Filename is not a file */ + COLE_EFSEEKDELTA, /* Delta argument is not valid */ + COLE_EFSEEKFLAG, /* Flag argument is not valid */ + COLE_EUNKNOWN, /* An unknown error ocurred, can be a bug */ + COLE_ELAST /* Leave this at last place */ +}; +typedef enum _COLERRNO COLERRNO; + +void cole_perror (const char *s, COLERRNO colerrno); + +/* + * ********************************************************************** + * other enums + * ********************************************************************** + */ +enum _COLE_SEEK_FLAG +{ + COLE_SEEK_SET, + COLE_SEEK_FORWARD, + COLE_SEEK_BACKWARD, + COLE_SEEK_END +}; +typedef enum _COLE_SEEK_FLAG COLE_SEEK_FLAG; + +/* + * ********************************************************************** + * structures + * ********************************************************************** + */ +/* These are opaque data types, because the internal structure will change */ +typedef struct _COLEFS COLEFS; +typedef struct _COLEDIR COLEDIR; +typedef struct _COLEDIRENT COLEDIRENT; +typedef struct _COLEFILE COLEFILE; + + +/* + * ********************************************************************** + * functions types + * ********************************************************************** + */ +typedef int (COLE_RECURSE_DIR_FUNC) (COLEDIR *coledir, + void *info, + COLERRNO *colerrno); +typedef int (COLE_RECURSE_DIRENT_FUNC) (COLEDIRENT *coledirentry, + void *info, + COLERRNO *colerrno); +typedef int (COLE_RECURSE_VISIT_DIR_FUNC) (COLEDIR *coledir, + void *info); +typedef void (COLE_LOCATE_ACTION_FUNC) (COLEDIRENT *coledirentry, + void *info); +/* + * ********************************************************************** + * calls + * ********************************************************************** + */ + +/* *********** + * filesystem + * ***********/ +COLEFS * cole_mount (char *filename, + COLERRNO *colerrno); +int cole_umount (COLEFS *colefilesystem, + COLERRNO *colerrno); +int cole_print_tree (COLEFS *colefilesystem, + COLERRNO *colerrno); +int cole_locate_filename (COLEFS *colefilesystem, + char *filename, + void *info, + COLE_LOCATE_ACTION_FUNC *action, + COLERRNO *colerrno); +int cole_recurse_tree (COLEFS *colefilesystem, + void *info, + COLE_RECURSE_DIR_FUNC *inroot, + COLE_RECURSE_DIRENT_FUNC *indirentry, + COLE_RECURSE_DIR_FUNC *indir, + COLE_RECURSE_DIR_FUNC *outdir, + COLE_RECURSE_VISIT_DIR_FUNC *visitdir, + COLERRNO *colerrno); + + +/* *********** + * file + * ***********/ +COLEFILE * cole_fopen (COLEFS *colefilesystem, + char *filename, + COLERRNO *colerrno); +COLEFILE * cole_fopen_direntry (COLEDIRENT *coledirentry, + COLERRNO *colerrno); +int cole_fclose (COLEFILE *colefile, + COLERRNO *colerrno); +size_t cole_fsize (COLEFILE *colefile); +size_t cole_fread (COLEFILE *colefile, + void *ptr, + size_t size, + COLERRNO *colerrno); +int cole_feof (COLEFILE *colefile); +size_t cole_ftell (COLEFILE *colefile); +int cole_fseek (COLEFILE *colefile, + size_t delta, + COLE_SEEK_FLAG direction, + COLERRNO *colerrno); +int cole_frewind (COLEFILE *colefile, + COLERRNO *colerrno); + +/* *********** + * directory and directory entry + * ***********/ +COLEDIR * cole_opendir_rootdir (COLEFS *colefilesystem, + COLERRNO *colerrno); +COLEDIR * cole_opendir_direntry (COLEDIRENT *coledirentry, + COLERRNO *colerrno); +int cole_closedir (COLEDIR *coledir, + COLERRNO *colerrno); +COLEDIRENT * cole_visiteddirentry (COLEDIR *coledir); +COLEDIRENT * cole_nextdirentry (COLEDIR *coledir); +char * cole_dir_getname (COLEDIR *coledir); +size_t cole_dir_getsize (COLEDIR *coledir); +long cole_dir_getdays1 (COLEDIR *coledir); +long cole_dir_getsec1 (COLEDIR *coledir); +long cole_dir_getdays2 (COLEDIR *coledir); +long cole_dir_getsec2 (COLEDIR *coledir); +char * cole_direntry_getname (COLEDIRENT *coledirentry); +size_t cole_direntry_getsize (COLEDIRENT *coledirentry); +long cole_direntry_getdays1 (COLEDIRENT *coledirentry); +long cole_direntry_getsec1 (COLEDIRENT *coledirentry); +long cole_direntry_getdays2 (COLEDIRENT *coledirentry); +long cole_direntry_getsec2 (COLEDIRENT *coledirentry); +int cole_direntry_isdir (COLEDIRENT *coledirentry); +int cole_direntry_isfile (COLEDIRENT *coledirentry); + + +#ifdef __cplusplus +} +#endif + +#endif /* __COLE_H */ + diff --git a/cole/doc/HACKING b/cole/doc/HACKING new file mode 100644 index 0000000..182ee6c --- /dev/null +++ b/cole/doc/HACKING @@ -0,0 +1,163 @@ +/* + cole - A free C OLE library. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +Pre-hacking: +************ + +If you want to play, you'll need: + + An ANSI C system (libraries and C compiler). + + GNU m4, GNU automake-1.4, GNU autoconf 2.13 and GNU libtool 1.3.2 + if you want to change `configure.in' or some `Makefile.am'. + + DocBook 3.x tools and gtk-doc + (from GNOME CVS (http://cvs.gnome.org/)) if you want to make + a distribution. + + +Tests: +****** + +If you write a new public call, write their documentation: see comments before the implementation of other public calls, and write a test and put in in `examples' directory. + + +API: +**** + +The API 2.x must be modelled after `stdio.h' ANSI C calls, but cleanner. This +means the arguments must be the minimal that the call _really_ needs. + +The last argument of most of calls must be `COLERRNO *colerrno'. This must be set if an error is found when calling some other call or a system call, but colerrno can be NULL, so always use `if (colerrno != NULL) *colerrno = COLE_...'. + +All the public calls neet to have a `COLERRNO *colerrno' argument, except those that simply can not fail. + +If you create a new error code, insert it in the list of the colerrno argument in the document comment above the function with the new error code, insert in enum _COLERRNO, add a comment there, add an entry in cole_perror and review all the sources that call the function that have the new error code in order to catch the new error (inclusive utils and examples directories). + +When writting a call that calls another calls which returns colerrno, say in documentation something like: ` * @colerrno: error value (COLE_AAA, errors from calls cole_XXX(), cole_XXY() and COLE_XXZ())' if the call that you are writting calls cole_XXX, cole_XXY and COLE_XXZ and returns COLE_AAA by itself. + + +Implementation: +*************** + +When you write the code to check the return value from a function with switch, always write a default case (in the most cases the default case will return a COLE_UNKNOWN). If you use if's, write an else case. + + +Documentation: +************** + +If you modified `cole-manual.sgml', you must run `make html' in the `doc' +subdirectory. + +If you modified the templates, you must run `make sgml' and then `make html' +in the `doc' subdirectory. + +If you modified `cole-sections.txt'... well, I guess you must run +`make templates' and then `make sgml' and then `make html' in the `doc' +subdirectory (but I'm not sure because I'm lerning this gtk-doc thing). + +If you changed the existing comment of a function, structure, etc, you must +run `make sgml' and then `make html' in the `doc' subdirectory. + +If you changed the parameters of some function, run `make templates' and then +`make sgml' and then `make html'. + +If you added, renamed or deleted some function, well you tell me what to do. + +All targets in the `Makefile' in the `doc' subdirectory modifies sources, that +way the documentation can be updated when checked in CVS. + +Before you regenerate documentation, must have a build directory with all the +code compiled, because `cole.h' file is needed. + + +FlashPix file format: +********************* + +Seems to me that "Root Entry" pps number is zero (like MS files), but it has +no name! I mean, pps_list[0].type == 5, but pps_list[0].name[0] == 0. + + + + + + + + + +********************** +* OLD HACKING DOCUMENT +********************** + + +Hacking: +******** + +Ok, next few lines are for people trying to understand the cole code. + +to code a OLE2 file (which is done by OLEcode) is done it two fases: +process and generate. + +process insert all the information in the Structure, and generate reads +this Structure and write the actual output_file (wich is an ole2 file) by +copying real files and some parts of Structure to output_file. + +in the generate stage we know the actual blocks where each stream is +stored, so in this stage this start block is written in Root. + +functions of process stage starts with process_* and add_*. +functions of generating stage starts with generate_* and write_*. + +the size property of `Root Entry' pps is the actual size of sbfile, and +always is a multiple of 0x40. + +A graph of Structure following: + +[missing, remember me I must do it] + +size of Input (Input.size) is never used, it's no necessary. In any case, +what info we should write there? Same case as Input.blocks. + +somewhere in process stage, name of real files are copied by reference, +that means two vars will point to the same memory posittion. one var is +in pps_entry * stream_list names, and the other is in sbfile and Input in +Structure. But it's ok. + +notes: +a ole2 file can or not contain small streams. if there are, it will +have SDepot, although in Structure always SDepot exist, +SDepot->size == sbfile->size == 0 if file do not contain small streams + +it seems to me a ole2 file could not have big streams, just small streams. BUT it will at least one block that is taken by BDepot, because in BDepot store block chains for SDepot and Root + +It seems that Solaris doesn't like directories as targets... must be a file. +This is a problem in doc/Makefile. + +about the code: +it's spaguetticode. I know. Long var names. I know. Help me to fix it. +comments are generally after the line it comments, as explanation of what +i have done. + +advices: +when doing a change, verify the program works with files with SDepot and +files with out SDepot (files with or without small streams) + +if you change the version number, change it both in configure.in file and in doc/cole-manual.sgml. + diff --git a/cole/doc/Makefile.am b/cole/doc/Makefile.am new file mode 100644 index 0000000..5e6c85a --- /dev/null +++ b/cole/doc/Makefile.am @@ -0,0 +1,92 @@ +## Process this file with automake to produce Makefile.in + + +EXTRA_DIST = cole-manual.sgml \ + introduction.sgml \ + compile.sgml \ + using.sgml \ + bugs.sgml \ + gpl.sgml \ + legal.sgml \ + HACKING \ + cole-manual.sgml-old + +dist-hook: all + cp $(srcdir)/cole-sections.txt $(distdir) + cp -r $(srcdir)/tmpl $(distdir) + cp -r $(srcdir)/cole-manual $(distdir) + + + +# Headers to scan for declarations +scanned_headers = ../internal.h ../support.h ./cole.h + + +# The name of the module. +DOC_MODULE = cole + +# The top-level SGML file. +DOC_MAIN_SGML_FILE = cole-manual.sgml + +# The directory containing the source code (if it contains documentation). +DOC_SOURCE_DIR = $(top_srcdir) + +# The directory where the documentation will be installed +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) + + + +scan: + cp $(top_builddir)/cole.h $(srcdir); \ + (cd $(srcdir); \ + gtkdoc-scan --module=$(DOC_MODULE) $(scanned_headers); \ + rm cole.h) +templates: scan + (cd $(srcdir); \ + gtkdoc-mktmpl --module=$(DOC_MODULE)) +sgml: + (cd $(srcdir); \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR)) +html: + (cd $(srcdir); \ + cat ../BUGS | sed "s/>/>/g" | sed "s/ BUGS; \ + db2html $(DOC_MAIN_SGML_FILE); \ + rm BUGS) +rtf: + (cd $(srcdir); \ + cat ../BUGS | sed "s/>/>/g" | sed "s/ BUGS; \ + db2rtf $(DOC_MAIN_SGML_FILE); \ + -rm BUGS) +ps: + (cd $(srcdir); \ + cat ../BUGS | sed "s/>/>/g" | sed "s/ BUGS; \ + db2ps $(DOC_MAIN_SGML_FILE); \ + -rm BUGS) + +regenerate-all: templates sgml html + + + +clean-local: + (cd $(srcdir); \ + rm -f *~ *.bak *.hierarchy *.signals *.args; \ + rm -fr DBTOHTML_OUTPUT_DIR* *.junk $(DOC_MODULE)-decl-list.txt) + +maintainer-clean-local: clean + (cd $(srcdir); \ + rm -rf sgml html cole-manual tmpl/*.bak; \ + rm -rf $(DOC_MODULE)-decl.txt) + + + +# if db2html generate subdirectories, it's broken the next rule +# install-data-local: all +# $(INSTALL) -d $(TARGET_DIR) +# $(INSTALL) ./cole-manual/* $(TARGET_DIR) + + + +## Solaris make doesn't like directory as a target... + +.PHONY : ps rtf html sgml templates scan + diff --git a/cole/doc/Makefile.in b/cole/doc/Makefile.in new file mode 100644 index 0000000..a12712a --- /dev/null +++ b/cole/doc/Makefile.in @@ -0,0 +1,256 @@ +# 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +COLE_MAJOR = @COLE_MAJOR@ +COLE_MICRO = @COLE_MICRO@ +COLE_MINOR = @COLE_MINOR@ +DLLTOOL = @DLLTOOL@ +HOST_ALIAS_NAME = @HOST_ALIAS_NAME@ +HOST_CANONICAL_NAME = @HOST_CANONICAL_NAME@ +HOST_CPU = @HOST_CPU@ +HOST_OS = @HOST_OS@ +HOST_VENDOR = @HOST_VENDOR@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +NM = @NM@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ + +EXTRA_DIST = cole-manual.sgml introduction.sgml compile.sgml using.sgml bugs.sgml gpl.sgml legal.sgml HACKING cole-manual.sgml-old + + +# Headers to scan for declarations +scanned_headers = ../internal.h ../support.h ./cole.h + +# The name of the module. +DOC_MODULE = cole + +# The top-level SGML file. +DOC_MAIN_SGML_FILE = cole-manual.sgml + +# The directory containing the source code (if it contains documentation). +DOC_SOURCE_DIR = $(top_srcdir) + +# The directory where the documentation will be installed +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = 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 doc/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 = doc + +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 + $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook +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-local + +clean: clean-am + +distclean-am: distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am \ + maintainer-clean-local + @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 + + +dist-hook: all + cp $(srcdir)/cole-sections.txt $(distdir) + cp -r $(srcdir)/tmpl $(distdir) + cp -r $(srcdir)/cole-manual $(distdir) + +scan: + cp $(top_builddir)/cole.h $(srcdir); \ + (cd $(srcdir); \ + gtkdoc-scan --module=$(DOC_MODULE) $(scanned_headers); \ + rm cole.h) +templates: scan + (cd $(srcdir); \ + gtkdoc-mktmpl --module=$(DOC_MODULE)) +sgml: + (cd $(srcdir); \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR)) +html: + (cd $(srcdir); \ + cat ../BUGS | sed "s/>/>/g" | sed "s/ BUGS; \ + db2html $(DOC_MAIN_SGML_FILE); \ + rm BUGS) +rtf: + (cd $(srcdir); \ + cat ../BUGS | sed "s/>/>/g" | sed "s/ BUGS; \ + db2rtf $(DOC_MAIN_SGML_FILE); \ + -rm BUGS) +ps: + (cd $(srcdir); \ + cat ../BUGS | sed "s/>/>/g" | sed "s/ BUGS; \ + db2ps $(DOC_MAIN_SGML_FILE); \ + -rm BUGS) + +regenerate-all: templates sgml html + +clean-local: + (cd $(srcdir); \ + rm -f *~ *.bak *.hierarchy *.signals *.args; \ + rm -fr DBTOHTML_OUTPUT_DIR* *.junk $(DOC_MODULE)-decl-list.txt) + +maintainer-clean-local: clean + (cd $(srcdir); \ + rm -rf sgml html cole-manual tmpl/*.bak; \ + rm -rf $(DOC_MODULE)-decl.txt) + +# if db2html generate subdirectories, it's broken the next rule +# install-data-local: all +# $(INSTALL) -d $(TARGET_DIR) +# $(INSTALL) ./cole-manual/* $(TARGET_DIR) + +.PHONY : ps rtf html sgml templates scan + +# 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: diff --git a/cole/doc/bugs.sgml b/cole/doc/bugs.sgml new file mode 100644 index 0000000..098d988 --- /dev/null +++ b/cole/doc/bugs.sgml @@ -0,0 +1,39 @@ + + + cole developers have done their best effort to fix all the bugs of cole. But may be some of the are still hidden in the code. If you found one (or many!), please send a report to the maintainer (&maintainer-email-ulink;). When sending a report, please: + + + + + Describe with detail the behavior of cole and why you think it's a bug. + + + + + Configure cole using the argument --enable-verbose and send the output showing the bug. + + + + + Send the content of the variables cole_version and cole_host_info that the cole release you are using have. You wil have to write a little program to do this, but it will help much. =) + + + + + If you can, send the most small source code that shows the bug in action. May be you want to send the Structured Storage file you have been processing. + + + + + You can send the files config.log and config.cache (which were created by configure) if you want. + + + + + Thank you very much. + + + Following is the BUGS file for this release. + +&BUGS-File; + diff --git a/cole/doc/cole-manual.sgml b/cole/doc/cole-manual.sgml new file mode 100644 index 0000000..d32ea7b --- /dev/null +++ b/cole/doc/cole-manual.sgml @@ -0,0 +1,73 @@ + + + + + + + + + + + +<arturo@directmail.org>"> +]> + + + + + + cole Library Reference Manual + + 1998, 1999 + &author-name-full; + + + + + + Introduction + &Introduction; + + + + + How to compile cole + &How-To-Compile; + + + + + cole Library + + This is the documentation autogenerated from the source code. It have the cole API for this release, and some internal structures and internal calls. + + + Note: what Microsoft calls stream is called file in this project, storage is called directory and docfile (a Structured Storage file) is called filesystem. + + &Using-cole; + + &cole-API; + &cole-Internals; + + + + + Bugs + &Bugs; + + + + + Legal issues + &Legal; + + + +&GPL-License-Chapter; + + + + diff --git a/cole/doc/cole-manual.sgml-old b/cole/doc/cole-manual.sgml-old new file mode 100644 index 0000000..2c87586 --- /dev/null +++ b/cole/doc/cole-manual.sgml-old @@ -0,0 +1,1148 @@ + + <arturo@directmail.org>"> + &author-email;"> + + + <arturo@directmail.org>"> + + + + + free"> + + + + + GNU General Public License + as published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + "> +]> + + + + + + + + + + + + + + cole Programmer Reference + cole &this-release; + + + Arturo + Tena + + &author-email-address; + + + + + 1999 + &author-name-full; + + + + &license; + + + + + + + + + + + + What is cole? + + cole is a free C OLE library. + + + cole is distributed under the terms of the + GNU General Public License + (GPL) to give an impulse to the Free Software. + + + Using cole, you can access Microsoft' `Structured Storage' files. + The most popular Microsoft's programs generate `Structured Storage' files, + incluiding the Microsoft' suite for offices. StarDivision' suite + (StarOffice) generate `Structured Storage' files too. FlashPix file + format is `Structured Storage' too. + + + What is a `Structured Storage' file? + Inside a `Structured Storage' file there is a filesystem, with + directories and files, which Microsoft calls `containers' and `streams'. + Using cole you can travel through that filesystem and read the files. + + + cole doesn't know about internal structure of a stream, it only reads the + raw data. You can use then the Microsoft's documentation available at + http://msdn.microsoft.com + or the information available at http://www.wotsit.org to read that structure. If you know + anything in the side of StarDivision email me. FlashPix is well + documented. + + + cole was developed using the information available at http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/guide.html, and no + information from any other source (incluiding Microsoft) has been used. + + + + + + + Where to get cole source code + + You can get the most recent stable release of cole from the Filters Project home page or from Metalab (former SunSite) archive. + + + + + + + Compiling + + How to compile + + A standard configure script is provided. You can + read the instructions in the file INSTALL. + A typical configuration/compilation/installation session is shown next. + + +$ ls +cole-&this-release;.tar.gz +$ gzip -d cole-&this-release;.tar.gz +$ tar -xf cole-&this-release;.tar +$ ls +cole-&this-release;.tar.gz cole-&this-release;/ +$ cd cole-&this-release; +$ ./configure --prefix=/usr/local +... +Configured cole release &this-release; +$ make +... +$ make install +... +$ make clean +... + + You can add the following flags to configure: + + + + --enable-cole-verbose. To make cole verbose + everything. Usefull when debugging cole. + + + --enable-osf-align-check. If you have errors + while compiling under OSF1, enable this flag. + + + + Please, if you have some error with cole, send the cole's output when + compiled using --enable-cole-verbose to the + maintainer. + + + For additional instructions, read the file INSTALL. + If you have problems, you should read the Filters Project + FAQ and later email to the maintainer. + + + Only a static library is compiled by default. If you want compile a shared + library too, you have to include the flag + --enable-shared when + running configure, and the program that dinamically links against cole + shared library still needs to be under a license compatible with GPL. + This is because cole is under GPL license, not LGPL license. + + + + Supported plattforms + + cole has been successfully tested under (as reported by + uname -mrsv or with the system information): + + +Linux 2.0.36 #1 Wed Feb 17 19:45:41 EST 1999 i586 +Linux 2.0.35 #1 Thu Jul 23 14:01:04 EDT 1998 i586 +OSF1 V5.0 564 alpha +OSF1 V4.0 564 alpha +Solaris in Ultra Sparc (sparc-sun-solaris2.5.1) + Arturo Tena <arturo@directmail.org> +SunOS 5.6 Generic_105181-03 sun4u + Matthew Evans <matthewe@its.caltech.edu> +Windows NT 4.0 SP4 + with Cygwin b20.1 + with CoolView DLL + Martin Scharpf <martin.scharpf@bbraun.com> + + If you have a different one, it will be useful to hear about you. Please, + email to the maintainer. + + + + + + + + Using + + cole is used to access Microsoft OLE's &ss; and &cf;. + Specifically, cole extracts the structures named streams + from a &ssf;. Each stream is written to a new file. + A dynamic tree in memory is created to store the name of the streams and + the name of the files where they are written, besides other information. + + + cole doesn't know the structure of each stream, it only extract them to + new files. If you want to know the structure of a particular stream, + you can read the Microsoft's documentation, or seach in Wotsit. Using that documentation, you + can read the extracted streams searching for the actual information. + + + API + + cole has two major functions: OLEdecode and OLEcode. + The first takes an &ssf; and divide it into streams. + The last takes streams and generate an &ssf; (the + stream_list + structure and the streams itself must be valid, but cole doesn't provide + functions to validate them by now). + + + #include <cole/cole.h> + int OLEdecode + char *OLEfilename + pps_entry **stream_list + U32 *root + U16 max_level + + + This function extracts the streams of the file wich name is + OLEfilename and generate a array of + pps_entry's named stream_list. + The array make a tree (ie. each pps_entry have fields such as next + for brothers and dir for children pps_entry's) with root pps_entry + root, and this tree stores the stream's names, + the names of the temporal files where the streams were written and other + information. Only streams with level minor than or equal to + max_level are extracted, but all streams are + extracted if max_level is zero. + + + OLEdecode returns one of the following numbers: + + + + 0. Sucess. + + + 4. Couldn't open OLEfilename file + (can use perror(3)). + + + 8. OLEfilename file seems to be a plain + text file, not a &ssf;. + + + 9. OLEfilename is a binary file, + but it's not a &ssf;. + + + 5. Error reading from file, means OLEfilename + file has a faulty &ss; format. + + + 6. Error removing temporal files. + + + 7. Error creating temporal files. + + + 10. Error allocating memory, there's no more memory. + + + +#include <stdio.h> +#include <cole/cole.h> + +struct pps_block { +char name[0x20]; /* name of the stream */ +U8 type; /* type of this pps: 5 == root of stream_list, + 1 == dir, 2 == stream */ +char filename[L_tmpnam]; /* temporal file name where the stream were written, + valid only if type == 2 */ +U32 size; /* the size of the temporal file, + valid only if type == 2 */ +U32 next; /* next pps_entry in this directory, brother pps */ +U32 dir; /* pps_entry children, valid only if type != 2 */ +U16 level; /* level of the pps in the tree */ +U32 seconds1; /* time creation */ +U32 seconds2; /* time creation */ +U32 days1; /* date creation */ +U32 days2; /* date creation */ +/* ... */ +}; +typedef struct pps_block pps_entry; + + + pps_entry structure describes one extrated stream. + + + #include <cole/cole.h> + int OLEcode + const char *OLEfilename + int trunc + pps_entry *stream_list + U32 root + + + This function takes the stream_list tree + (which have a root pps_entry root and + describes some existing valid streams) and generate a &ssf; + named OLEfilename. If trunc + is zero and OLEfilename exists, returns 2 + (see below), in any other case OLEfilename + will be created or recreated as needed. + + + OLEcode returns one of the following numbers: + + + + 0. All goes OK. + + + 1. Error writting in OLEfilename + (can use perror(3)). + + + 2. trunc is zero and OLEfilename exist. + + + 3. Can't create OLEfilename + (can use perror(3)). + + + 10. Error allocating memory, there's no more memory. + + + 11. Error reading stream's temporal files. + + + 12. Error reading stream_list, it's broken. + + + + #include <cole/cole.h> + int freeOLEtree + pps_entry *stream_list + + + You must call this function at the end of processing the streams, to + free memory and remove the stream files. + + + #include <cole/cole.h> + void verbosePPSTree + pps_entry *stream_list + U32 root + int level + + + You can use this function to display the tree of a &ssf;. + + + + Linking + + You need link your program against libcole.a. + This means is ok: + + +$ cc yourprogram.o libcole.a -o yourprogram + + If you use threads, take in count that cole is not reentrant safe + (cole 2.0.0 will be reentrant safe). + + + + An example + + The following example is similar to the included file + demo.c. + It opens, display the tree and closes a &ssf;: + + +#include <stdio.h> +#include <cole/cole.h> + + You need to include cole/cole.h header to + use the cole functions. + + +int +main (int argc, char **argv) +{ + int result; + pps_entry *stream_tree; + U32 root_stream; + U32 stream; + + if (argc != 3) + { + fprintf (stderr, "cole example 1. cole is a free C OLE library.\n"); + fprintf (stderr, "Usage: coleexample1 srcFILE destFILE.\n"); + fprintf (stderr, + "Note: if srcFILE and destFILE are the same file, it will be overwritten.\n"); + return 1; + } + Just argument checks. + + verbose ("Decoding ************************************"); + result = OLEdecode (argv[1], &stream_tree, &root_stream, 0); + + Here we call OLEdecode in order to extract the + structure of the &ssf; which name is stored in + argv[1]. The structure will be stored in + stream_tree, and the root of the structure + in root_stream (we will need the root later). + The last argument indicate the level of the structure that + OLEdecode will extract, if it's zero it will + extract all the levels. + + + fprintf (stderr, "OLEdecode output = %d\n", result); + if (result != 0) + { + fprintf (stderr, "Decoding: "); + perror (argv[1]); + return 1; + } + else + verbose ("Success decoding"); + + printf ("******* Stream tree:\n"); + verbosePPSTree (stream_tree, root_stream, 0); + + verbosePPSTree is a cole function that prints + to the standard output the complete tree of a &ssf;. With the last + parameter equal to zero, we are printing all levels of the + structure. + + + printf ("******* Top level no directory streams:\n"); + /* travel through the top level no directory streams, + just follows next field and ignore type 1 fileds */ + for (stream = stream_tree[root_stream].dir; + stream != 0xffffffff; + stream = stream_tree[stream].next) + { + if (stream_tree[stream].type != 1 && stream_tree[stream].level == 1) + if (!isprint(stream_tree[stream].name[0])) + printf ("'\\x%02x%s'\n", stream_tree[stream].name[0], + stream_tree[stream].name+1); + else + printf ("'%s'\n", stream_tree[stream].name); + } + + With this code, we are traveling in the structure, which is a + tree in an array, this means it's a tree of structures with indexes + for the brothers and the children (if any). As you can see, + the actual names of the streams may begin with no printable characters. + + + verbose ("Coding **************************************"); + result = OLEcode (argv[2], 1, stream_tree, root_stream); + + If you want to read the raw streams you only need + OLEdecode function. But if you want to generate + a &ssf;, you need to have the raw streams, the tree in an array + structure and the root of such tree to use OLEcode. + cole &this-release; doesn't provide functions to such tasks, wait + for cole 2.0.0. + + + fprintf (stderr, "OLEcode output = %d\n", result); + if (result != 0) + { + fprintf (stderr, "Coding "); + perror (argv[2]); + return 1; + } + else + verbose ("Success coding\n"); + + + verbose ("Freeing *************************************"); + /* need to free all the allocated memory */ + result = freeOLEtree (stream_tree); + + If you used OLEdecode, you must use + freeOLEtree after process the raw stream. + + + fprintf (stderr, "freeOLEtree output = %d\n", result); + + return result; +} + When you run this example, the following output is produced: + +$ ./coleexample1 examples/text.doc text2.doc +OLEdecode output = 0 +******* Stream tree: +DIR 00 'Root Entry' + FILE 01 98 ' CompObj' + FILE 03 312 ' SummaryInformation' + FILE 04 2381 'WordDocument' + FILE 02 20 ' Ole' +******* Top level no directory streams: +'\x01CompObj' +'\x05SummaryInformation' +'WordDocument' +'\x01Ole' +OLEcode output = 0 +freeOLEtree output = 0 + + + Another example + + The next example opens a file, and guess what version of + Microsoft Excel generated the file. + + +#include <stdio.h> +#include <string.h> +#include <cole/cole.h> + +int +main (int argc, char **argv) +{ + pps_entry *stream_tree; + U32 root_stream; + U32 stream; + FILE * f; + unsigned char buff[6]; + + if (argc != 2) + { + fprintf (stderr, "cole example 2. cole is a free C OLE library.\n"); + fprintf (stderr, "Usage: coleexample2 FILE.\n"); + return 1; + } + + if (OLEdecode (argv[1], &stream_tree, &root_stream, 0)) { + printf ("File is not a Microsoft Excel one.\n"); + return 1; + } + + for (stream = stream_tree[root_stream].dir; + stream != 0xffffffff; + stream = stream_tree[stream].next) { + if (stream_tree[stream].type != 1 && stream_tree[stream].level == 1) + if (!strcmp(stream_tree[stream].name, "Workbook") || + !strcmp(stream_tree[stream].name, "Book")) { + /* Book stream found */ + f = fopen (stream_tree[stream].filename, "rb"); + if (f == NULL) { + perror ("Error opening temporal file"); + freeOLEtree (stream_tree); + return 1; + } + if (fread (buff, 1, 6, f) != 6) { + perror ("Error reading temporal file"); + fclose (f); + freeOLEtree (stream_tree); + return 1; + } + /* the next is from the internal structure of a Excel stream */ + if (buff[0] != 0x09 || buff[1] != 0x08) { + printf ("File is not a Microsoft Excel one.\n"); + fclose (f); + freeOLEtree (stream_tree); + return 1; + } + if (buff[4] != 0x00 || (buff[5] != 0x05 && buff[5] != 0x06)) { + printf ("File is from an unknown Microsoft Excel version.\n"); + fclose (f); + freeOLEtree (stream_tree); + return 1; + } + if (buff[5] == 0x05) + printf ("File is from Microsoft Excel version 5 or 7.\n"); + else + printf ("File is from Microsoft Excel version 8.\n"); + + fclose (f); + freeOLEtree (stream_tree); + return 0; + } + } + + printf ("File is not a Microsoft Excel one.\n"); + freeOLEtree (stream_tree); + return 0; +} + When you run this example, the following output is produced: + +$ coleexample2 examples/sprsheet.xls +File is from Microsoft Excel version 5 or 7. +$ coleexample2 examples/text.doc +File is not a Microsoft Excel one. +$ coleexample2 README +File is not a Microsoft Excel one. + + + + + + + Miscelaneous issues + + Current maintainer + + The current cole's maintainer is + &maintainer-name-full; &maintainer-email-ulink;. + + + + Patches + + How to apply a patch + + An example is better that an explanation. Here we will patch to upgrade + from 0.1.0 release to 1.0.0 release. + + +$ ls +cole-0.1.0/ cole-0.1.0-1.0.0.diff +$ cd cole-0.1.0 +$ patch -Np1 < ../cole-0.1.0-1.0.0.diff +$ cd .. +$ mv cole-0.1.0 cole-1.0.0 +$ ls +cole-1.0.0/ cole-0.1.0-1.0.0.diff + + + How to make a patch + + If you fix or add some code, we will very glad if you send the patch + to the maintainer. + The right way to make a patch is to have two directories: the original + (here cole-1.0.0) and another when your changes + have been made (here cole-1.0.0-myfix). + + +$ ls +cole-1.0.0/ cole-1.0.0-myfix/ +$ LC_ALL=C TZ=UTC0 diff -Naur cole-1.0.0 cole-1.0.0-myfix > cole-1.0.0-patch +$ ls +cole-1.0.0/ cole-1.0.0-my-fix/ cole-1.0.0-patch + + + You can then send cole-1.0.0-patch to the + maintainer explaining what did you fix + or what did you add. + + + + + + + + + References + + + cole homepage. + + + OLE-Storage. (formely LAOLA). + + + Authors: see the file AUTHORS. + + + + + + + + +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's 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. + + + + +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's 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's 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. + + +one line to give the program's name and a brief idea of what it does. +Copyright (C) year name of author + +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) year 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. + +signature of Ty Coon, 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. + + + + + + + + Legal issues + + Trademarks + + "Microsoft Word", "Microsoft Excel", "Microsoft Publisher" and + "Microsoft Power Point" are trademarks of Microsoft Corporation. + + + "Free Software" is not trademark of anyone, but it's an important term in + the Free Software community, and for the Free Software Foundation. + + + All other trademarks are the property of their respective owners. + + + If there is a trademark here that needs to be listed formally above, + please email to the &maintainer-email-ulink; so it can be added. + + + + Copyright and disclaimer + + &license; + + + This document is provided as is without any express or implied warranties. + While every effort has been taken to ensure the accuracy of the information + contained in this document, the author/maintainer/contributors assume(s) no + responsibility for errors or omissions, or for damages resulting from the use + of the information contained herein. + + + + + + + + diff --git a/cole/doc/cole-manual/bugs.html b/cole/doc/cole-manual/bugs.html new file mode 100644 index 0000000..781490f --- /dev/null +++ b/cole/doc/cole-manual/bugs.html @@ -0,0 +1,223 @@ +Bugs
cole Library Reference Manual
PrevNext

Chapter 4. Bugs

cole developers have done their best effort to fix all the bugs of cole. But may be some of the are still hidden in the code. If you found one (or many!), please send a report to the maintainer (<arturo@directmail.org>). When sending a report, please:

  1. Describe with detail the behavior of cole and why you think it's a bug. +

  2. Configure cole using the argument --enable-verbose and send the output showing the bug. +

  3. Send the content of the variables cole_version and cole_host_info that the cole release you are using have. You wil have to write a little program to do this, but it will help much. =) +

  4. If you can, send the most small source code that shows the bug in action. May be you want to send the Structured Storage file you have been processing. +

  5. You can send the files config.log and config.cache (which were created by configure) if you want. +

Thank you very much.

Following is the BUGS file for this release.


Report bugs to the maintainer (see the file `AUTHORS' for details).
+Please, along with your detailed report, send the cole's output when compiled
+using `--enable-verbose' (see the files `README' and `INSTALL' for details).
+
+
+Current bugs:
+**************
+
+None.
+
+
+Fixed bugs:
+************
+
+Reported that cole can't read files biggers that 8Mb. UPDATE: oledecod.c is
+changed now to read additional blocks to the bbd. This fixes the bug.
+
+Reported strange bug in cole 0.1.0 using Solaris using `../demo sprsheet.xls'
+in examples directory. We need more test there! UPDATE: Seems to be fixed in
+cole 1.0.0 with the endianess care code.
+
+
+Possible bugs:
+**************
+
+* cole is not reentrant safe (it's in TODO):
+  What happend if, in any program, one user tries to decode and/or code
+  two files (the same or diferent)? Because static vars, will it get
+  broke? I think yes, mmmh...

PrevHomeNext
Internals Legal issues
\ No newline at end of file diff --git a/cole/doc/cole-manual/cole-api.html b/cole/doc/cole-manual/cole-api.html new file mode 100644 index 0000000..5a79bd7 --- /dev/null +++ b/cole/doc/cole-manual/cole-api.html @@ -0,0 +1,4305 @@ +API
cole Library Reference Manual
PrevNext

API

Name

API -- Public cole API for the present release.

Synopsis


#include <cole/cole.h>
+
+
+#define     COLE_MAJOR_VERSION
+#define     COLE_MINOR_VERSION
+#define     COLE_MICRO_VERSION
+extern      int cole_major_version;
+extern      int cole_minor_version;
+extern      int cole_micro_version;
+extern      char *cole_version;
+extern      char *cole_host_info;
+enum        COLERRNO;
+void        cole_perror                     (const char *s,
+                                             COLERRNO colerrno);
+struct      COLEFS;
+struct      COLEDIR;
+struct      COLEDIRENT;
+struct      COLEFILE;
+COLEFS*     cole_mount                      (char *filename,
+                                             COLERRNO *colerrno);
+int         cole_umount                     (COLEFS *colefilesystem,
+                                             COLERRNO *colerrno);
+int         cole_print_tree                 (COLEFS *colefilesystem,
+                                             COLERRNO *colerrno);
+int         cole_locate_filename            (COLEFS *colefilesystem,
+                                             char *filename,
+                                             void *info,
+                                             COLE_LOCATE_ACTION_FUNC *action,
+                                             COLERRNO *colerrno);
+int         cole_recurse_tree               (COLEFS *colefilesystem,
+                                             void *info,
+                                             COLE_RECURSE_DIR_FUNC *inroot,
+                                             COLE_RECURSE_DIRENT_FUNC *indirentry,
+                                             COLE_RECURSE_DIR_FUNC *indir,
+                                             COLE_RECURSE_DIR_FUNC *outdir,
+                                             COLE_RECURSE_VISIT_DIR_FUNC *visitdir,
+                                             COLERRNO *colerrno);
+COLEFILE*   cole_fopen                      (COLEFS *colefilesystem,
+                                             char *filename,
+                                             COLERRNO *colerrno);
+COLEFILE*   cole_fopen_direntry             (COLEDIRENT *coledirentry,
+                                             COLERRNO *colerrno);
+int         cole_fclose                     (COLEFILE *colefile,
+                                             COLERRNO *colerrno);
+size_t      cole_fread                      (COLEFILE *colefile,
+                                             void *ptr,
+                                             size_t size,
+                                             COLERRNO *colerrno);
+int         cole_feof                       (COLEFILE *colefile);
+size_t      cole_fsize                      (COLEFILE *colefile);
+size_t      cole_ftell                      (COLEFILE *colefile);
+int         cole_fseek                      (COLEFILE *colefile,
+                                             size_t delta,
+                                             COLE_SEEK_FLAG direction,
+                                             COLERRNO *colerrno);
+int         cole_frewind                    (COLEFILE *colefile,
+                                             COLERRNO *colerrno);
+COLEDIR*    cole_opendir_rootdir            (COLEFS *colefilesystem,
+                                             COLERRNO *colerrno);
+COLEDIR*    cole_opendir_direntry           (COLEDIRENT *coledirentry,
+                                             COLERRNO *colerrno);
+int         cole_closedir                   (COLEDIR *coledir,
+                                             COLERRNO *colerrno);
+COLEDIRENT* cole_visiteddirentry            (COLEDIR *coledir);
+COLEDIRENT* cole_nextdirentry               (COLEDIR *coledir);
+int         cole_direntry_isdir             (COLEDIRENT *coledirentry);
+int         cole_direntry_isfile            (COLEDIRENT *coledirentry);
+char*       cole_dir_getname                (COLEDIR *coledir);
+size_t      cole_dir_getsize                (COLEDIR *coledir);
+long        cole_dir_getsec1                (COLEDIR *coledir);
+long        cole_dir_getsec2                (COLEDIR *coledir);
+long        cole_dir_getdays1               (COLEDIR *coledir);
+long        cole_dir_getdays2               (COLEDIR *coledir);
+char*       cole_direntry_getname           (COLEDIRENT *coledirentry);
+size_t      cole_direntry_getsize           (COLEDIRENT *coledirentry);
+long        cole_direntry_getdays1          (COLEDIRENT *coledirentry);
+long        cole_direntry_getsec1           (COLEDIRENT *coledirentry);
+long        cole_direntry_getdays2          (COLEDIRENT *coledirentry);
+long        cole_direntry_getsec2           (COLEDIRENT *coledirentry);

Description

Note: The separator character for filename components is '/'. So, a filename argument can be something like "/Macros/VB/Project1".

Details

COLE_MAJOR_VERSION

#define COLE_MAJOR_VERSION 2

COLE_MINOR_VERSION

#define COLE_MINOR_VERSION 0

COLE_MICRO_VERSION

#define COLE_MICRO_VERSION 1

cole_major_version

extern int cole_major_version;

cole_minor_version

extern int cole_minor_version;

cole_micro_version

extern int cole_micro_version;

cole_version

extern char *cole_version;

cole_host_info

extern char *cole_host_info;

enum COLERRNO

enum COLERRNO {
+/* & = means that you can use perror(3) call to print an error message */
+/* you can always use cole_perror to print an error message */
+	COLE_EFIRST,		/* Leave this at first place */
+/*&*/	COLE_EMEMORY,		/* Failed malloc(3) or realloc(3) */
+/*&*/	COLE_EOPENFILE,		/* Failed fopen(3) */
+/*&*/	COLE_ECLOSEFILE,	/* Failed fclose(3) */
+/*&*/	COLE_EREAD,		/* Failed fread(3) */
+/*&*/	COLE_EWRITE,		/* Failed fwrite(3) */
+/*&*/	COLE_EREMOVE,		/* Failed remove(3) */
+/*&*/	COLE_ETMPNAM,		/* Failed tmpnam(3) */
+/*&*/	COLE_ESEEK,		/* Failed fseek(3) */
+/*&*/	COLE_EERRNO,		/* Some system call failed */
+	COLE_ENOFILESYSTEM,	/* File is not a filesystem */
+	COLE_EINVALIDFILESYSTEM,/* Filesystem is broken, it's invalid */
+	COLE_EISNOTDIR,		/* Directory entry is not a directory */
+	COLE_EISNOTFILE,	/* Directory entry is not a file */
+	COLE_EFILENOTFOUND,	/* Doesn't exist a file with the given name */
+	COLE_EOF,		/* End of file has been reached */
+	COLE_EMEMBERISNOTDIR,	/* A member of the filename is not
+				   a directory */
+	COLE_EBROKENFILENAME,	/* The filename is not right written */
+	COLE_EFILENAMEISNOTFILE,/* Filename is not a file */
+	COLE_EFSEEKDELTA,	/* Delta argument is not valid */
+	COLE_EFSEEKFLAG,	/* Flag argument is not valid */
+	COLE_EUNKNOWN,		/* An unknown error ocurred, can be a bug */
+	COLE_ELAST		/* Leave this at last place */
+};

cole_perror ()

void        cole_perror                     (const char *s,
+                                             COLERRNO colerrno);

Prints a message on the standard error output, describing the error +colerrno, preceding it with the string s, a semicolon and a space. +It handles COLE_EERRNO value too, calling perror(3).

s : string to print before the error message. It can be NULL.
colerrno : error value of which a message will be printed.

struct COLEFS

struct COLEFS {
+	/* This structure is for internal use only, not for the public API */
+	pps_entry *tree;
+	U32 root;			/* entry root, root pps_entry */
+	U8 *BDepot;
+	U8 *SDepot;
+	FILE *sbfile;
+	char *sbfilename;
+	FILE *file;			/* actual file (the filesystem) */
+};

struct COLEDIR

struct COLEDIR {
+	/* This structure is for internal use only, not for the public API */
+	U32 entry;
+	struct _COLEDIRENT visited_entry;
+	struct _COLEFS *fs;		/* father */
+};

struct COLEDIRENT

struct COLEDIRENT {
+	/* This structure is for internal use only, not for the public API */
+	U32 entry;
+	struct _COLEDIR *dir;		/* father */
+};

struct COLEFILE

struct COLEFILE {
+	/* This structure is for internal use only, not for the public API */
+	U32 entry;
+	FILE *file;			/* actual extracted file */
+	char *filename;			/* actual extracted file's name */
+	U32 filesize;			/* actual extracted file size */
+	struct _COLEFS *fs;		/* father */
+	U32 pos;			/* file pointer position */
+};

cole_mount ()

COLEFS*     cole_mount                      (char *filename,
+                                             COLERRNO *colerrno);

Mounts the filesystem which is in filename.

filename : name of the file with the filesystem.
colerrno : error value (COLE_EMEMORY, COLE_EOPENFILE, COLE_ENOFILESYSTEM, +COLE_EINVALIDFILESYSTEM, COLE_EUNKNOWN).
Returns : a filesystem in success, or NULL in other case.

cole_umount ()

int         cole_umount                     (COLEFS *colefilesystem,
+                                             COLERRNO *colerrno);

Umounts the filesystem colefilesystem.

colefilesystem : filesystem to umount.
colerrno : error value (COLE_ECLOSEFILE, COLE_EREMOVE).
Returns : zero in success, no zero in other case.

cole_print_tree ()

int         cole_print_tree                 (COLEFS *colefilesystem,
+                                             COLERRNO *colerrno);

Prints on the standard output the tree of files and directories contained +in colefilesystem. +Currently this call always success.

colefilesystem : filesystem of which the tree will be printed.
colerrno : error value (errors from call cole_recurse_tree()).
Returns : zero in success, no zero in other case.

cole_locate_filename ()

int         cole_locate_filename            (COLEFS *colefilesystem,
+                                             char *filename,
+                                             void *info,
+                                             COLE_LOCATE_ACTION_FUNC *action,
+                                             COLERRNO *colerrno);

Locate the filename in the filesystem colefilesystem, calling action when +it's found. info is arbitrary pointer passed to action. +Currently, filename must begin with a '/' character, it means filename is +the absolute filename.

colefilesystem : filesystem where to locate filename.
filename : name of the file or directory to be located.
info : arbitrary pointer passed to action.
action : pointer to the function that is called when founding filename.
colerrno : error value (COLE_EUNKNOWN, COLE_EMEMBERISNOTDIR, +COLE_EFILENOTFOUND, COLE_EBROKENFILENAME, errors +from call cole_recurse_tree()).
Returns : zero in success, 1 in other case.

cole_recurse_tree ()

int         cole_recurse_tree               (COLEFS *colefilesystem,
+                                             void *info,
+                                             COLE_RECURSE_DIR_FUNC *inroot,
+                                             COLE_RECURSE_DIRENT_FUNC *indirentry,
+                                             COLE_RECURSE_DIR_FUNC *indir,
+                                             COLE_RECURSE_DIR_FUNC *outdir,
+                                             COLE_RECURSE_VISIT_DIR_FUNC *visitdir,
+                                             COLERRNO *colerrno);

Recurse the filesystem colefilesystem, calling the functions pointed by +inroot, indirentry, indir and outdirectory when start visiting +root directory, start visiting any directory entry (file or directory), +start visiting a directory or end visiting a directory, respectively. +If visitdir returns no zero or it's NULL, the directory is visited, +otherwise is not visited. +info is a arbitrary pointer which is passed to the functions pointed by +inroot, indirentry, indir and outdirectory: it may be used to share +arbitrary information between them.

colefilesystem : filesystem to recurse.
info : arbitrary pointer passed to the functions.
inroot : pointer to the function that is called when start visiting root +directory. It can be NULL.
indirentry : pointer to the function that is called when start visiting any +directory entry (file or directory). It can be NULL.
indir : pointer to the function that is called when start visiting a +directory. It can be NULL.
outdir : pointer to the function that is called when end visiting a +directory. It can be NULL.
visitdir : pointer to the function that is called to know if visit a +directory. It can be NULL.
colerrno : error value (errors from calls cole_opendir_rootdir(), +cole_opendir_direntry(), cole_closedir() and +inroot, indirentry, indir, and outdir functions).
Returns : zero if recursed all the tree, no zero in other case.

cole_fopen ()

COLEFILE*   cole_fopen                      (COLEFS *colefilesystem,
+                                             char *filename,
+                                             COLERRNO *colerrno);

Opens the file with the name filename in the filesystem colefilesystem. +Currently, filename must begin with a '/' character, it means filename is +the absolute filename.

colefilesystem : filesystem in which filename is in.
filename : name of the file to open.
colerrno : error value (COLE_EFILENOTFOUND, errors from calls +cole_opendir_rootdir(), cole_fopen_direntry() and +cole_locate_filename()).
Returns : a file in success, or NULL in other case.

cole_fopen_direntry ()

COLEFILE*   cole_fopen_direntry             (COLEDIRENT *coledirentry,
+                                             COLERRNO *colerrno);

Opens a directory entry as file.

coledirentry : directory entry to be opened as file.
colerrno : error value (COLE_EISNOTFILE, COLE_EMEMORY, COLE_ETMPNAM, +COLE_EOPENFILE, COLE_EINVALIDFILESYSTEM, COLE_EREAD, +COLE_EWRITE, COLE_EUNKNOWN).
Returns : a file in success, or NULL in other case.

cole_fclose ()

int         cole_fclose                     (COLEFILE *colefile,
+                                             COLERRNO *colerrno);

Closes the file colefile.

colefile : file to be closed.
colerrno : error value (COLE_ECLOSEFILE, CLOSE_EREMOVE).
Returns : zero in sucess, no zero in other case.

cole_fread ()

size_t      cole_fread                      (COLEFILE *colefile,
+                                             void *ptr,
+                                             size_t size,
+                                             COLERRNO *colerrno);

Reads size bytes from colefile and store them in the location given +by ptr. If not success, the file position indicator is not changed.

colefile : file to be read.
ptr : memory location where the bytes will be stored.
size : how many bytes will be read.
colerrno : error value (COLE_EOF, COLE_EREAD, COLE_ESEEK).
Returns : in sucess the number of bytes actually readed (maximum size) +or zero in other case.

cole_feof ()

int         cole_feof                       (COLEFILE *colefile);

Tests if the end of file has been reached in colefile.

colefile : file to be tested.
Returns : no zero if the end of file has been reached, zero in other case.

cole_fsize ()

size_t      cole_fsize                      (COLEFILE *colefile);

colefile : file of which its size will be returned.
Returns :the size in bytes of the file colefile.

cole_ftell ()

size_t      cole_ftell                      (COLEFILE *colefile);

Get the current value of the file position indicator for the file +colefile.

colefile : file of which the file position indicator will be get.
Returns : The file position.

cole_fseek ()

int         cole_fseek                      (COLEFILE *colefile,
+                                             size_t delta,
+                                             COLE_SEEK_FLAG direction,
+                                             COLERRNO *colerrno);

Sets the value of the file position indicator for the file colefile +delta bytes from the beginning of the file, forward from the current +position, backward from the current position, or from the end of the +file, if direction is COLE_SEEK_SET, COLE_SEEK_BACKWARD, +COLE_SEEK_FORWARD or COLE_SEEK_END, respectively. +The file position indicator will always be <= colefile->filesize. +If you delta is such that the previous line would not true, cole_fseek +fails.

colefile : file of which its file position indicator will be set.
delta : number of bytes that the file position indicator will be moved.
direction : from where start to count the delta bytes.
colerrno : error value (COLE_EFSEEKDELTA).
Returns : zero in success, no zero in other case.

cole_frewind ()

int         cole_frewind                    (COLEFILE *colefile,
+                                             COLERRNO *colerrno);

Sets the value of the file position indicator for the file colefile +in the beginning of the file.

colefile : file of which its file position indicator will be rewind.
colerrno : error value (error from call cole_fseek()).
Returns : zero in success, no zero in other case.

cole_opendir_rootdir ()

COLEDIR*    cole_opendir_rootdir            (COLEFS *colefilesystem,
+                                             COLERRNO *colerrno);

Opens the root directory of the filesystem colefilesystem as directory.

colefilesystem : filesystem of which the root directory will be opened.
colerrno : error value (COLE_EMEMORY).
Returns : a directory in success, or NULL in other case.

cole_opendir_direntry ()

COLEDIR*    cole_opendir_direntry           (COLEDIRENT *coledirentry,
+                                             COLERRNO *colerrno);

Opens a directory entry as directory.

coledirentry : directory entry to be opened as directory.
colerrno : error value (COLE_EISNOTDIR, COLE_EMEMORY).
Returns : a directory in success, or NULL in other case.

cole_closedir ()

int         cole_closedir                   (COLEDIR *coledir,
+                                             COLERRNO *colerrno);

Closes the directory coledir. +Currently this call always success.

coledir : directory to be closed.
colerrno : error value().
Returns : zero in success, no zero in other case.

cole_visiteddirentry ()

COLEDIRENT* cole_visiteddirentry            (COLEDIR *coledir);

coledir : 
Returns : 

cole_nextdirentry ()

COLEDIRENT* cole_nextdirentry               (COLEDIR *coledir);

coledir : 
Returns : 

cole_direntry_isdir ()

int         cole_direntry_isdir             (COLEDIRENT *coledirentry);

Tests if the directory entry coledirentry is a directory.

coledirentry : directory entry to be tested.
Returns : no zero if it is a directory, zero in other case.

cole_direntry_isfile ()

int         cole_direntry_isfile            (COLEDIRENT *coledirentry);

Tests if the directory entry coledirentry is a file.

coledirentry : directory entry to be tested.
Returns : no zero if it is a directory, zero in other case.

cole_dir_getname ()

char*       cole_dir_getname                (COLEDIR *coledir);

coledir : 
Returns : 

cole_dir_getsize ()

size_t      cole_dir_getsize                (COLEDIR *coledir);

coledir : 
Returns : 

cole_dir_getsec1 ()

long        cole_dir_getsec1                (COLEDIR *coledir);

coledir : 
Returns : 

cole_dir_getsec2 ()

long        cole_dir_getsec2                (COLEDIR *coledir);

coledir : 
Returns : 

cole_dir_getdays1 ()

long        cole_dir_getdays1               (COLEDIR *coledir);

coledir : 
Returns : 

cole_dir_getdays2 ()

long        cole_dir_getdays2               (COLEDIR *coledir);

coledir : 
Returns : 

cole_direntry_getname ()

char*       cole_direntry_getname           (COLEDIRENT *coledirentry);

coledirentry : 
Returns : 

cole_direntry_getsize ()

size_t      cole_direntry_getsize           (COLEDIRENT *coledirentry);

coledirentry : 
Returns : 

cole_direntry_getdays1 ()

long        cole_direntry_getdays1          (COLEDIRENT *coledirentry);

coledirentry : 
Returns : 

cole_direntry_getsec1 ()

long        cole_direntry_getsec1           (COLEDIRENT *coledirentry);

coledirentry : 
Returns : 

cole_direntry_getdays2 ()

long        cole_direntry_getdays2          (COLEDIRENT *coledirentry);

coledirentry : 
Returns : 

cole_direntry_getsec2 ()

long        cole_direntry_getsec2           (COLEDIRENT *coledirentry);

coledirentry : 
Returns : 


PrevHomeNext
cole LibraryUpInternals
\ No newline at end of file diff --git a/cole/doc/cole-manual/cole-internals.html b/cole/doc/cole-manual/cole-internals.html new file mode 100644 index 0000000..15019b5 --- /dev/null +++ b/cole/doc/cole-manual/cole-internals.html @@ -0,0 +1,2186 @@ +Internals
cole Library Reference Manual
PrevNext

Internals

Name

Internals -- cole internals - don't trust in anything here, because it may (and will) change.

Synopsis


+
+struct      COLEFS;
+struct      COLEDIRENT;
+struct      COLEDIR;
+struct      COLEFILE;
+#define     F32
+#define     F64
+#define     U8
+#define     U16
+#define     U32
+U16         fil_sreadU16                    (U8 *in);
+U32         fil_sreadU32                    (U8 *in);
+F64         fil_sreadF64                    (U8 *in);
+void        fil_swriteU16                   (U8 *dest,
+                                             U16 *src);
+void        fil_swriteU32                   (U8 *dest,
+                                             U32 *src);
+#define     verbose_return                  ()
+#define     test                            (t,retval)
+#define     test_exitf                      (t,retval,func)
+#define     test_call                       (t,typeretval)
+#define     test_call_exitf                 (t,typeretval,func)
+#define     report_bug                      (prog)
+#define     assert_return                   (prog,t,retval)
+#define     verbose_d                       (n)
+#define     verbose                         (s)
+#define     verbose_wonl                    (s)
+#define     verboseU8                       (expr)
+#define     verboseU16                      (expr)
+#define     verboseU32                      (expr)
+#define     verboseS                        (expr)
+#define     verboseS_wonl                   (expr)
+#define     warning                         (t)
+#define     verboseU32Array                 (array,len)
+#define     verboseU8Array_force            (rec,len,reclen)
+#define     verboseU8Array                  (rec,len,reclen)

Description

Contains calls to access directly the file system, and endianess care calls.

Details

struct COLEFS

struct COLEFS {
+	/* This structure is for internal use only, not for the public API */
+	pps_entry *tree;
+	U32 root;			/* entry root, root pps_entry */
+	U8 *BDepot;
+	U8 *SDepot;
+	FILE *sbfile;
+	char *sbfilename;
+	FILE *file;			/* actual file (the filesystem) */
+};

struct COLEDIRENT

struct COLEDIRENT {
+	/* This structure is for internal use only, not for the public API */
+	U32 entry;
+	struct _COLEDIR *dir;		/* father */
+};

struct COLEDIR

struct COLEDIR {
+	/* This structure is for internal use only, not for the public API */
+	U32 entry;
+	struct _COLEDIRENT visited_entry;
+	struct _COLEFS *fs;		/* father */
+};

struct COLEFILE

struct COLEFILE {
+	/* This structure is for internal use only, not for the public API */
+	U32 entry;
+	FILE *file;			/* actual extracted file */
+	char *filename;			/* actual extracted file's name */
+	U32 filesize;			/* actual extracted file size */
+	struct _COLEFS *fs;		/* father */
+	U32 pos;			/* file pointer position */
+};

F32

#define     F32

F64

#define     F64

U8

#define U8      unsigned char

U16

#define     U16

U32

#define     U32

fil_sreadU16 ()

U16         fil_sreadU16                    (U8 *in);

in : 
Returns : 

fil_sreadU32 ()

U32         fil_sreadU32                    (U8 *in);

in : 
Returns : 

fil_sreadF64 ()

F64         fil_sreadF64                    (U8 *in);

in : 
Returns : 

fil_swriteU16 ()

void        fil_swriteU16                   (U8 *dest,
+                                             U16 *src);

dest : 
src : 

fil_swriteU32 ()

void        fil_swriteU32                   (U8 *dest,
+                                             U32 *src);

dest : 
src : 

verbose_return()

#define     verbose_return()

test()

#define     test(t,retval)

t : 
retval : 

test_exitf()

#define     test_exitf(t,retval,func)

t : 
retval : 
func : 

test_call()

#define     test_call(t,typeretval)

t : 
typeretval : 

test_call_exitf()

#define     test_call_exitf(t,typeretval,func)

t : 
typeretval : 
func : 

report_bug()

#define     report_bug(prog)

prog : 

assert_return()

#define     assert_return(prog,t,retval)

prog : 
t : 
retval : 

verbose_d()

#define     verbose_d(n)

n : 

verbose()

#define     verbose(s)

s : 

verbose_wonl()

#define     verbose_wonl(s)

s : 

verboseU8()

#define     verboseU8(expr)

expr : 

verboseU16()

#define     verboseU16(expr)

expr : 

verboseU32()

#define     verboseU32(expr)

expr : 

verboseS()

#define     verboseS(expr)

expr : 

verboseS_wonl()

#define     verboseS_wonl(expr)

expr : 

warning()

#define     warning(t)

t : 

verboseU32Array()

#define     verboseU32Array(array,len)

array : 
len : 

verboseU8Array_force()

#define     verboseU8Array_force(rec,len,reclen)

rec : 
len : 
reclen : 

verboseU8Array()

#define     verboseU8Array(rec,len,reclen)

rec : 
len : 
reclen : 

\ No newline at end of file diff --git a/cole/doc/cole-manual/copyright-and-disclaimer.html b/cole/doc/cole-manual/copyright-and-disclaimer.html new file mode 100644 index 0000000..9233e28 --- /dev/null +++ b/cole/doc/cole-manual/copyright-and-disclaimer.html @@ -0,0 +1,137 @@ +Copyright and disclaimer
cole Library Reference Manual
PrevChapter 5. Legal issuesNext

Copyright and disclaimer

This document is copyright 1999 by Roberto Arturo Tena Sánchez. This document 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 document is provided as is without any express or implied warranties. While every effort has been taken to ensure the accuracy of the information contained in this document, the author/maintainer/contributors assume(s) no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.


PrevHomeNext
TrademarksUpGNU GENERAL PUBLIC LICENSE
\ No newline at end of file diff --git a/cole/doc/cole-manual/docbook.css b/cole/doc/cole-manual/docbook.css new file mode 100755 index 0000000..b42fb27 --- /dev/null +++ b/cole/doc/cole-manual/docbook.css @@ -0,0 +1,20 @@ +.BOOK .TITLE { text-align: center } +.BOOK .SUBTITLE { text-align: center } +.BOOK .CORPAUTHOR { text-align: center } +.BOOK .AUTHOR { text-align: center } +.BOOK .AFFILIATION { text-align: center } +.BOOK .EDITEDBY { text-align: center } +.BOOK .EDITOR { text-align: center } +.BOOK .GRAPHIC { text-align: center } + +.ARTICLE .TITLE { text-align: center } +.ARTICLE .SUBTITLE { text-align: center } +.ARTICLE .CORPAUTHOR { text-align: center } +.ARTICLE .AUTHOR { text-align: center } +.ARTICLE .AFFILIATION { text-align: center } +.ARTICLE .EDITEDBY { text-align: center } +.ARTICLE .EDITOR { text-align: center } +.ARTICLE .GRAPHIC { text-align: center } +.ARTICLE .ABSTRACT { margin-left: 0.5in; + margin-right: 0.5in; + font-style: italic } diff --git a/cole/doc/cole-manual/features.html b/cole/doc/cole-manual/features.html new file mode 100644 index 0000000..e1c72df --- /dev/null +++ b/cole/doc/cole-manual/features.html @@ -0,0 +1,199 @@ +Features
cole Library Reference Manual
PrevChapter 1. IntroductionNext

Features

cole 2.x release series:

  • Can open Structured Storage files generated with programs from Microsoft, StarDivision and FlashPix. +

  • Is written in C, for better performance. +

  • Should compile in UNIX-like systems with ANSI C libraries and a ANSI C compiler. +

  • Has a new good-looking API, modelled after ANSI C stdio.h routines. +

  • Uses standard automake, autoconf and libtool generated files. +

  • Provides a standard configure script. +

  • Builds shared (dynamic) libraries if the plattform and libtool support it. +

  • Provides standard targets in the Makefile (ie. install, clean, etc). +

  • Can use (thanks to the configure script) plattform dependent system calls for better performance. +


PrevHomeNext
IntroductionUpRequirements to compile
\ No newline at end of file diff --git a/cole/doc/cole-manual/gpl-license-how-to-apply.html b/cole/doc/cole-manual/gpl-license-how-to-apply.html new file mode 100644 index 0000000..7bb6b7e --- /dev/null +++ b/cole/doc/cole-manual/gpl-license-how-to-apply.html @@ -0,0 +1,236 @@ +How to Apply These Terms to Your New Programs +
cole Library Reference Manual
PrevChapter 6. GNU GENERAL PUBLIC LICENSE 

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. +

one line to give the program's name and a brief idea of what it does.
+Copyright (C) year  name of author
+
+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) year  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.
+
+signature of Ty Coon, 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. +


PrevHome 
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATIONUp 
\ No newline at end of file diff --git a/cole/doc/cole-manual/gpl-license-terms.html b/cole/doc/cole-manual/gpl-license-terms.html new file mode 100644 index 0000000..deebfbd --- /dev/null +++ b/cole/doc/cole-manual/gpl-license-terms.html @@ -0,0 +1,385 @@ +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +
cole Library Reference Manual
PrevChapter 6. GNU GENERAL PUBLIC LICENSENext

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's 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's 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 +


PrevHomeNext
GNU GENERAL PUBLIC LICENSEUpHow to Apply These Terms to Your New Programs
\ No newline at end of file diff --git a/cole/doc/cole-manual/gpl-license.html b/cole/doc/cole-manual/gpl-license.html new file mode 100644 index 0000000..035f8a6 --- /dev/null +++ b/cole/doc/cole-manual/gpl-license.html @@ -0,0 +1,225 @@ +GNU GENERAL PUBLIC LICENSE +
cole Library Reference Manual
PrevNext

Chapter 6. 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's 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. +


PrevHomeNext
Copyright and disclaimer TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
\ No newline at end of file diff --git a/cole/doc/cole-manual/how-to-compile.html b/cole/doc/cole-manual/how-to-compile.html new file mode 100644 index 0000000..b892d5f --- /dev/null +++ b/cole/doc/cole-manual/how-to-compile.html @@ -0,0 +1,330 @@ +How to compile cole
cole Library Reference Manual
PrevNext

Chapter 2. How to compile cole

The file INSTALL in the source code gives detailed instructions on how to configure, compile and install cole.

Briefly, you need to run the GNU standard configure script, with the arguments you want. To see the arguments that configure accepts, run ./configure --help. The most usual argument is --prefix=PREFIX, which tells configure to install cole in the directory PREFIX. After that, you need to run make to compile cole, and make install to install it.

The configure script accepts, besides the standard arguments, the following flags:

--enable-osf-check. Turn on short align for OSF compiler. If you have errors while compiling under OSF1, enable this flag. +
--enable-verbose. Turn on verbose. It is useful if you want to send a bug report. It is useful for cole developers too. +
--enable-debug Turn on GNU CC debug flags. It is useful for cole developers, so may be you don't want to use it. +

A tipical session is shown below.

$ ls
+cole-2.0.0.tar.gz
+$ gzip -d cole-2.0.0.tar.gz
+$ tar -xf cole-2.0.0.tar
+$ ls
+cole-2.0.0.tar      cole-2.0.0/
+$ cd cole-2.0.0
+$ ./configure --prefix=/opt
+...
+Configured cole release 2.0.0 
+$ make
+...
+$ make install
+...
+$ make clean
+...

When installing, a shell script named cole-config will be installed in PREFIX/bin if you used the the --prefix=PREFIX argument, or in /usr/local/bin if you didn't. That directory must be listed in the content of the enviroment variable PATH when configuring another program that uses cole.

If you system support it, will be compiled and installed shared libraries, to minimize size of the executables. By this reason, is important to include the directory PREFIX/bin or /usr/local/bin (which appropiate) in the file that your system command ldconfig reads in order to regenerate the list of shared libraries (in some systems, you can list the directory in the content of the enviroment variable LD_LIBRARY_PATH instead).


PrevHomeNext
Requirements to compile cole Library
\ No newline at end of file diff --git a/cole/doc/cole-manual/index.html b/cole/doc/cole-manual/index.html new file mode 100644 index 0000000..2a64a24 --- /dev/null +++ b/cole/doc/cole-manual/index.html @@ -0,0 +1,193 @@ +cole Library Reference Manual

  Next
  Introduction
\ No newline at end of file diff --git a/cole/doc/cole-manual/introduction.html b/cole/doc/cole-manual/introduction.html new file mode 100644 index 0000000..12fdef4 --- /dev/null +++ b/cole/doc/cole-manual/introduction.html @@ -0,0 +1,189 @@ +Introduction
cole Library Reference Manual
PrevNext

Chapter 1. Introduction

What is cole?

cole is a free C OLE library.

cole is distributed under the terms of the GNU General Public License (GPL) to give an impulse to the Free Software. cole distribution license is compatible with the Open Source definition.

Using cole, you can access Microsoft' Structured Storage files. The most popular Microsoft's programs generate Structured Storage files, incluiding the Microsoft' suite for offices. StarDivision' suite (StarOffice) generate Structured Storage files too. FlashPix file format is Structured Storage too.

What is a Structured Storage file? Inside a Structured Storage file there is a filesystem, with directories and files, which Microsoft calls containers and streams. Using cole you can travel through such filesystem and access the files.

cole doesn't know about internal structure of a stream, it only reads the raw data. You can use the Microsoft's documentation available at http://msdn.microsoft.com or the information available at http://www.wotsit.org to know the binary file format of the streams. If you know anything in the side of StarDivision email me. FlashPix file format is well documented.

cole was developed using the information available at http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/guide.html and the OLE::Storage Perl module from the same site, and no information from any other source (incluiding Microsoft) has been used.


PrevHomeNext
cole Library Reference Manual Features
\ No newline at end of file diff --git a/cole/doc/cole-manual/legal-issues.html b/cole/doc/cole-manual/legal-issues.html new file mode 100644 index 0000000..5005dee --- /dev/null +++ b/cole/doc/cole-manual/legal-issues.html @@ -0,0 +1,184 @@ +Legal issues
cole Library Reference Manual
PrevNext

Chapter 5. Legal issues

Distribution and Freedom

cole is Free Software, which means is distributed under a license that protect your freedom. cole distribution license is compatible with the Open Source definition.

cole is distributed under the terms of the GNU General Public License (GPL). A copy of the license is in the file COPYING in the source code and in this document. Particulary, this means at least two things:

  1. All the code statically or dinamically linked against cole must be distributed under the terms of a license compatible with GPL. +

  2. If you change the cole source code and you want to distribute a compiled version, you must release the changed cole source code too. +


PrevHomeNext
Bugs Trademarks
\ No newline at end of file diff --git a/cole/doc/cole-manual/libcole.html b/cole/doc/cole-manual/libcole.html new file mode 100644 index 0000000..6eb0148 --- /dev/null +++ b/cole/doc/cole-manual/libcole.html @@ -0,0 +1,273 @@ +cole Library
cole Library Reference Manual
PrevNext

Chapter 3. cole Library

Table of Contents
API — Public cole API for the present release.
Internals — cole internals - don't trust in anything here, because it may (and will) change.

This is the documentation autogenerated from the source code. It have the cole API for this release, and some internal structures and internal calls. +

Note: what Microsoft calls stream is called file in this project, storage is called directory and docfile (a Structured Storage file) is called filesystem. +

The files in the subdirectory examples in the source code show the complete public API in action. Briefly, if you know how to use the stdio.h ANSI C calls, cole API will be very easy for you.

If you use autoconf in your own proyect, the included file cole.m4 may be useful for you. It contains the m4 macro AM_PATH_COLE that detect the presense or ausence of the cole library in the system being configured. To use it:

  1. If cole is not installed in your system (i.e. aclocal can't find cole.m4), add the content of cole.m4 to your own acinclude.m4 file (create it in case you haven't one). +

  2. Add a line like AM_PATH_COLE(2.0.0, [LIBS="$LIBS $COLE_LIBS" CFLAGS="$CFLAGS $COLE_CFLAGS"]) to your configure.in file. Here we are requesting for cole release 2.0.0, and adding the necessary flags to LIBS and CFLAGS. +

  3. Run aclocal to generate the file aclocal.m4. This file will have many m4 macros, incluiding the cole m4 macro, and +

  4. Run autoconf to generate the script configure. +

Many API calls take an argument at the end called colerrno. If it's not NULL and the call failed, it store the error code for fail, if any (if the call was successfully ended, its value is not modified).


PrevHomeNext
How to compile cole API
\ No newline at end of file diff --git a/cole/doc/cole-manual/requirements-to-compile.html b/cole/doc/cole-manual/requirements-to-compile.html new file mode 100644 index 0000000..fc46773 --- /dev/null +++ b/cole/doc/cole-manual/requirements-to-compile.html @@ -0,0 +1,137 @@ +Requirements to compile
cole Library Reference Manual
PrevChapter 1. IntroductionNext

Requirements to compile

To have a system with ANSI C libraries, a ANSI C compiler, a make program and the shell /bin/sh.


PrevHomeNext
FeaturesUpHow to compile cole
\ No newline at end of file diff --git a/cole/doc/cole-manual/stylesheet-images/caution.gif b/cole/doc/cole-manual/stylesheet-images/caution.gif new file mode 100755 index 0000000..9cc2e15 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/caution.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/home.gif b/cole/doc/cole-manual/stylesheet-images/home.gif new file mode 100755 index 0000000..55e1d59 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/home.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/important.gif b/cole/doc/cole-manual/stylesheet-images/important.gif new file mode 100755 index 0000000..25e40c7 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/important.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/next.gif b/cole/doc/cole-manual/stylesheet-images/next.gif new file mode 100755 index 0000000..8c502e7 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/next.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/note.gif b/cole/doc/cole-manual/stylesheet-images/note.gif new file mode 100755 index 0000000..7322e8e Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/note.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/prev.gif b/cole/doc/cole-manual/stylesheet-images/prev.gif new file mode 100755 index 0000000..0894d9e Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/prev.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/tip.gif b/cole/doc/cole-manual/stylesheet-images/tip.gif new file mode 100755 index 0000000..f062955 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/tip.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/toc-blank.gif b/cole/doc/cole-manual/stylesheet-images/toc-blank.gif new file mode 100755 index 0000000..6c65e3a Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/toc-blank.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/toc-minus.gif b/cole/doc/cole-manual/stylesheet-images/toc-minus.gif new file mode 100755 index 0000000..40ebe61 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/toc-minus.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/toc-plus.gif b/cole/doc/cole-manual/stylesheet-images/toc-plus.gif new file mode 100755 index 0000000..3e9e7d5 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/toc-plus.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/up.gif b/cole/doc/cole-manual/stylesheet-images/up.gif new file mode 100755 index 0000000..e899a27 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/up.gif differ diff --git a/cole/doc/cole-manual/stylesheet-images/warning.gif b/cole/doc/cole-manual/stylesheet-images/warning.gif new file mode 100755 index 0000000..a587079 Binary files /dev/null and b/cole/doc/cole-manual/stylesheet-images/warning.gif differ diff --git a/cole/doc/cole-manual/trademarks.html b/cole/doc/cole-manual/trademarks.html new file mode 100644 index 0000000..941ef62 --- /dev/null +++ b/cole/doc/cole-manual/trademarks.html @@ -0,0 +1,147 @@ +Trademarks
cole Library Reference Manual
PrevChapter 5. Legal issuesNext

Trademarks

"Microsoft Word", "Microsoft Excel", "Microsoft Publisher" and "Microsoft Power Point" are trademarks of Microsoft Corporation.

"StarOffice" may be is a trademark of StarDivision.

"FlashPix" may be is a trademark.

"UNIX" is a trademark.

"Free Software" is not trademark of anyone, but it's an important term in the Free Software community, and for the Free Software Foundation.

All other trademarks are the property of their respective owners.

If another trademark is mentioned in this document and it needs to be listed above, please email to the maintainer (<arturo@directmail.org>).


PrevHomeNext
Legal issuesUpCopyright and disclaimer
\ No newline at end of file diff --git a/cole/doc/cole-sections.txt b/cole/doc/cole-sections.txt new file mode 100644 index 0000000..9dcb9fd --- /dev/null +++ b/cole/doc/cole-sections.txt @@ -0,0 +1,93 @@ +
+internals +Internals +COLEFS +COLEDIRENT +COLEDIR +COLEFILE +F32 +F64 +U8 +U16 +U32 +fil_sreadU16 +fil_sreadU32 +fil_sreadF64 +fil_swriteU16 +fil_swriteU32 +verbose_return +test +test_exitf +test_call +test_call_exitf +report_bug +assert_return +verbose_d +verbose +verbose_wonl +verboseU8 +verboseU16 +verboseU32 +verboseS +verboseS_wonl +warning +verboseU32Array +verboseU8Array_force +verboseU8Array +
+ + +cole/cole.h + +
+api +API +COLE_MAJOR_VERSION +COLE_MINOR_VERSION +COLE_MICRO_VERSION +cole_major_version +cole_minor_version +cole_micro_version +cole_version +cole_host_info +COLERRNO +cole_perror +COLEFS +COLEDIR +COLEDIRENT +COLEFILE +cole_mount +cole_umount +cole_print_tree +cole_locate_filename +cole_recurse_tree +cole_fopen +cole_fopen_direntry +cole_fclose +cole_fread +cole_feof +cole_fsize +cole_ftell +cole_fseek +cole_frewind +cole_opendir_rootdir +cole_opendir_direntry +cole_closedir +cole_visiteddirentry +cole_nextdirentry +cole_direntry_isdir +cole_direntry_isfile +cole_dir_getname +cole_dir_getsize +cole_dir_getsec1 +cole_dir_getsec2 +cole_dir_getdays1 +cole_dir_getdays2 +cole_direntry_getname +cole_direntry_getsize +cole_direntry_getdays1 +cole_direntry_getsec1 +cole_direntry_getdays2 +cole_direntry_getsec2 +
+ diff --git a/cole/doc/compile.sgml b/cole/doc/compile.sgml new file mode 100644 index 0000000..40262bc --- /dev/null +++ b/cole/doc/compile.sgml @@ -0,0 +1,48 @@ + + + The file INSTALL in the source code gives detailed instructions on how to configure, compile and install cole. + + + Briefly, you need to run the GNU standard configure script, with the arguments you want. To see the arguments that configure accepts, run ./configure --help. The most usual argument is --prefix=PREFIX, which tells configure to install cole in the directory PREFIX. After that, you need to run make to compile cole, and make install to install it. + + + The configure script accepts, besides the standard arguments, the following flags: + + + + --enable-osf-check. Turn on short align for OSF compiler. If you have errors while compiling under OSF1, enable this flag. + + + --enable-verbose. Turn on verbose. It is useful if you want to send a bug report. It is useful for cole developers too. + + + --enable-debug Turn on GNU CC debug flags. It is useful for cole developers, so may be you don't want to use it. + + + + A tipical session is shown below. + + +$ ls +cole-2.0.0.tar.gz +$ gzip -d cole-2.0.0.tar.gz +$ tar -xf cole-2.0.0.tar +$ ls +cole-2.0.0.tar cole-2.0.0/ +$ cd cole-2.0.0 +$ ./configure --prefix=/opt +... +Configured cole release 2.0.0 +$ make +... +$ make install +... +$ make clean +... + + When installing, a shell script named cole-config will be installed in PREFIX/bin if you used the the --prefix=PREFIX argument, or in /usr/local/bin if you didn't. That directory must be listed in the content of the enviroment variable PATH when configuring another program that uses cole. + + + If you system support it, will be compiled and installed shared libraries, to minimize size of the executables. By this reason, is important to include the directory PREFIX/bin or /usr/local/bin (which appropiate) in the file that your system command ldconfig reads in order to regenerate the list of shared libraries (in some systems, you can list the directory in the content of the enviroment variable LD_LIBRARY_PATH instead). + + diff --git a/cole/doc/gpl.sgml b/cole/doc/gpl.sgml new file mode 100644 index 0000000..2112821 --- /dev/null +++ b/cole/doc/gpl.sgml @@ -0,0 +1,412 @@ + + + +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's 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. + + + + + + +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's 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's 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. + + +one line to give the program's name and a brief idea of what it does. +Copyright (C) year name of author + +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) year 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. + +signature of Ty Coon, 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. + + + + diff --git a/cole/doc/introduction.sgml b/cole/doc/introduction.sgml new file mode 100644 index 0000000..1df0c42 --- /dev/null +++ b/cole/doc/introduction.sgml @@ -0,0 +1,89 @@ + + + +What is cole? + + + cole is a free C OLE library. + + + cole is distributed under the terms of the GNU General Public License (GPL) to give an impulse to the Free Software. cole distribution license is compatible with the Open Source definition. + + + Using cole, you can access Microsoft' Structured Storage files. The most popular Microsoft's programs generate Structured Storage files, incluiding the Microsoft' suite for offices. StarDivision' suite (StarOffice) generate Structured Storage files too. FlashPix file format is Structured Storage too. + + + What is a Structured Storage file? Inside a Structured Storage file there is a filesystem, with directories and files, which Microsoft calls containers and streams. Using cole you can travel through such filesystem and access the files. + + + cole doesn't know about internal structure of a stream, it only reads the raw data. You can use the Microsoft's documentation available at http://msdn.microsoft.com or the information available at http://www.wotsit.org to know the binary file format of the streams. If you know anything in the side of StarDivision email me. FlashPix file format is well documented. + + + cole was developed using the information available at http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/guide.html and the OLE::Storage Perl module from the same site, and no information from any other source (incluiding Microsoft) has been used. + + + + + +Features + +cole 2.x release series: + + + + + + Can open Structured Storage files generated with programs from Microsoft, StarDivision and FlashPix. + + + + + Is written in C, for better performance. + + + + + Should compile in UNIX-like systems with ANSI C libraries and a ANSI C compiler. + + + + + Has a new good-looking API, modelled after ANSI C stdio.h routines. + + + + + Uses standard automake, autoconf and libtool generated files. + + + + + Provides a standard configure script. + + + + + Builds shared (dynamic) libraries if the plattform and libtool support it. + + + + + Provides standard targets in the Makefile (ie. install, clean, etc). + + + + + Can use (thanks to the configure script) plattform dependent system calls for better performance. + + + + + + + +Requirements to compile + + To have a system with ANSI C libraries, a ANSI C compiler, a make program and the shell /bin/sh. + + + diff --git a/cole/doc/legal.sgml b/cole/doc/legal.sgml new file mode 100644 index 0000000..4cbb576 --- /dev/null +++ b/cole/doc/legal.sgml @@ -0,0 +1,60 @@ + + +Distribution and Freedom + + cole is Free Software, which means is distributed under a license that protect your freedom. cole distribution license is compatible with the Open Source definition. + + + cole is distributed under the terms of the GNU General Public License (GPL). A copy of the license is in the file COPYING in the source code and in this document. Particulary, this means at least two things: + + + + + All the code statically or dinamically linked against cole must be distributed under the terms of a license compatible with GPL. + + + + + If you change the cole source code and you want to distribute a compiled version, you must release the changed cole source code too. + + + + + + + +Trademarks + + "Microsoft Word", "Microsoft Excel", "Microsoft Publisher" and "Microsoft Power Point" are trademarks of Microsoft Corporation. + + +"StarOffice" may be is a trademark of StarDivision. + + +"FlashPix" may be is a trademark. + + +"UNIX" is a trademark. + + + "Free Software" is not trademark of anyone, but it's an important term in the Free Software community, and for the Free Software Foundation. + + + All other trademarks are the property of their respective owners. + + + If another trademark is mentioned in this document and it needs to be listed above, please email to the maintainer (&maintainer-email-ulink;). + + + + + +Copyright and disclaimer + + This document is copyright 1999 by &author-name-full;. This document 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 document is provided as is without any express or implied warranties. While every effort has been taken to ensure the accuracy of the information contained in this document, the author/maintainer/contributors assume(s) no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. + + + diff --git a/cole/doc/tmpl/.cvsignore b/cole/doc/tmpl/.cvsignore new file mode 100644 index 0000000..751553b --- /dev/null +++ b/cole/doc/tmpl/.cvsignore @@ -0,0 +1 @@ +*.bak diff --git a/cole/doc/tmpl/api.sgml b/cole/doc/tmpl/api.sgml new file mode 100644 index 0000000..ffc9c0e --- /dev/null +++ b/cole/doc/tmpl/api.sgml @@ -0,0 +1,434 @@ + +API + + +Public cole API for the present release. + + + +Note: The separator character for filename components is '/'. So, a filename argument can be something like "/Macros/VB/Project1". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@s: +@colerrno: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@filename: +@colerrno: +@Returns: + + + + + + + +@colefilesystem: +@colerrno: +@Returns: + + + + + + + +@colefilesystem: +@colerrno: +@Returns: + + + + + + + +@colefilesystem: +@filename: +@info: +@action: +@colerrno: +@Returns: + + + + + + + +@colefilesystem: +@info: +@inroot: +@indirentry: +@indir: +@outdir: +@visitdir: +@colerrno: +@Returns: + + + + + + + +@colefilesystem: +@filename: +@colerrno: +@Returns: + + + + + + + +@coledirentry: +@colerrno: +@Returns: + +@colefilesystem: + + + + + + + +@colefile: +@colerrno: +@Returns: + + + + + + + +@colefile: +@ptr: +@size: +@colerrno: +@Returns: + + + + + + + +@colefile: +@Returns: + + + + + + + +@colefile: +@Returns: + + + + + + + +@colefile: +@Returns: + + + + + + + +@colefile: +@delta: +@direction: +@colerrno: +@Returns: + + + + + + + +@colefile: +@colerrno: +@Returns: + + + + + + + +@colefilesystem: +@colerrno: +@Returns: + + + + + + + +@coledirentry: +@colerrno: +@Returns: + + + + + + + +@coledir: +@colerrno: +@Returns: + + + + + + + +@coledir: +@Returns: + + + + + + + +@coledir: +@Returns: + + + + + + + +@coledirentry: +@Returns: + + + + + + + +@coledirentry: +@Returns: + + + + + + + +@coledir: +@Returns: + + + + + + + +@coledir: +@Returns: + + + + + + + +@coledir: +@Returns: + + + + + + + +@coledir: +@Returns: + + + + + + + +@coledir: +@Returns: + + + + + + + +@coledir: +@Returns: + + + + + + + +@coledirentry: +@Returns: + + + + + + + +@coledirentry: +@Returns: + + + + + + + +@coledirentry: +@Returns: + + + + + + + +@coledirentry: +@Returns: + + + + + + + +@coledirentry: +@Returns: + + + + + + + +@coledirentry: +@Returns: + + diff --git a/cole/doc/tmpl/cole-unused.sgml b/cole/doc/tmpl/cole-unused.sgml new file mode 100644 index 0000000..8b5657e --- /dev/null +++ b/cole/doc/tmpl/cole-unused.sgml @@ -0,0 +1,75 @@ + + + + + +@colefilesystem: +@colerrno: +@Returns: + + + + + + +@OLEfilename: +@trunc: +@stream_list: +@root: +@Returns: + + + + + + +@tree: +@Returns: + + + + + + +@colefile: +@Returns: + + + + + + +@coledir: +@Returns: + + + + + + +@pps_list: +@root_pps: +@level: + + + + + + +@OLEfilename: +@stream_list: +@root: +@_BDepot: +@_SDepot: +@_sbfile: +@_input: +@max_level: +@Returns: + + + + + + +@colefile: + diff --git a/cole/doc/tmpl/internals.sgml b/cole/doc/tmpl/internals.sgml new file mode 100644 index 0000000..e3fbdca --- /dev/null +++ b/cole/doc/tmpl/internals.sgml @@ -0,0 +1,284 @@ + +Internals + + +cole internals - don't trust in anything here, because it may (and will) change. + + + +Contains calls to access directly the file system, and endianess care calls. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@in: +@Returns: + + + + + + + +@in: +@Returns: + + + + + + + +@in: +@Returns: + + + + + + + +@dest: +@src: + + + + + + + +@dest: +@src: + + + + + + + + + + + + + + +@t: +@retval: + + + + + + + +@t: +@retval: +@func: + + + + + + + +@t: +@typeretval: + + + + + + + +@t: +@typeretval: +@func: + + + + + + + +@prog: + + + + + + + +@prog: +@t: +@retval: + + + + + + + +@n: + + + + + + + +@s: + + + + + + + +@s: + + + + + + + +@expr: + + + + + + + +@expr: + + + + + + + +@expr: + + + + + + + +@expr: + + + + + + + +@expr: + + + + + + + +@t: + + + + + + + +@array: +@len: + + + + + + + +@rec: +@len: +@reclen: + + + + + + + +@rec: +@len: +@reclen: + + diff --git a/cole/doc/using.sgml b/cole/doc/using.sgml new file mode 100644 index 0000000..f094a3e --- /dev/null +++ b/cole/doc/using.sgml @@ -0,0 +1,33 @@ + + + The files in the subdirectory examples in the source code show the complete public API in action. Briefly, if you know how to use the stdio.h ANSI C calls, cole API will be very easy for you. + + + If you use autoconf in your own proyect, the included file cole.m4 may be useful for you. It contains the m4 macro AM_PATH_COLE that detect the presense or ausence of the cole library in the system being configured. To use it: + + + + + If cole is not installed in your system (i.e. aclocal can't find cole.m4), add the content of cole.m4 to your own acinclude.m4 file (create it in case you haven't one). + + + + + Add a line like AM_PATH_COLE(2.0.0, [LIBS="$LIBS $COLE_LIBS" CFLAGS="$CFLAGS $COLE_CFLAGS"]) to your configure.in file. Here we are requesting for cole release 2.0.0, and adding the necessary flags to LIBS and CFLAGS. + + + + + Run aclocal to generate the file aclocal.m4. This file will have many m4 macros, incluiding the cole m4 macro, and + + + + + Run autoconf to generate the script configure. + + + + + Many API calls take an argument at the end called colerrno. If it's not NULL and the call failed, it store the error code for fail, if any (if the call was successfully ended, its value is not modified). + + diff --git a/cole/examples/Makefile.am b/cole/examples/Makefile.am new file mode 100644 index 0000000..431de12 --- /dev/null +++ b/cole/examples/Makefile.am @@ -0,0 +1,11 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = present.sdd sprsheet.sdc sprsheet.xls text.doc text.sdw \ + README-examples + +INCLUDES = -I$(top_srcdir) +LDADD = $(top_builddir)/libcole.la +TESTS = filesystem directory file version + +noinst_PROGRAMS = filesystem directory file demo version + diff --git a/cole/examples/Makefile.in b/cole/examples/Makefile.in new file mode 100644 index 0000000..2bdfa5f --- /dev/null +++ b/cole/examples/Makefile.in @@ -0,0 +1,369 @@ +# 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +COLE_MAJOR = @COLE_MAJOR@ +COLE_MICRO = @COLE_MICRO@ +COLE_MINOR = @COLE_MINOR@ +DLLTOOL = @DLLTOOL@ +HOST_ALIAS_NAME = @HOST_ALIAS_NAME@ +HOST_CANONICAL_NAME = @HOST_CANONICAL_NAME@ +HOST_CPU = @HOST_CPU@ +HOST_OS = @HOST_OS@ +HOST_VENDOR = @HOST_VENDOR@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +NM = @NM@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ + +EXTRA_DIST = present.sdd sprsheet.sdc sprsheet.xls text.doc text.sdw README-examples + + +INCLUDES = -I$(top_srcdir) +LDADD = $(top_builddir)/libcole.la +TESTS = filesystem directory file version + +noinst_PROGRAMS = filesystem directory file demo version +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = topsrcdir.h +PROGRAMS = $(noinst_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +filesystem_SOURCES = filesystem.c +filesystem_OBJECTS = filesystem.o +filesystem_LDADD = $(LDADD) +filesystem_DEPENDENCIES = $(top_builddir)/libcole.la +filesystem_LDFLAGS = +directory_SOURCES = directory.c +directory_OBJECTS = directory.o +directory_LDADD = $(LDADD) +directory_DEPENDENCIES = $(top_builddir)/libcole.la +directory_LDFLAGS = +file_SOURCES = file.c +file_OBJECTS = file.o +file_LDADD = $(LDADD) +file_DEPENDENCIES = $(top_builddir)/libcole.la +file_LDFLAGS = +demo_SOURCES = demo.c +demo_OBJECTS = demo.o +demo_LDADD = $(LDADD) +demo_DEPENDENCIES = $(top_builddir)/libcole.la +demo_LDFLAGS = +version_SOURCES = version.c +version_OBJECTS = version.o +version_LDADD = $(LDADD) +version_DEPENDENCIES = $(top_builddir)/libcole.la +version_LDFLAGS = +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 = Makefile.am Makefile.in topsrcdir.h.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = filesystem.c directory.c file.c demo.c version.c +OBJECTS = filesystem.o directory.o file.o demo.o version.o + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .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 + +topsrcdir.h: $(top_builddir)/config.status topsrcdir.h.in + 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: + +filesystem: $(filesystem_OBJECTS) $(filesystem_DEPENDENCIES) + @rm -f filesystem + $(LINK) $(filesystem_LDFLAGS) $(filesystem_OBJECTS) $(filesystem_LDADD) $(LIBS) + +directory: $(directory_OBJECTS) $(directory_DEPENDENCIES) + @rm -f directory + $(LINK) $(directory_LDFLAGS) $(directory_OBJECTS) $(directory_LDADD) $(LIBS) + +file: $(file_OBJECTS) $(file_DEPENDENCIES) + @rm -f file + $(LINK) $(file_LDFLAGS) $(file_OBJECTS) $(file_LDADD) $(LIBS) + +demo: $(demo_OBJECTS) $(demo_DEPENDENCIES) + @rm -f demo + $(LINK) $(demo_LDFLAGS) $(demo_OBJECTS) $(demo_LDADD) $(LIBS) + +version: $(version_OBJECTS) $(version_DEPENDENCIES) + @rm -f version + $(LINK) $(version_LDFLAGS) $(version_OBJECTS) $(version_LDADD) $(LIBS) + +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 +check-TESTS: $(TESTS) + @failed=0; all=0; \ + srcdir=$(srcdir); export srcdir; \ + for tst in $(TESTS); do \ + if test -f $$tst; then dir=.; \ + else dir="$(srcdir)"; fi; \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + all=`expr $$all + 1`; \ + echo "PASS: $$tst"; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0 +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +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: +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 check-TESTS \ +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: diff --git a/cole/examples/README-examples b/cole/examples/README-examples new file mode 100644 index 0000000..4d7e5c6 --- /dev/null +++ b/cole/examples/README-examples @@ -0,0 +1,11 @@ + +present.sdd - StarOffice 5.0 presentation. +sprsheet.sdc - StarOffice 5.0 spreadsheet. +sprsheet.xls - Microsoft Excel 95 spreadsheet. +text.sdw - StarOffice 5.0 text. + +All the files above was generated using the free StarOffice 5.0 Personal +Edition. + +text.doc - Microsoft Word 97 text with an incrusted image. + diff --git a/cole/examples/demo.c b/cole/examples/demo.c new file mode 100644 index 0000000..ae4aec8 --- /dev/null +++ b/cole/examples/demo.c @@ -0,0 +1,159 @@ +/* + cole - A free C OLE library. + cole using sample. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include +#include + +/* To compile this file outside cole source tree, + you must include here instead */ +#include + + +#define PRGNAME "demo" +#define BUFFER_SIZE 128 + + +int +main (int argc, char **argv) +{ + COLEFS * cfs; + COLEDIR * cd; + COLEDIRENT * cde; + COLEFILE * cf; + COLERRNO colerrno; + char * entry_name; + char buffer[BUFFER_SIZE]; + size_t char_read; + size_t char_read_total; + + + if (argc != 2) { + fprintf (stderr, "cole demo. cole is a free C OLE library.\n" + "Usage: demo \n"); + return 1; + } + + + /* + * version info + */ + printf ("Version info: (%d.%d.%d) (%d.%d.%d) (%s)\n", + COLE_MAJOR_VERSION, COLE_MINOR_VERSION, COLE_MICRO_VERSION, + cole_major_version, cole_minor_version, cole_micro_version, + cole_version); + printf ("Host info: (%s)\n", cole_host_info); + + + cfs = cole_mount (argv[1], &colerrno); + if (cfs == NULL) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + + + if (cole_print_tree (cfs, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + cd = cole_opendir_rootdir (cfs, &colerrno); + if (cd == NULL) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + for (cde = cole_visiteddirentry (cd); cde != NULL; + cde = cole_nextdirentry (cd)) { + if (cole_direntry_isdir (cde)) + printf ("DIR "); + else if (cole_direntry_isfile (cde)) { + printf ("FILE "); + /* open the file using their direntry */ + cf = cole_fopen_direntry (cde, &colerrno); + if (cf == NULL) { + cole_perror ("travel", colerrno); + cole_closedir (cd, NULL); + cole_umount (cfs, NULL); + exit (1); + } + if (cole_fclose (cf, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_closedir (cd, NULL); + cole_umount (cfs, NULL); + exit (1); + } + } else + printf ("???? "); + printf ("%7u ", cole_direntry_getsize (cde)); + entry_name = cole_direntry_getname (cde); + printf ("%08lx-%08lx %08lx-%08lx\t", + cole_direntry_getdays1 (cde), + cole_direntry_getsec1 (cde), + cole_direntry_getdays2 (cde), + cole_direntry_getsec2 (cde)); + if (!isprint ((int)entry_name[0])) + printf ("'\\x%02x%s'\n", entry_name[0], entry_name+1); + else + printf ("'%s'\n", entry_name); + } + if (cole_closedir (cd, &colerrno)) { + cole_umount (cfs, NULL); + exit (1); + } + + + cf = cole_fopen (cfs, "\005SummaryInformation", &colerrno); + if (cf == NULL) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + char_read_total = 0; + printf ("Reading: "); + while ((char_read = cole_fread (cf, buffer, BUFFER_SIZE, &colerrno))) { + printf ("[%d]", char_read); + char_read_total += char_read; + } + cole_perror (PRGNAME, colerrno); + printf ("\nRead %d bytes from the stream '\\005SummaryInformation'\n", + char_read_total); + if (cole_fclose (cf, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + + if (cole_umount (cfs, &colerrno)) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + exit (0); +} + diff --git a/cole/examples/directory.c b/cole/examples/directory.c new file mode 100644 index 0000000..e6e4cab --- /dev/null +++ b/cole/examples/directory.c @@ -0,0 +1,121 @@ +/* + cole - A free C OLE library. + cole test. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include +#include + +#include +#include + + +/* +MISSING TO TEST: +cole_opendir_direntry +cole_dir_getname +cole_dir_getsize +cole_dir_getdays1 +cole_dir_getsec1 +cole_dir_getdays2 +cole_dir_getsec2 +*/ + + +#define PRGNAME "directory" + + +int +main (int argc, char **argv) +{ + COLEFS * cfs; + COLEDIR * cd; + COLEDIRENT * cde; + COLEFILE * cf; + char * entry_name; + COLERRNO colerrno; + + + cfs = cole_mount (COLE_TOPSRCDIR"/examples/text.doc", &colerrno); + if (cfs == NULL) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + + cd = cole_opendir_rootdir (cfs, &colerrno); + if (cd == NULL) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + for (cde = cole_visiteddirentry (cd); cde != NULL; + cde = cole_nextdirentry (cd)) { + if (cole_direntry_isdir (cde)) + printf ("DIR "); + else if (cole_direntry_isfile (cde)) { + printf ("FILE"); + /* open the file using their direntry */ + cf = cole_fopen_direntry (cde, &colerrno); + if (cf == NULL) { + cole_perror ("travel", colerrno); + cole_closedir (cd, NULL); + cole_umount (cfs, NULL); + exit (1); + } + /* Here we process cf */ + if (cole_fclose (cf, &colerrno)) { + cole_perror ("travel", colerrno); + cole_closedir (cd, NULL); + cole_umount (cfs, NULL); + exit (1); + } + } else + printf ("????"); + printf (" %7u", cole_direntry_getsize (cde)); + entry_name = cole_direntry_getname (cde); + if (!isprint ((int)entry_name[0])) + printf ("' \\x%02x%s'", entry_name[0], entry_name+1); + else + printf ("'%s'", entry_name); + printf ("\t%08lx-%08lx %08lx-%08lx", + cole_direntry_getdays1 (cde), + cole_direntry_getsec1 (cde), + cole_direntry_getdays2 (cde), + cole_direntry_getsec2 (cde)); + printf ("\n"); + } + if (cole_closedir (cd, &colerrno)) { + cole_perror ("travel", colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + if (cole_umount (cfs, &colerrno)) { + cole_perror ("travel", colerrno); + exit (1); + } + + exit (0); +} + diff --git a/cole/examples/file.c b/cole/examples/file.c new file mode 100644 index 0000000..6770b69 --- /dev/null +++ b/cole/examples/file.c @@ -0,0 +1,192 @@ +/* + cole - A free C OLE library. + cole test. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include + +#include +#include + + +/* cole_fopen_direntry is tested in `directory.c' */ + + +#define PRGNAME "file" +#define BUFFER_SIZE 128 +#define FILENAME2_SIZE 108004 + + +int +main (int argc, char **argv) +{ + COLEFS * cfs; + COLEFILE * cf; + COLERRNO colerrno; + char buffer[BUFFER_SIZE]; + size_t char_read; + size_t char_read_total; + char *filename2 = "/ObjectPool/_994231763/\001Ole10Native"; + char *filename2_pretty = "/ObjectPool/_994231763/\\001Ole10Native"; + + cfs = cole_mount (COLE_TOPSRCDIR"/examples/text.doc", &colerrno); + if (cfs == NULL) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + cf = cole_fopen (cfs, filename2, &colerrno); + if (cf == NULL) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + + printf ("File size: %d\n", cole_fsize (cf)); + if (cole_fsize (cf) != FILENAME2_SIZE) { + fprintf (stderr, "Test failed\n"); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + + printf ("File position: %d\n", cole_ftell (cf)); + char_read_total = 0; + while ((char_read = cole_fread (cf, buffer, BUFFER_SIZE, &colerrno))) + char_read_total += char_read; + cole_perror (PRGNAME, colerrno); + printf ("File position: %d\n", cole_ftell (cf)); + printf ("Read %d bytes from the stream `%s'\n", char_read_total, + filename2_pretty); + + + if (cole_frewind (cf, &colerrno)) { + fprintf (stderr, "Test failed\n"); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + + printf ("File position: %d\n", cole_ftell (cf)); + if (cole_ftell (cf) != 0) { + fprintf (stderr, "Test failed\n"); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + + if (cole_fseek (cf, 0, COLE_SEEK_END, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + printf ("File position: %d\n", cole_ftell (cf)); + if (cole_ftell (cf) != FILENAME2_SIZE) { + fprintf (stderr, "Test failed\n"); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + + if (cole_fseek (cf, 200, COLE_SEEK_END, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + printf ("File position: %d\n", cole_ftell (cf)); + if (cole_ftell (cf) != FILENAME2_SIZE - 200) { + fprintf (stderr, "Test failed\n"); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + + if (cole_fseek (cf, 100, COLE_SEEK_FORWARD, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + printf ("File position: %d\n", cole_ftell (cf)); + if (cole_ftell (cf) != FILENAME2_SIZE - 200 + 100) { + fprintf (stderr, "Test failed\n"); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + + if (cole_fseek (cf, 200, COLE_SEEK_BACKWARD, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + printf ("File position: %d\n", cole_ftell (cf)); + if (cole_ftell (cf) != FILENAME2_SIZE - 200 + 100 - 200) { + fprintf (stderr, "Test failed\n"); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + + if (!cole_fseek (cf, FILENAME2_SIZE + 1, COLE_SEEK_SET, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + printf ("File position: %d\n", cole_ftell (cf)); + + if (cole_fseek (cf, FILENAME2_SIZE, COLE_SEEK_END, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + if (cole_ftell (cf) != 0) { + fprintf (stderr, "Test failed\n"); + cole_fclose (cf, NULL); + cole_umount (cfs, NULL); + exit (1); + } + printf ("File position: %d\n", cole_ftell (cf)); + + + + if (cole_fclose (cf, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + if (cole_umount (cfs, &colerrno)) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + exit (0); +} + diff --git a/cole/examples/filesystem.c b/cole/examples/filesystem.c new file mode 100644 index 0000000..4e3a0c9 --- /dev/null +++ b/cole/examples/filesystem.c @@ -0,0 +1,102 @@ +/* + cole - A free C OLE library. + cole test. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include + +#include +#include + + +#define PRGNAME "filesystem" + + +/* To test cole_locate_filename() */ +struct str_info { + char *name; + size_t size; +}; +COLE_LOCATE_ACTION_FUNC check_size; + + +int +main (int argc, char **argv) +{ + COLEFS * cfs; + COLERRNO colerrno; + + /* To test cole_locate_filename() */ +#define FILENAME "/ObjectPool/_994231763/\001Ole10Native" + struct str_info info = { FILENAME, 108004 }; + + + cfs = cole_mount (COLE_TOPSRCDIR"/examples/text.doc", &colerrno); + if (cfs == NULL) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + + if (cole_print_tree (cfs, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + if (cole_locate_filename (cfs, FILENAME, &info, check_size, + &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + if (cole_recurse_tree (cfs, NULL, NULL, NULL, NULL, NULL, NULL, + &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + if (cole_umount (cfs, &colerrno)) { + cole_perror ("travel", colerrno); + exit (1); + } + + exit (0); +} + + +/* To test cole_locate_filename() */ +void +check_size (COLEDIRENT *cde, void *_info) { + struct str_info *info = (struct str_info *)_info; + + if (info->size != cole_direntry_getsize (cde)) + printf ("SIZE OF `%s' DOESN'T CHECK!\n", info->name); + else + printf ("Size of `%s' is ok\n", info->name); +} + diff --git a/cole/examples/present.sdd b/cole/examples/present.sdd new file mode 100644 index 0000000..4ace05a Binary files /dev/null and b/cole/examples/present.sdd differ diff --git a/cole/examples/sprsheet.sdc b/cole/examples/sprsheet.sdc new file mode 100644 index 0000000..bdb2752 Binary files /dev/null and b/cole/examples/sprsheet.sdc differ diff --git a/cole/examples/sprsheet.xls b/cole/examples/sprsheet.xls new file mode 100644 index 0000000..cfcd358 Binary files /dev/null and b/cole/examples/sprsheet.xls differ diff --git a/cole/examples/text.doc b/cole/examples/text.doc new file mode 100644 index 0000000..2b557b9 Binary files /dev/null and b/cole/examples/text.doc differ diff --git a/cole/examples/text.sdw b/cole/examples/text.sdw new file mode 100644 index 0000000..e269741 Binary files /dev/null and b/cole/examples/text.sdw differ diff --git a/cole/examples/topsrcdir.h.in b/cole/examples/topsrcdir.h.in new file mode 100644 index 0000000..2fcc93b --- /dev/null +++ b/cole/examples/topsrcdir.h.in @@ -0,0 +1,41 @@ +/* + cole - A free C OLE library. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + +#ifndef COLE_TOPSRCDIR_H +#define COLE_TOPSRCDIR_H + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define COLE_TOPSRCDIR "@top_srcdir@" + + + +#ifdef __cplusplus +} +#endif + +#endif /* COLE_TOPSRCDIR_H */ + diff --git a/cole/examples/version.c b/cole/examples/version.c new file mode 100644 index 0000000..05819a7 --- /dev/null +++ b/cole/examples/version.c @@ -0,0 +1,42 @@ +/* + cole - A free C OLE library. + cole test. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include + +#include + + +int +main (int argc, char **argv) +{ + printf ("cole version (defines): %d.%d.%d\n", + COLE_MAJOR_VERSION, COLE_MINOR_VERSION, COLE_MICRO_VERSION); + printf ("cole version (variables): %d.%d.%d\n", + cole_major_version, cole_minor_version, cole_micro_version); + printf ("cole version (cole_version): %s\n", cole_version); + printf ("cole host: %s\n", cole_host_info); + + exit (0); +} + diff --git a/cole/internal.c b/cole/internal.c new file mode 100644 index 0000000..f22ba37 --- /dev/null +++ b/cole/internal.c @@ -0,0 +1,139 @@ +/* + cole - A free C OLE library. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + +#include +#include +#include +#if !(defined( __WIN32__ ) || defined( __BORLANDC__ )) +#include +#endif + +#include "internal.h" + + +#define MIN(a,b) ((a)<(b) ? (a) : (b)) + + +int +__cole_extract_file (FILE **file, char **filename, U32 size, U32 pps_start, + U8 *BDepot, U8 *SDepot, FILE *sbfile, FILE *inputfile) +{ + /* FIXME rewrite this cleaner */ + + U16 BlockSize, Offset; + U8 *Depot; + FILE *infile; + long FilePos; + size_t bytes_to_copy; + U8 Block[0x0200]; +#if defined( __WIN32__ ) || defined( __BORLANDC__ ) + FILE *ret; + + *filename = (char *)malloc (TMPNAM_LEN); + if (*filename == NULL) + return 1; + + if (tmpnam (*filename) == NULL) { + free (*filename); + return 2; + } + ret = fopen (*filename, "w+b"); + *file = ret; + if (ret == NULL) { + free (*filename); + return 3; + } +#else + int ret; + + *filename = malloc (TMPNAM_LEN); + if (*filename == NULL) + return 1; + + strcpy(*filename, "/tmp/xlHtmlXXXXXX"); + ret = mkstemp(*filename); + if (ret == -1) { + free(*filename); + return 2; + } + + *file = fdopen(ret, "w+b"); + if (*file == NULL) { + free(*filename); + close(ret); + return 3; + } + /* unlink() is called so this file deletes when we are done with it */ + unlink(*filename); +#endif + if (size >= 0x1000) { + /* read from big block depot */ + Offset = 1; + BlockSize = 0x0200; + infile = inputfile; + Depot = BDepot; + } else { + /* read from small block file */ + Offset = 0; + BlockSize = 0x40; + infile = sbfile; + Depot = SDepot; + } + while (pps_start != 0xfffffffeUL /*&& pps_start != 0xffffffffUL && + pps_start != 0xfffffffdUL*/) { + FilePos = (long)((pps_start + Offset) * BlockSize); + if (FilePos < 0) { + fclose (*file); + remove (*filename); + free (*filename); + return 4; + } + bytes_to_copy = MIN ((U32)BlockSize, size); + if (fseek (infile, FilePos, SEEK_SET)) { + fclose (*file); + remove (*filename); + free (*filename); + return 4; + } + fread (Block, bytes_to_copy, 1, infile); + if (ferror (infile)) { + fclose (*file); + remove (*filename); + free (*filename); + return 5; + } + fwrite (Block, bytes_to_copy, 1, *file); + if (ferror (*file)) { + fclose (*file); + remove (*filename); + free (*filename); + return 6; + } + pps_start = fil_sreadU32 (Depot + (pps_start * 4)); + size -= MIN ((U32)BlockSize, size); + if (size == 0) + break; + } + + return 0; +} + diff --git a/cole/internal.h b/cole/internal.h new file mode 100644 index 0000000..1ef90a4 --- /dev/null +++ b/cole/internal.h @@ -0,0 +1,142 @@ +/* + cole - A free C OLE library. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + +#ifndef COLE_INTERNAL_H +#define COLE_INTERNAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifndef COLE_SUPPORT_H +#include "support.h" +#endif + +#if defined( __WIN32__ ) || defined( __BORLANDC__ ) +#define TMPNAM_LEN L_tmpnam +#else +#define TMPNAM_LEN 18 /* /tmp/xlHtmlXXXXXX + NULL */ +#endif + +/* This structure describe one stream. */ +struct pps_block + { + char name[0x20]; + char filename[TMPNAM_LEN]; /* valid only if type == 2 */ + U8 type; /* 5 == root, 1 == dir, 2 == file */ + U32 size; /* the size of the file, + valid only if type == 2 */ + U32 next; /* next entry in this level, + in this directory */ + U32 dir; /* valid only if type != 2 */ + U16 level; /* level in the ole tree */ + U32 seconds1; + U32 seconds2; + U32 days1; + U32 days2; + U32 start; /* start block */ + + /* private fields, used only inside OLEdecoded and OLEcode, + don't modify them if you want to use OLEcode */ + U32 previous; /* previous pps, valid before reordering */ + U32 ppsnumber; /* pps number */ + }; +typedef struct pps_block pps_entry; + + +/* + Create a OLE stream tree from a file. + Input: char *Olefilename = File to be decoded (ie. .xsl, .doc, .ppt). + . pps_entry ** stream_list = The stream tree. + . U32 * root = The number of root dir in stream_list. + . U8 **_BDepot, U8 **_SDepot, FILE **_sbfile, char **_sbfilename, + . FILE **_input, + . = Exposes internals, read only. + . U16 max_level = The maximum level on stream tree in which + . streams will be actually extracted + . to a file. 0 (zero) means extract all. + Output: 0 = Sucess. + . 4 = Couldn't open OLEfilename file (can use perror). + . 8 = OLEfilename file seems to contain plain text, not OLE file. + . 9 = OLEfilename is a binary file, but it have not OLEfile format. + . 5 = Error reading from file, means OLEfilename file has a faulty + . OLE file format (UPDATE: not always). + . 6 = Error removing temporal files. <-- this is never returned now + . 7 = Error creating temporal files, can use perror. + . 10 = Error allocating memory, there's no more memory. + */ +int __OLEdecode (char *OLEfilename, pps_entry ** stream_list, U32 * root, + U8 **_BDepot, U8 **_SDepot, FILE **_sbfile, char **_sbfilename, + FILE **_input, U16 max_level); + + + +/* + * FROM COLE 2.0.0 API + */ +struct _COLEFS { + /* This structure is for internal use only, not for the public API */ + pps_entry *tree; + U32 root; /* entry root, root pps_entry */ + U8 *BDepot; + U8 *SDepot; + FILE *sbfile; + char *sbfilename; + FILE *file; /* actual file (the filesystem) */ +}; +struct _COLEDIRENT { + /* This structure is for internal use only, not for the public API */ + U32 entry; + struct _COLEDIR *dir; /* father */ +}; +struct _COLEDIR { + /* This structure is for internal use only, not for the public API */ + U32 entry; + struct _COLEDIRENT visited_entry; + struct _COLEFS *fs; /* father */ +}; +struct _COLEFILE { + /* This structure is for internal use only, not for the public API */ + U32 entry; + FILE *file; /* actual extracted file */ + char *filename; /* actual extracted file's name */ + U32 filesize; /* actual extracted file size */ + struct _COLEFS *fs; /* father */ + U32 pos; /* file pointer position */ +}; +int __cole_extract_file (FILE **file, char **filename, U32 size, + U32 pps_start, U8 *BDepot, U8 *SDepot, FILE *sbfile, + FILE *inputfile); +#define _COLE_TYPE_DIR 1 +#define _COLE_TYPE_FILE 2 +#define _COLE_TYPE_ROOT 5 + + + +#ifdef __cplusplus +} +#endif + +#endif /* COLE_INTERNAL_H */ + diff --git a/cole/olecod.c b/cole/olecod.c new file mode 100644 index 0000000..2dc34d7 --- /dev/null +++ b/cole/olecod.c @@ -0,0 +1,1260 @@ +/* + OLEcode - Generate a Microsoft OLE 2 file from given streams. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include +#include +#include + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "cole.h" +#else +#include "cole.h.in" +#endif +#include "support.h" +#include "internal.h" + + + +#ifdef COLE_VERBOSE +#define VERBOSE +#else +#undef VERBOSE +#endif + + +/* warning: some lines are longer than 80 characters */ + +struct str_MY_FILE +{ + enum + { + real, MY_FILE_list, block_list, root_list + } type; + U32 size; /* size of list _itself_ */ + U32 *blocks; /* size in big blocks (0x0200) of the information + that contains this file */ + union union_file + { + struct str_real + { + char *name; /* file name */ + U32 ppsnumber; /* ppsnumber of pps property in stream_list */ + } real; + struct str_MY_FILE *MY_FILE_list; + U32 *block_list; + U8 *root_list; + } file; +}; +typedef struct str_MY_FILE MY_FILE; + + +static MY_FILE Input; +static MY_FILE *sbfile; +static MY_FILE *SDepot; +static MY_FILE *BDepot; +static MY_FILE *bbd_list; +static MY_FILE *Root; + +/* starting and sizing blocks (calculated in calculate_blocks()) */ +static U32 header_blocks; /* how many blocks takes header */ +static U32 big_streams_blocks; /* how many blocks takes big streams */ +static U32 sbfile_blocks; /* how many blocks takes sbfile (small streams) */ +static U32 SDepot_blocks; /* how many blocks takes SDepot */ +static U32 BDepot_blocks; /* how many blocks takes BDepot */ +static U32 Root_blocks; /* how many blocks takes Root */ +static U32 sbfile_start_block; /* where sbfile starts */ +static U32 SDepot_start_block; /* where SDepot starts */ +static U32 Root_start_block; /* where Root starts */ +static U32 BDepot_start_block; /* where BDepot starts */ + +static FILE *output_file; +/* the output file OLE2 file */ +static U8 output_block[0x0200]; +/* used as buffer to write later to output_file */ +static U16 pos_block; +/* + position inside output_block from where the next write will happen, + when it cames 0x0200 must write the block to output_file and + make pos_block = 0x00 + */ +static U32 next_block; +/* number of the next block to be written in output_file. + the first block is -1, the second 0, the third 1 and so on */ + +/* process stage functions */ +static int process_Root (pps_entry * pps_list, U32 root); +static U32 max_pps_referenced (pps_entry * pps_list, U32 node); +static U32 max3 (U32 a, U32 b, U32 c, U32 d); +static int process_streams (pps_entry * pps_list, pps_entry * root); +static int add_stream_to_sbfile_and_SDepot (U32 size, char *name, U32 ppsnumber); +static int add_stream_to_Input_and_BDepot (U32 size, char *name, U32 ppsnumber); +static int add_entry_to_Root (pps_entry * node, U32 start_block); +static U32 add_MY_FILE_entry (MY_FILE * list, U32 size); +static int pps2root (U8 pps[0x80], pps_entry * node, U32 start_block); +static void reset_links_in_Input (void); +static void reset_links_in_BDepot (void); +static void reset_links_in_SDepot (void); +/* generate starge functions */ +static int generate_ole2_file (const char *filename, int trunc); +static int generate_header (void); +static int generate_recursive (MY_FILE * list); +static int generate_SDepot (void); +static int generate_Root (void); +static int generate_BDepot (void); +static int generate_real_file (MY_FILE * MY_FILE_file); +static int write_block_list (U32 start_count, MY_FILE *list, int write_end_chain); +static int write_root_list (MY_FILE * list); +static void calculate_blocks (void); +/* support functions for both stages */ +static U32 sum_block_list (MY_FILE * list); +/* useless function by now, may be later */ +/* static U32 sum_MY_FILE_list (MY_FILE * list); */ +static U32 sum_blocks_MY_FILE_list (MY_FILE * list); + +static void ends (void); + +#define size2blocks(s,b) (!(s) ? 1 : (1+((s)-1)/(b))) +#define size2blocks_preserve_zero(s,b) (!(s) ? 0 : (1+((s)-1)/(b))) +#define clean_block(b,s) memset((b),0xff,(s)) +#define init_MY_FILE(n, t, s, b, f) { \ + (n)->type = t; \ + (n)->size = (s); \ + (n)->blocks = (b); \ + (n)->file.t = (f); \ + } +#define init_MY_FILE_real(n, t, s, b, f, p) { \ + n->type = t; \ + n->size = s; \ + n->blocks = b; \ + n->file.real.name = f; \ + n->file.real.ppsnumber = p; \ + } + +#define reset_links() { reset_links_in_Input(); reset_links_in_BDepot(); reset_links_in_SDepot(); } +/* if this block is full, write it to output_file and + restart using this block */ +#define check_output_block_boundary() { \ + if (pos_block == 0x0200) { \ + test_exitf (fwrite (output_block, 0x0200, 1, output_file) == 1, 1, dummy()); \ + next_block++; \ + pos_block = 0x00; \ + } \ + } +#define write_until_output_block_boundary(clean) { \ + if (pos_block != 0x00) { \ + if (clean && pos_block%0x0200) \ + clean_block (output_block + pos_block, (pos_block/0x0200 + 1)*0x0200 - pos_block); \ + test_exitf (fwrite (output_block, 1, 0x0200, output_file) == 0x0200, 1, dummy ()); \ + next_block++; \ + pos_block = 0x00; \ + } \ +} +#define write_until_output_block_small_boundary(clean) { \ + if (pos_block % 0x40) { \ + if (clean) \ + clean_block (output_block + pos_block, (pos_block/0x40 + 1)*0x40 - pos_block); \ + assert (pos_block+(pos_block/0x40 + 1)*0x40 - pos_block == (pos_block/0x40 + 1)*0x40); \ + pos_block += (U16)((pos_block/0x40 + 1)*0x40 - pos_block); \ + } \ +} + +#define write_rest_of_output_block_with_null_pps() { \ + if (pos_block != 0x00) { \ + int zzzi; \ + U16 U16zero = 0x0000U; \ + clean_block (output_block + pos_block, 0x0200 - pos_block); \ + for (zzzi = 0; zzzi < 4; zzzi++) \ + if (zzzi*0x80 >= pos_block) \ + fil_swriteU16 (output_block + zzzi*0x80 + 0x40, &U16zero); \ + } \ + } +#define dummy() +/* +may be should be (means no op, do nothing): +#define dummy() {1;} +or may be: +#define dummy() {;} +*/ + + + +/* + Exit codes: + 0 = All goes OK. + 1 = error writting in OLEfilename, can use perror + 2 = trunc == 0 and file exist + 3 = can't create OLEfilename, can use perror + 10 = Error allocating memory, there's no more memory + 11 = Error reading streams files + 12 = Error reading stream_list, it's broken +*/ +int +__OLEcode (const char *OLEfilename, int trunc, pps_entry * stream_list, + U32 root) +{ + verbose ("calling: OLEcode ()"); + + assert (OLEfilename != NULL); + assert (stream_list != NULL); + + /* -- init static things -- */ + output_file = NULL; + clean_block (output_block, 0x0200); + /* just needed clean up once, for security reasons */ + pos_block = 0x00; + next_block = 0xffffffffUL; + /* it need to be 0xffffffffUL, because next time we make next_block++ + it must be zero (bad hack? next_block is always 32 bits) */ + BDepot = SDepot = bbd_list = NULL; + Root = NULL; + sbfile = NULL; + + + /* -- allocate initial memory needed for my files (Structure called at HACKING) -- */ + + /* Input: 5 entries in Input: for sbfile, for SDepot, for BDepot, + for bbd_list and for Root */ + init_MY_FILE ((&Input), MY_FILE_list, 5 * sizeof (MY_FILE), NULL, + malloc (Input.size)); + /* Input->blocks is not needed */ + test_exitf (Input.file.MY_FILE_list != NULL, 10, ends ()); + reset_links_in_Input (); + + /* bbd_list */ + init_MY_FILE (bbd_list, block_list, sizeof (U32), NULL, + malloc (bbd_list->size)); + /* bbd_list is not needed */ + /* bbd_list->blocks is not needed */ + test_exitf (bbd_list->file.block_list != NULL, 10, ends ()); + bbd_list->file.block_list[0] = 1; + /* because BDepot starts with 3 entries */ + + /* BDepot */ + init_MY_FILE (BDepot, block_list, 3 * sizeof (U32), + bbd_list->file.block_list, malloc (BDepot->size)); + test_exitf (BDepot->file.block_list != NULL, 10, ends ()); + BDepot->file.block_list[0] = BDepot->file.block_list[1] = + BDepot->file.block_list[2] = 0; + /* sbfile, SDepot and Root are size 0 by now */ + + /* sbfile */ + init_MY_FILE (sbfile, MY_FILE_list, 0, BDepot->file.block_list, NULL); + + /* SDepot */ + init_MY_FILE (SDepot, block_list, 0, BDepot->file.block_list + 1, NULL); + + /* Root */ + init_MY_FILE (Root, root_list, 0, BDepot->file.block_list + 2, NULL); + + + /* -- process streams -- */ + test_call (process_Root (stream_list, root), int); + test_call (process_streams (stream_list, &stream_list[root]), int); + /* how can I call ends() if process_streams fails? */ + + + /* -- actually generate ole2 file -- */ + test_call (generate_ole2_file (OLEfilename, trunc), int); + + + return 0; +} + + +/* reviewed when coding ole2 file */ +static int +process_Root (pps_entry * pps_list, U32 root) +{ + U32 pps_list_entries; + U32 i; + + verbose ("calling: process_Root ()"); + + pps_list_entries = (1 + max_pps_referenced (pps_list, root)); + verboseU32 (pps_list_entries); + + for (i = 0; i < pps_list_entries; i++) + test_call (add_entry_to_Root (pps_list + i, 0x00000000UL), int); + /* + start_block = 0x00000000UL is a dummy value. + The real start block: + for files in SDepot is written in Root in generate_real_file(), + for files in BDepot is written in Root in generate_real_file(), + and for sbfile: the default is written in process_streams() + and the real, if any, is written when generating the first + small stream in generate_real_file(). + But 0x00000000UL is a perfect value to directory entries (type=1) + About sizes: every pps have its size, incluiding sbfile, + that value will be comparated later in generate_real_file(). + */ + + return 0; +} + + + +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +static U32 max3 (U32 a, U32 b, U32 c, U32 d) +{ + U32 m = 0; + + /*verbose ("calling: max3 ()");*/ + + m = MAX (m, a); + m = MAX (m, b); + m = MAX (m, c); + m = MAX (m, d); + return m; +} + + +static U32 max_pps_referenced (pps_entry * pps_list, U32 node) +{ + U32 max_pps; + + /*verbose ("calling: max_pps_referenced ()");*/ + + max_pps = max3 (node, + pps_list[node].previous != 0xffffffffUL ? pps_list[node].previous : 0, + pps_list[node].next != 0xffffffffUL ? pps_list[node].next : 0, + pps_list[node].dir != 0xffffffffUL ? pps_list[node].dir : 0); + + if (pps_list[node].previous != 0xffffffffUL) + max_pps = MAX (max_pps, + max_pps_referenced (pps_list, pps_list[node].previous)); + if (pps_list[node].next != 0xffffffffUL) + max_pps = MAX (max_pps, + max_pps_referenced (pps_list, pps_list[node].next)); + if (pps_list[node].dir != 0xffffffffUL) + max_pps = MAX (max_pps, + max_pps_referenced (pps_list, pps_list[node].dir)); + + return max_pps; +} + + +/* reviewed when coding ole2 file */ +static int process_streams (pps_entry * pps_list, pps_entry * node) +{ + U32 U32end_chain = 0xfffffffeUL; + + verbose ("calling: process_streams ()"); + + test_exitf (node->name[0], 12, dummy()); + switch (node->type) + { + case 1: /* dir */ + warning (node->size == 0); + if (node->dir != 0xffffffffUL) + test_call (process_streams (pps_list, &pps_list[node->dir]), int); + if (node->next != 0xffffffffUL) + test_call (process_streams (pps_list, &pps_list[node->next]), int); + break; + + case 5: /* root dir */ + assert (*(Root->file.root_list + 0x42) == 5); + /* write the default start block of SDepot: empty if there are no + sbfile at all */ + fil_swriteU32 (Root->file.root_list + 0x74, &U32end_chain); + if (node->dir != 0xffffffffUL) + test_call (process_streams (pps_list, &pps_list[node->dir]), int); + if (node->next != 0xffffffffUL) + test_call (process_streams (pps_list, &pps_list[node->next]), int); + break; + + case 2: /* file */ + test_exitf (node->dir == 0xffffffffUL, 12, dummy()); + if (node->size < 0x1000) + /* must be in sbfile, and its block list in SDepot */ + test_call (add_stream_to_sbfile_and_SDepot ( + node->size, node->filename, node->ppsnumber), int) + else /* node->size >= 0x1000 */ + /* must be in Input, and its block list in BDepot */ + test_call (add_stream_to_Input_and_BDepot ( + node->size, node->filename, node->ppsnumber), int); + if (node->next != 0xffffffffUL) + test_call (process_streams (pps_list, &pps_list[node->next]), int); + break; + + default: + return 12; + } + + return 0; +} + + +/* reviewed when processing Root */ +static int add_entry_to_Root (pps_entry * node, U32 start_block) +{ + U32 entry_number; + U8 * new_entry_Root; + + verbose ("calling: add_entry_to_Root ()"); + + /* 1. add entry in Root */ + entry_number = add_MY_FILE_entry (Root, 0 /*dummy value, not used*/); + test_exitf (entry_number != 0xffffffffUL, 10, dummy ()); + new_entry_Root = Root->file.root_list + entry_number * 0x80; + + /* 2. write info about the new stream in the new entry in Root */ + pps2root (new_entry_Root, node, start_block); + /* 3. update Input entry of Root */ + /* update blocks size of Root (need Root->size updated) */ + *(Root->blocks) = size2blocks (Root->size, 0x0200); + + /* 4. update Input entry of BDepot */ + /* update blocks size of BDepot (need blocks size of Root updated */ + *(BDepot->blocks) = size2blocks (sum_block_list (BDepot) * sizeof (U32), 0x0200); + + return 0; +} + + +/* reviewed when processing streams */ +static int +add_stream_to_sbfile_and_SDepot (U32 size, char *name, U32 ppsnumber) +{ + U32 entry_number; + U32 * new_entry_SDepot; + MY_FILE * new_entry_sbfile; + + verbose ("calling: add_stream_to_sbfile_and_SDepot ()"); + /* must be called only by process streams */ + + /* 1. add entries in SDepot and sbfile */ + /* add in SDepot */ + entry_number = add_MY_FILE_entry (SDepot, size); + test_exitf (entry_number != 0xffffffffUL, 10, dummy ()); + new_entry_SDepot = SDepot->file.block_list + entry_number; + /* add in sbfile */ + entry_number = add_MY_FILE_entry (sbfile, size); + test_exitf (entry_number != 0xffffffffUL, 10, dummy ()); + new_entry_sbfile = sbfile->file.MY_FILE_list + entry_number; + + /* 2. write info about the new stream in the new entry in SDepot */ + /* write info in new entry (info related with parameter size) */ + /* write blocks size of stream added */ + *new_entry_SDepot = size2blocks (size, 0x40); /* 0x40 because is small stream */ + /* 3. update Input entry of SDepot */ + /* update blocks size of SDepot (need info in new_entry_SDepot written) */ + *(SDepot->blocks) = size2blocks (sum_block_list (SDepot) * sizeof (U32), 0x0200); + + /* 4. write info about the new stream in the new entry in sbfile */ + /* write info in new entry (info related with parameter size */ + /* and block size depot) */ + /* write size of stream added */ + /* and write blocks size link of stream added */ + init_MY_FILE_real (new_entry_sbfile, real, size, new_entry_SDepot, name, ppsnumber); + /* 5. update Input entry of sbfile */ + /* update blocks size of sbfile (need info in new_entry_sbfile->size */ + /* and new_entry_sbfile->blocks written) */ + *(sbfile->blocks) = size2blocks (sum_blocks_MY_FILE_list (sbfile) * 0x40, 0x0200); + + /* 6. update Input entry of BDepot */ + /* update blocks size of BDepot (need blocks size of */ + /* SDepot and sbfile updated */ + *(BDepot->blocks) = size2blocks (sum_block_list (BDepot) * sizeof (U32), 0x0200); + + return 0; +} + + +/* reviewed when processing streams */ +static int +add_stream_to_Input_and_BDepot (U32 size, char *name, U32 ppsnumber) +{ + U32 entry_number; + MY_FILE * new_entry_Input; + U32 * new_entry_BDepot; + + verbose ("calling: add_stream_to_Input_and_BDepot ()"); + /* must be called only by process streams */ + + /* 1. add entries in BDepot and Input */ + /* add in BDepot */ + entry_number = add_MY_FILE_entry (BDepot, size); + test_exitf (entry_number != 0xffffffffUL, 10, dummy ()); + new_entry_BDepot = BDepot->file.block_list + entry_number; + /* add in Input */ + entry_number = add_MY_FILE_entry (&Input, size); + test_exitf (entry_number != 0xffffffffUL, 10, dummy ()); + new_entry_Input = Input.file.MY_FILE_list + entry_number; + + /* 2. write info about the new stream in the new entry in BDepot */ + /* write info in new entry (info related with parameter size) */ + /* write blocks size of stream added */ + *new_entry_BDepot = size2blocks (size, 0x0200); /* 0x0200 because is big stream */ + /* 3. update Input entry of BDepot */ + /* update blocks size of BDepot (need info in new_entry_BDepot written) */ + *(BDepot->blocks) = size2blocks (sum_block_list (BDepot) * sizeof (U32), 0x0200); + + /* 4. write info about the new stream in the new entry in Input */ + /* write info in new entry (info related with parameter size */ + /* and block size depot) */ + /* write size of stream added */ + /* and write blocks size link of stream added */ + init_MY_FILE_real (new_entry_Input, real, size, new_entry_BDepot, name, ppsnumber); + /* 5. ?? update Input entry of Input ?? */ + /* this seems to be not aplicable here, not needed */ + + /* 6. update Input entry of BDepot */ + /* update blocks size of BDepot (need blocks size of */ + /* BbDepot and ?? Input ?? updated */ + *(BDepot->blocks) = size2blocks (sum_block_list (BDepot) * sizeof (U32), 0x0200); + + return 0; +} + + +/* reviewed all conditions */ +static U32 add_MY_FILE_entry (MY_FILE * list, U32 size) +{ +#if __GNUC__ == 2 + static char cff[] = "cole2357"; +#define nextff(var) static void * nextff_##var = (&nextff_##var); \ +nextff_##var=&##var; +nextff (cff); +#endif + + verbose ("calling: add_MY_FILE_entry ()"); + +#ifdef VERBOSE + if (list == &Input) + { + verbose_wonl ("add_MY_FILE_entry: list = &Input, "); + } + else if (list == sbfile) + { + verbose_wonl ("add_MY_FILE_entry: list = sbfile, "); + } + else if (list == SDepot) + { + verbose_wonl ("add_MY_FILE_entry: list = SDepot, "); + } + else if (list == BDepot) + { + verbose_wonl ("add_MY_FILE_entry: list = BDepot, "); + } + else if (list == bbd_list) + { + verbose_wonl ("add_MY_FILE_entry: list = bbd_list, "); + } + else if (list == Root) + { + verbose_wonl ("add_MY_FILE_entry: list = Root, "); + } + else + { + verbose_wonl ("add_MY_FILE_entry: list = UNKNOWN (ERROR!), "); + } + verboseU32 (size); +#endif + + assert (list != NULL); + + switch (list->type) + { + +/* reviewed when adding to sbfile */ +/* reviewed when adding to Input */ + case MY_FILE_list: { + MY_FILE *new_MY_FILE_list; + U32 new_entry; + + assert (list == sbfile || list == &Input); + /* actually add */ + list->size = list->size + sizeof (MY_FILE); + new_MY_FILE_list = realloc (list->file.MY_FILE_list, list->size); + list->file.MY_FILE_list = new_MY_FILE_list; + test_exitf (new_MY_FILE_list != NULL, 0xffffffffUL, dummy ()); + new_entry = list->size / sizeof (MY_FILE) - 1; + reset_links (); + + return new_entry; + } + +/* reviewed when adding to SDepot */ +/* reviewed when adding to BDepot */ + case block_list: { + U32 *new_block_list; + U32 new_entry; + + assert (list == SDepot || list == BDepot); + /* actually add */ + list->size = list->size + sizeof (U32); + new_block_list = realloc (list->file.block_list, list->size); + list->file.block_list = new_block_list; + test_exitf (new_block_list != NULL, 0xffffffffUL, dummy ()); + new_entry = list->size / sizeof (U32) - 1; + reset_links (); + + return new_entry; + } + +/* reviewed when adding to Root */ + case root_list: { + U32 new_entry; + U8 *new_root_list; + + assert (list == Root); + /* actually add */ + list->size = list->size + 0x80; + new_root_list = realloc (list->file.root_list, list->size); + list->file.root_list = new_root_list; + test_exitf (new_root_list != NULL, 0xffffffffUL, dummy ()); + new_entry = list->size / 0x80 - 1; + reset_links (); + + return new_entry; + } + + default: + if (SDepot->file.block_list!=NULL) + { + verboseU32Array (SDepot->file.block_list, SDepot->size / sizeof(U32)); + verboseU32 (Root->size); + verboseU32Array (BDepot->file.block_list, BDepot->size / sizeof(U32)); + verboseU32 (*(bbd_list->file.block_list)); + } + assert ("list->type UNKNOWN in add_MY_FILE_entry" == NULL); + return 0; + } +} + + +/* reviewed when adding to Root */ +static int +pps2root (U8 pps[0x80], pps_entry * node, U32 start_block) +{ + U16 i; + U16 size_of_name; + /* next vars are constant, should it be static for performance? */ + U8 U8magiczero = 0x00; + U32 U32magiczero = 0x00000000UL; + U32 U32magic1 = 0x00020900UL; + U32 U32magic2 = 0x46000000UL; + + verbose ("calling: pps2root ()"); + + verboseU32 (node->ppsnumber); + verboseU32 ((U32) (pps - Root->file.root_list)); + + assert (node->ppsnumber == (U32)(pps - Root->file.root_list)/0x80); + + clean_block (pps, 0x80); + + /* name and its size */ + size_of_name = (U16)(2 * (strlen (node->name) + 1)); + /* 2 * because zero follow each char */ + for (i = 0; i < size_of_name; i++) + *(pps + i) = (U8)(i % 2 ? 0x00 : *(node->name + (i / 2))); + fil_swriteU16 (pps + 0x40, &size_of_name); + + /* other variables */ + *(pps + 0x42) = node->type; + fil_swriteU32 (pps + 0x44, &node->previous); + fil_swriteU32 (pps + 0x48, &node->next); + fil_swriteU32 (pps + 0x4c, &node->dir); + fil_swriteU32 (pps + 0x64, &node->seconds1); + fil_swriteU32 (pps + 0x68, &node->days1); + fil_swriteU32 (pps + 0x6c, &node->seconds2); + fil_swriteU32 (pps + 0x70, &node->days1); + fil_swriteU32 (pps + 0x74, &start_block); + fil_swriteU32 (pps + 0x78, &node->size); + + /* constant magic numbers */ + *(pps + 0x43) = U8magiczero; + fil_swriteU32 (pps + 0x50, &U32magic1); + fil_swriteU32 (pps + 0x54, &U32magiczero); + fil_swriteU32 (pps + 0x58, &U32magiczero); + fil_swriteU32 (pps + 0x5c, &U32magic2); + fil_swriteU32 (pps + 0x60, &U32magiczero); + fil_swriteU32 (pps + 0x7c, &U32magiczero); + + verboseU8Array (pps, 1, 0x80); + + return 0; +} + +static U32 sum_block_list (MY_FILE * list) +{ + U32 sum = 0; + U32 *block; + + /*verbose ("calling: sum_block_list ()");*/ + + assert (list != NULL); + assert (list->type == block_list); + for (block = list->file.block_list; + (U32)(((U8 *) block - (U8 *) list->file.block_list)) < list->size; + block++) + sum += *block; + + return sum; +} + + +/* +static U32 sum_MY_FILE_list (MY_FILE * list) +{ + U32 sum = 0; + MY_FILE *file; + + verbose ("calling: sum_MY_FILE_list ()"); + + assert (list != NULL); + assert (list->type == MY_FILE_list); + for (file = list->file.MY_FILE_list; + ((U8 *) file - (U8 *) list->file.MY_FILE_list) < list->size; + file++) + sum += file->size; + + return sum; +} +*/ + + +static U32 sum_blocks_MY_FILE_list (MY_FILE * list) +{ + U32 sum = 0; + MY_FILE *file; + + /*verbose ("calling: sum_blocks_MY_FILE_list ()");*/ + + assert (list != NULL); + assert (list->type == MY_FILE_list); + for (file = list->file.MY_FILE_list; + (U32)((U8 *) file - (U8 *) list->file.MY_FILE_list) < list->size; + file++) + if (file->blocks != NULL) + sum += *(file->blocks); + return sum; +} + +static void reset_links_in_Input (void) +{ + verbose ("calling: reset_links_in_Input ()"); + + sbfile = Input.file.MY_FILE_list + 4; + SDepot = Input.file.MY_FILE_list + 3; + BDepot = Input.file.MY_FILE_list + 1; + bbd_list = Input.file.MY_FILE_list; + Root = Input.file.MY_FILE_list + 2; +} + +static void reset_links_in_BDepot (void) +{ + U32 i; + + verbose ("calling: reset_links_in_BDepot ()"); + + sbfile->blocks = BDepot->file.block_list; + SDepot->blocks = BDepot->file.block_list + 1; + Root->blocks = BDepot->file.block_list + 2; + + /* relink big streams block sizes in Input with BDepot entries */ + for (i = 0; i < (Input.size / sizeof (MY_FILE)) - 5; i++) + Input.file.MY_FILE_list[i + 5].blocks = BDepot->file.block_list + i + 3; +} + +static void reset_links_in_SDepot (void) +{ + U32 i; + + verbose ("calling: reset_links_in_SDepot ()"); + + /* relink small streams block sizes in sbfile with SDepot entries */ + for (i = 0; i < sbfile->size / sizeof (MY_FILE); i++) + sbfile->file.MY_FILE_list[i].blocks = SDepot->file.block_list + i; +} + +static int generate_ole2_file (const char *filename, int trunc) +{ + verbose ("calling: generate_ole2_file ()"); + + if (!trunc) + { + output_file = fopen (filename, "r"); + test_exitf (output_file == NULL, 2, ends ()); + } + output_file = fopen (filename, "wb"); + test_exitf (output_file != NULL, 3, ends ()); + + test_call (generate_header (), int); + test_call (generate_recursive (&Input), int); + /* some tricky here: if there are only small streams, no big streams, + next line wich is in generate_real_file will never be executed. + so we do it here, if only is correct is harmless calling it here */ + write_until_output_block_boundary (1); + test_call (generate_SDepot (), int); + test_call (generate_Root (), int); + test_call (generate_BDepot (), int); + + fclose (output_file); + + return 0; +} + +static int generate_header (void) +{ + U32 identifier1 = 0xe011cfd0UL; + U32 identifier2 = 0xe11ab1a1UL; + U32 U32magiczero = 0x00000000UL; + U32 U32magic1 = 0x0003003bUL; + U32 U32magic2 = 0x0009fffeUL; + U32 U32magic3 = 0x00000006UL; + U32 U32magic4 = 0x00001000UL; + U32 U32magic5 = 0x00000001UL; + U32 U32magic6 = 0xfffffffeUL; + + verbose ("calling: generate_header ()"); + + calculate_blocks (); + + fil_swriteU32 (output_block + 0x30, &Root_start_block); + fil_swriteU32 (output_block + 0x3c, &SDepot_start_block); + fil_swriteU32 (output_block + 0x2c, &BDepot_blocks); + /* constant magic numbers */ + fil_swriteU32 (output_block + 0x00, &identifier1); + fil_swriteU32 (output_block + 0x04, &identifier2); + fil_swriteU32 (output_block + 0x08, &U32magiczero); + fil_swriteU32 (output_block + 0x0c, &U32magiczero); + fil_swriteU32 (output_block + 0x10, &U32magiczero); + fil_swriteU32 (output_block + 0x14, &U32magiczero); + fil_swriteU32 (output_block + 0x18, &U32magic1); + fil_swriteU32 (output_block + 0x1c, &U32magic2); + fil_swriteU32 (output_block + 0x20, &U32magic3); + fil_swriteU32 (output_block + 0x24, &U32magiczero); + fil_swriteU32 (output_block + 0x28, &U32magiczero); + fil_swriteU32 (output_block + 0x34, &U32magiczero); + fil_swriteU32 (output_block + 0x38, &U32magic4); + fil_swriteU32 (output_block + 0x40, &U32magic5); + fil_swriteU32 (output_block + 0x44, &U32magic6); + fil_swriteU32 (output_block + 0x48, &U32magiczero); + + pos_block = 0x4c; + + return 0; +} + + +/* reviewed all cases */ +static int generate_recursive (MY_FILE * list) +{ + MY_FILE *p_MY_FILE_list; + + verbose ("calling: generate_recursive ()"); + + switch (list->type) + { + + /* reviewed when generating Input and sbfile */ + case MY_FILE_list: + for (p_MY_FILE_list = list->file.MY_FILE_list; + (U32)((U8*)p_MY_FILE_list - (U8*)list->file.root_list) < list->size; + p_MY_FILE_list++) + test_call (generate_recursive (p_MY_FILE_list), int); + break; + + /* reviewed when generating bbd_list, BDepot and SDepot */ + case block_list: + if (list == bbd_list) + { + test_call (write_block_list (BDepot_start_block, bbd_list, 0), int); + write_until_output_block_boundary (1); + break; + } + else if (list == BDepot) + /* we want to skip generate BDepot by now */ + break; + else if (list == SDepot) + /* we want to skip generate SDepot by now */ + break; + else + assert ("list->type==block_list but list UNKNOWN in generate_recursive"==NULL); + + /* reviewed when generating Root */ + case root_list: + /* we want to skip generate Root by now */ + assert (list == Root); + break; + + case real: + /* we are generating big and small streams here */ + test_call (generate_real_file (list), int); + break; + + default: + assert ("list->type UNKNOWN in generate_recursive" == NULL); + } + + return 0; +} + + +static int generate_SDepot (void) +{ + verbose ("calling: generate_SDepot ()"); + + test_call (write_block_list (1, SDepot, 1), int); + write_until_output_block_boundary (1); + + return 0; +} + + +static int generate_Root (void) +{ + verbose ("calling: generate_Root ()"); + + test_call (write_root_list (Root), int); + write_rest_of_output_block_with_null_pps (); + write_until_output_block_boundary (0); + + return 0; +} + +static int generate_BDepot (void) +{ + MY_FILE SDepot_and_Root_block_list; + MY_FILE file_block_list; + U32 next_block_link; + + verbose ("calling: generate_BDepot ()"); + + next_block_link = 0xffffffffUL + header_blocks + 1; + /* + 1 because is the ___next link___ */ + + /* 1. generate sbfile block list */ + assert (next_block_link == sbfile_start_block + 1); + /* + 1 because is the ___next link___ */ + init_MY_FILE ((&file_block_list), block_list, sizeof (U32), NULL, BDepot->file.block_list); + /* the blocks that takes sbfile are in the first entry in BDepot */ + verboseU32 ((*(BDepot->file.block_list))); + test_call (write_block_list (next_block_link, &file_block_list, 1), int); + + /* update next_block_link */ + next_block_link += sbfile_blocks; + + /* 2. generate big streams block list */ + assert (next_block_link == sbfile_start_block + sbfile_blocks + 1); + /* + 1 because is the ___next link___ */ + init_MY_FILE ((&file_block_list), block_list, BDepot->size - 3 * sizeof (U32), NULL, BDepot->file.block_list + 3); + /* 3 because the first three entries in BDepot are sbfile, SDepot and Root */ + test_call (write_block_list (next_block_link, &file_block_list, 1), int); + + /* update next_block_link */ + next_block_link += sum_block_list (&file_block_list); + + /* 3. generate SDepot and Root block list */ + if (sbfile->size > 0) + /* if there are sbfile */ + assert (next_block_link == SDepot_start_block + 1); + /* + 1 because is the ___next link___ */ + init_MY_FILE ((&SDepot_and_Root_block_list), block_list, 2 * sizeof (U32), NULL, BDepot->file.block_list + 1); + /* + 1 because the first entry in BDepot is sbfile block */ + test_call (write_block_list (next_block_link, &SDepot_and_Root_block_list, 1), int); + + /* 4. finish */ + write_until_output_block_boundary (1); + + return 0; +} + +static int generate_real_file (MY_FILE * MY_FILE_file) +{ + FILE *file; + int n_read; + U8 * pps; + U32 total_bytes; + U32 sbfile_size; + static U32 last_small_stream_next_block = 0; + static int sbfile_start_block_set = 0; + static int sbfile_may_need_write_until_boundary = 0; + + verbose ("calling: generate_real_file ()"); + +/* FIXME MARK 3 */ + /* all seems to be working until here... I hope. Test is welcome! */ + + /*verboseU16 (sbfile_start_block_set);*/ + /*verboseU16 (sbfile_may_need_write_until_boundary);*/ + /*verboseU16 (pos_block);*/ + assert (pos_block <= 0x0200); + assert (pos_block % 0x40 == 0); + + /* open real file */ + assert (MY_FILE_file->file.real.name[0]); + file = fopen (MY_FILE_file->file.real.name, "rb"); + test_exitf (file != NULL, 11, dummy ()); + + /* write Root start_block's of this file */ + if (MY_FILE_file->size >= 0x1000) + { + /* generating big stream */ + + /* first, end writting sbfile, if any */ + if (sbfile_may_need_write_until_boundary) + { + /* this happens after all small strams have been generated but + before the first big stream is generated */ + write_until_output_block_boundary (1); + sbfile_may_need_write_until_boundary = 0; + } + /* then, continue with this big stream */ + + /* write start block of this stream in its Root pps */ + verboseU32 (next_block); + pps = Root->file.root_list + MY_FILE_file->file.real.ppsnumber * 0x80; + fil_swriteU32 (pps + 0x74, &next_block); + } + else + { + /* generating small stream */ + /* do nothing, start block of small streams was written + in proces_streams */ + + /* write start block of this stream in its Root pps */ + pps = Root->file.root_list + MY_FILE_file->file.real.ppsnumber * 0x80; + fil_swriteU32 (pps + 0x74, &last_small_stream_next_block); + last_small_stream_next_block += *(MY_FILE_file->blocks); /* small blocks */ + + /* write sbfile start block in root directory pps in Root, if not done */ + if (!sbfile_start_block_set) + { + /* this happens before generate the first small stream that makes sbfile */ + verbose ("generating sbfile"); + verbose ("SUPPOSING: first entry in Root is root entry"); + /* write start block of sbfile */ + assert (sbfile_start_block == next_block); + fil_swriteU32 (Root->file.root_list + 0x74, &next_block); + + sbfile_size = sum_blocks_MY_FILE_list (sbfile) * 0x40; + verboseU32 (sbfile_size); + /* compare calculated sbfile size with original */ + assert (sbfile_size == fil_sreadU32 (Root->file.root_list + 0x78)); + + sbfile_start_block_set = 1; + sbfile_may_need_write_until_boundary = 1; + } + } + + verboseS (MY_FILE_file->file.real.name); + total_bytes = 0; + /* copy real file to output_file */ + while (!feof (file)) + { + n_read = fread (output_block+pos_block, 1, 0x0200-pos_block, file); + test_exitf (!ferror (file), 11, dummy ()); + if (n_read < 0x0200-pos_block) + /* if it was readed less than it could be possible */ + assert (feof (file)); + pos_block += (U16)n_read; + total_bytes += n_read; + check_output_block_boundary (); + } + test_exitf (total_bytes == MY_FILE_file->size, 12, dummy()); + + if (MY_FILE_file->size >= 0x1000) + /* generating big stream */ + write_until_output_block_boundary (1) + else + /* generating small stream */ + write_until_output_block_small_boundary (1); + + /* close real file */ + fclose (file); + + return 0; +} + + +int +write_block_list (U32 start_count, MY_FILE * list, int write_end_chain) +{ + U32 *p; + U32 n; + U32 end_chain = 0xfffffffeUL; + U32 value_to_write; + U32 delta; + + verbose ("calling: write_block_list ()"); + + assert (list->type == block_list); /* Was (list->type = block_list) - SG */ + assert (pos_block <= 0x01fc); /* 0x01fc = 0x0200 - sizeof(U32) */ + + delta = start_count; + if (list->size == 0) return 0; /* we are done */ + for (p = list->file.block_list; + (U32)((U8 *) p - (U8 *) list->file.block_list) < list->size; p++) + { + for (n = 0; n < *p; n++) + { + /* this allow bbd_list runs over the block number 2 */ + check_output_block_boundary (); + + /* if it's the last block in chain */ + if (write_end_chain && !(n + 1 < *p)) + value_to_write = end_chain; + else + value_to_write = n + delta; + fil_swriteU32 (output_block + pos_block, &value_to_write); + pos_block += (U16)sizeof (U32); + assert (pos_block <= 0x0200); + } + delta += n; + } + check_output_block_boundary (); + + return 0; +} + +static int write_root_list (MY_FILE * list) +{ + U8 * p; + + verbose ("calling: write_root_list ()"); + + assert (list != NULL); + assert (pos_block == 0); + assert (list->type == root_list); + assert (list->size > 0); + + for (p = list->file.root_list; + (U32)(p - list->file.root_list) < list->size; p += 0x80) + { + memcpy (output_block+(p-list->file.root_list)%0x0200, p, 0x80); + /*verboseU8Array ((output_block+(p-list->file.root_list)%0x0200), 1, 0x80);*/ + verboseU32 (fil_sreadU32 (p + 0x74)); + +#ifdef VERBOSE + { + U32 written_start_block; + U32 file_size; + U8 * h; + written_start_block = fil_sreadU32 ( output_block+(p-list->file.root_list)%0x0200 + 0x74 ); + file_size = fil_sreadU32 ( output_block+(p-list->file.root_list)%0x0200 + 0x78 ); + for (h = output_block+(p-list->file.root_list)%0x0200; *h; h+=2) + if (isprint (*h)) + printf ("%c", *h); + else + printf ("\\0x%02x", *h); + printf (": "); + verboseU32 (written_start_block); + verboseU32 (file_size); + } +#endif + + pos_block += (U16)0x80; + assert (pos_block <= (U16)0x0200); + check_output_block_boundary (); + } + + return 0; +} + +static void ends (void) +{ +#ifdef VERBOSE + static int called; + verbose ("calling: ends ()"); + + if (called++) + verbose ("DANGER: ends called more than once"); +#endif + /* + sbfile + SDepot + BDepot + Root + Input + */ + if (output_file != NULL) + fclose (output_file); +} + +/* reviewed when done */ +static void calculate_blocks (void) +{ + MY_FILE big_streams_list; + + verbose ("calling: calculate_blocks ()"); + + /* preparing */ + init_MY_FILE ((&big_streams_list), MY_FILE_list, Input.size - 5 * sizeof (MY_FILE), + NULL, Input.file.MY_FILE_list + 5); + /* 5 because the first 5 entries in Input are for bbd_list, BDepot, Root, SDepot + and sbfile */ + + /* calculate sizes */ + assert (*(BDepot->blocks) == *(bbd_list->file.block_list)); + assert (*(Root->blocks) == size2blocks (Root->size, 0x0200)); + verboseU32 ((*(sbfile->blocks))); + verboseU32 ((size2blocks (sum_blocks_MY_FILE_list (sbfile) * 0x40, 0x0200))); + assert (*(sbfile->blocks) == size2blocks_preserve_zero ( + sum_blocks_MY_FILE_list (sbfile) * 0x40, 0x0200)); + assert (*(SDepot->blocks) == size2blocks_preserve_zero ( + (sum_block_list (SDepot) * sizeof (U32)), 0x0200)); + BDepot_blocks = *(BDepot->blocks); + SDepot_blocks = *(SDepot->blocks); + Root_blocks = *(Root->blocks); + sbfile_blocks = *(sbfile->blocks); + big_streams_blocks = sum_blocks_MY_FILE_list (&big_streams_list); + header_blocks = size2blocks ((19 + BDepot_blocks) * sizeof(U32), 0x0200); + /* 19 + because the first 19 U32 doesn't belong to BDepot_blocks, but to header */ + + /* calculate starting */ + sbfile_start_block = 0xffffffffUL + header_blocks; + /* if there are sbfile, should start in sbfile_start_block */ + Root_start_block = 0xffffffffUL + header_blocks + sbfile_blocks + + big_streams_blocks + SDepot_blocks; + /* 0xffffffffUL because first block is -1, second 0, third 1 and son on */ + if (SDepot_blocks > 0) + /* if there are small streams*/ + SDepot_start_block = 0xffffffffUL + header_blocks + sbfile_blocks + + big_streams_blocks; + else /* SDepot_blocks == 0 */ + /* if there are not small streams, neither sbfile, neither SDepot */ + SDepot_start_block = 0xfffffffeUL; + BDepot_start_block = 0xffffffffUL + header_blocks + sbfile_blocks + + big_streams_blocks + SDepot_blocks + Root_blocks; + + verboseU32 (header_blocks); + verboseU32 (big_streams_blocks); + verboseU32 (sbfile_blocks); + verboseU32 (SDepot_blocks); +} + + +#undef VERBOSE + + +/* You can use next lines to print some parts of Structure */ +/* +verboseU32Array (SDepot->file.block_list, SDepot->size / sizeof(U32)); +verboseU8Array (Root->file.root_list, Root->size / 0x80, 0x80); +verboseU32Array (BDepot->file.block_list, BDepot->size / sizeof (U32)); +verboseU32 (*(bbd_list->file.block_list)); +*/ + diff --git a/cole/oledecod.c b/cole/oledecod.c new file mode 100644 index 0000000..42d84f5 --- /dev/null +++ b/cole/oledecod.c @@ -0,0 +1,790 @@ +/* + OLEdecode - Decode Microsoft OLE files into its components. + Copyright (C) 1998, 1999 Andrew Scriven + + 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 + */ +/* + Released under GPL, written by + Andrew Scriven + + Copyright (C) 1998, 1999 + Andrew Scriven + */ +/* + ----------------------------------------------------------------------- + Andrew Scriven + Research and Engineering + Electron Building, Windmill Hill, Whitehill Way, Swindon, SN5 6PB, UK + Phone (44) 1793 896206, Fax (44) 1793 896251 + ----------------------------------------------------------------------- + */ +/* + *Extremely* modified by Arturo Tena + */ + +#include +#include +#include +#include +#include +#include +#include + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "cole.h" +#include "config.h" +#include /* for unlink() */ +#else +#include "cole.h.in" +#endif +/* FIXME: replace all VERBOSE with COLE_VERBOSE */ +#ifdef COLE_VERBOSE +#define VERBOSE +#else +#undef VERBOSE +#endif +#include "support.h" +#include "internal.h" + + +#define ENTRYCHUNK 20 /* number of entries in root_list and sbd_list + will be added each time. must be at least 1 */ + +#define MIN(a,b) ((a)<(b) ? (a) : (b)) + + + /* reorder pps tree, from tree structure to a linear one, + and write the level numbers, returns zero if OLE format fails, + returns no zero if success */ +static int reorder_pps_tree (pps_entry * root_pps, U16 level); + /* free memory used (except the pps tree) */ +static void ends (void); + /* close and remove files in the tree */ +/* closeOLEtreefiles --- outdated because not to generate the + real files by now --- cole 2.0.0 */ +/* + static void closeOLEtreefiles (pps_entry * tree, U32 root); + */ +/* + Verbose pps tree. + Input: pps_list: stream list. + root_pps: root pps. + level: how much levels will be extracted. + Output: none. + */ +static void verbosePPSTree (pps_entry * pps_list, U32 root_pps, int level); + + +static FILE *input; +static U8 *Block; +static U8 *Blockx; +static U8 *BDepot, *SDepot, *Root; +static pps_entry *pps_list; +static U32 num_of_pps; +static FILE *sbfile; +/* sbfilename is stored in *_sbfilename instead -- cole 2.0.0 */ +/* static char sbfilename[L_tmpnam]; */ +static U32 *sbd_list; +static U32 *root_list; + + +int __OLEdecode (char *OLEfilename, pps_entry ** stream_list, U32 * root, + U8 **_BDepot, U8 **_SDepot, FILE **_sbfile, char **_sbfilename, + FILE **_input, + U16 max_level) +{ + int c; + U32 num_bbd_blocks; + U32 num_xbbd_blocks; + U32 bl; + U32 i, j, len; + U8 *s, *p, *t; + long FilePos; + /* FilePos is long, not U32, because second argument of fseek is long */ + + /* initialize static variables */ + input = sbfile = NULL; + Block = Blockx = BDepot = SDepot = Root = NULL; + pps_list = NULL; + num_of_pps = 0; +/* sbfilename is stored in *_sbfilename instead -- cole 2.0.0 */ +/* sbfilename[0] = 0; */ + root_list = sbd_list = NULL; + /* initalize return parameters */ + *stream_list = NULL; + + /* open input file */ + verbose ("open input file"); + input = fopen (OLEfilename, "rb"); + test_exitf (input != NULL, 4, ends ()); + *_input = input; + + /* fast check type of file */ + verbose ("fast testing type of file"); + test_exitf ((c = getc (input)) != EOF, 5, ends ()); + test_exitf (ungetc (c, input) != EOF, 5, ends ()); +/* test_exitf (!isprint (c), 8, ends ()); OpenBSD suggestion to comment this out */ + test_exitf (c == 0xd0, 9, ends ()); + + /* read header block */ + verbose ("read header block"); + Block = (U8 *) malloc (0x0200); + test_exitf (Block != NULL, 10, ends ()); + fread (Block, 0x0200, 1, input); + test_exitf (!ferror (input), 5, ends ()); + + /* really check type of file */ + rewind (input); + verbose ("testing type of file"); + test_exitf (fil_sreadU32 (Block) != 0xd0cf11e0UL, 9, ends ()); + test_exitf (fil_sreadU32 (Block + 0x04) != 0xa1b11ae1UL, 9, ends ()); + + + /* read big block depot */ + verbose ("read big block depot (bbd)"); + num_bbd_blocks = fil_sreadU32 (Block + 0x2c); + num_xbbd_blocks = fil_sreadU32 (Block + 0x48); + verboseU32 (num_bbd_blocks); + verboseU32 (num_xbbd_blocks); + BDepot = (U8 *) malloc (0x0200 * (num_bbd_blocks + num_xbbd_blocks)); + test_exitf (BDepot != NULL, 10, ends ()); + *_BDepot = BDepot; + s = BDepot; + assert (num_bbd_blocks <= (0x0200 / 4 - 1) * num_xbbd_blocks + + (0x0200 / 4) - 19); + /* the first 19 U32 in header does not belong to bbd_list */ + for (i = 0; i < MIN (num_bbd_blocks, 0x0200 / 4 - 19); i++) + { + /* note: next line may be needed to be cast to long in right side */ + FilePos = 0x0200 * (1 + fil_sreadU32 (Block + 0x4c + (i * 4))); + assert (FilePos >= 0); + test_exitf (!fseek (input, FilePos, SEEK_SET), 5, ends ()); + fread (s, 0x0200, 1, input); + test_exitf (!ferror (input), 5, ends ()); + s += 0x0200; + } + + Blockx = (U8 *) malloc (0x0200); + test_exitf (Blockx != NULL, 10, ends ()); + bl = fil_sreadU32 (Block + 0x44); + for (i = 0; i < num_xbbd_blocks; i++) + { + FilePos = 0x0200 * (1 + bl); + assert (FilePos >= 0); + test_exitf (!fseek (input, FilePos, SEEK_SET), 5, ends ()); + fread (Blockx, 0x0200, 1, input); + test_exitf (!ferror (input), 5, ends ()); + + for (j=0; j < 0x0200 / 4 - 1;j++) + /* last U32 is for the next bl */ + { + if (fil_sreadU32 (Blockx + (j * 4)) == 0xfffffffeUL || + fil_sreadU32 (Blockx + (j * 4)) == 0xfffffffdUL || + fil_sreadU32 (Blockx + (j * 4)) == 0xffffffffUL) + break; + /* note: next line may be needed to be cast to long in right side */ + FilePos = 0x0200 * (1 + fil_sreadU32 (Blockx + (j * 4))); + assert (FilePos >= 0); + test_exitf (!fseek (input, FilePos, SEEK_SET), 5, ends ()); + fread (s, 0x0200, 1, input); + test_exitf (!ferror (input), 5, ends ()); + s += 0x0200; + } + + bl = fil_sreadU32 (Blockx + 0x0200 - 4); + } + verboseU8Array (BDepot, (num_bbd_blocks+num_xbbd_blocks), 0x0200); + + + /* extract the sbd block list */ + verbose ("extract small block depot (sbd) block list"); + sbd_list = (U32 *) malloc (ENTRYCHUNK * 4); + test_exitf (sbd_list != NULL, 10, ends ()); + sbd_list[0] = fil_sreadU32 (Block + 0x3c); + /* -2 signed long int == 0xfffffffe unsinged long int */ + for (len = 1; sbd_list[len - 1] != 0xfffffffeUL; len++) + { + test_exitf (len != 0, 5, ends ()); /* means file is too big */ + /* if memory allocated in sbd_list is all used, allocate more memory */ + if (!(len % ENTRYCHUNK)) + { + U32 *newspace; + newspace = realloc (sbd_list, + (1 + len / ENTRYCHUNK) * ENTRYCHUNK * 4); + test_exitf (newspace != NULL, 10, ends ()); + sbd_list = newspace; + } + sbd_list[len] = fil_sreadU32 (BDepot + (sbd_list[len - 1] * 4)); + /*verboseU32 (len);*/ + /*verboseU32 (sbd_list[0]);*/ + /*verboseU32 (sbd_list[1]);*/ + if (sbd_list[len] != 0xfffffffeUL) + test_exitf (sbd_list[len] <= num_bbd_blocks * 0x0200 - 4, 5, ends ()); + test_exitf (sbd_list[len] != 0xfffffffdUL && + sbd_list[len] != 0xffffffffUL, + 5, ends ()); + } + len--; + verboseU32Array (sbd_list, len+1); + /* read in small block depot, if there's any small block */ + if (len == 0) + { + SDepot = NULL; + verbose ("not read small block depot (sbd): there's no small blocks"); + } + else + { + verbose ("read small block depot (sbd)"); + SDepot = (U8 *) malloc (0x0200 * len); + test_exitf (SDepot != NULL, 10, ends ()); + s = SDepot; + for (i = 0; i < len; i++) + { + FilePos = 0x0200 * (1 + sbd_list[i]); + assert (FilePos >= 0); + test_exitf (!fseek (input, FilePos, SEEK_SET), 5, ends ()); + fread (s, 0x0200, 1, input); + test_exitf (!ferror (input), 5, ends ()); + s += 0x200; + } + verboseU8Array (SDepot, len, 0x0200); + } + *_SDepot = SDepot; + + /* extract the root block list */ + verbose ("extract root block depot (root) block list"); + root_list = (U32 *) malloc (ENTRYCHUNK * 4); + test_exitf (root_list != NULL, 10, ends ()); + root_list[0] = fil_sreadU32 (Block + 0x30); + for (len = 1; root_list[len - 1] != 0xfffffffeUL; len++) + { + test_exitf (len != 0, 5, ends ()); /* means file is too long */ + /* if memory allocated in root_list is all used, allocate more memory */ + if (!(len % ENTRYCHUNK)) + { + U32 *newspace; + newspace = realloc (root_list, + (1 + len / ENTRYCHUNK) * ENTRYCHUNK * 4); + test_exitf (newspace != NULL, 10, ends ()); + root_list = newspace; + } + root_list[len] = fil_sreadU32 (BDepot + (root_list[len - 1] * 4)); + test_exitf (root_list[len] != 0xfffffffdUL && root_list[len] != + 0xffffffffUL, 5, ends ()); + } + len--; + verboseU32Array (root_list, len+1); + /* read in root block depot */ + verbose ("read in root block depot (Root)"); + Root = (U8 *) malloc (0x0200 * len); + test_exitf (Root != NULL, 10, ends ()); + s = Root; + for (i = 0; i < len; i++) + { + FilePos = 0x0200 * (root_list[i] + 1); + assert (FilePos >= 0); + test_exitf (!fseek (input, FilePos, SEEK_SET), 5, ends ()); + fread (s, 0x0200, 1, input); + test_exitf (!ferror (input), 5, ends ()); + s += 0x200; + } + verboseU8Array (Root, len, 0x0200); + + + /* assign space for pps list */ + verbose ("read pps list"); + num_of_pps = len * 4; /* each sbd block have 4 pps */ + *stream_list = pps_list = (pps_entry *)malloc(num_of_pps*sizeof(pps_entry)); + test_exitf (pps_list != NULL, 10, ends ()); + /* read pss entry details and look out for "Root Entry" */ + verbose ("read pps entry details"); + for (i = 0; i < num_of_pps; i++) + { + U16 size_of_name; + + s = Root + (i * 0x80); + + /* read the number */ + pps_list[i].ppsnumber = i; + + /* read the name */ + size_of_name = (U16)MIN (0x40, fil_sreadU16 (s + 0x40)); + pps_list[i].name[0] = 0; + if (size_of_name == 0) + continue; + for (p = (U8 *) pps_list[i].name, t = s; + t < s + size_of_name; t++) + *p++ = *t++; + /* makes visible the non printable first character */ + /* if (!isprint (pps_list[i].name[0]) && pps_list[i].name[0]) + pps_list[i].name[0] += 'a'; */ + + /* read the pps type */ + pps_list[i].type = *(s + 0x42); + if (pps_list[i].type == 5) + { + assert (i == 0); + *root = i; /* this pps is the root */ + } + + /* read the others fields */ + pps_list[i].previous = fil_sreadU32 (s + 0x44); + pps_list[i].next = fil_sreadU32 (s + 0x48); + pps_list[i].dir = fil_sreadU32 (s + 0x4c); + pps_list[i].start = fil_sreadU32 (s + 0x74); + pps_list[i].size = fil_sreadU32 (s + 0x78); + pps_list[i].seconds1 = fil_sreadU32 (s + 0x64); + pps_list[i].seconds2 = fil_sreadU32 (s + 0x6c); + pps_list[i].days1 = fil_sreadU32 (s + 0x68); + pps_list[i].days2 = fil_sreadU32 (s + 0x70); + } + + /* NEXT IS VERBOSE verbose */ +#ifdef VERBOSE + { + U32 i; + printf ("before reorder pps tree\n"); + printf ("pps type prev next dir start level size name\n"); + for (i = 0; i < num_of_pps; i++) + { + if (!pps_list[i].name[0]) + { + printf (" -\n"); + continue; + } + printf ("%08lx ", pps_list[i].ppsnumber); + printf ("%d ", pps_list[i].type); + printf ("%08lx ", pps_list[i].previous); + printf ("%08lx ", pps_list[i].next); + printf ("%08lx ", pps_list[i].dir); + printf ("%08lx ", pps_list[i].start); + printf ("%04x ", pps_list[i].level); + printf ("%08lx ", pps_list[i].size); + printf ("'%c", !isprint (pps_list[i].name[0]) ? ' ' : pps_list[i].name[0]); + printf ("%s'\n", pps_list[i].name+1); + } + } +#endif + + /* go through the tree made with pps entries, and reorder it so only the + next link is used (move the previous-link-children to the last visited + next-link-children) */ + test_exitf (reorder_pps_tree (&pps_list[*root], 0), 9, ends ()); + + /* NEXT IS VERBOSE verbose */ +#ifdef VERBOSE + { + U32 i; + printf ("after reorder pps tree\n"); + printf ("pps type prev next dir start level size name\n"); + for (i = 0; i < num_of_pps; i++) + { + if (!pps_list[i].name[0]) + { + printf (" -\n"); + continue; + } + printf ("%08lx ", pps_list[i].ppsnumber); + printf ("%d ", pps_list[i].type); + printf ("%08lx ", pps_list[i].previous); + printf ("%08lx ", pps_list[i].next); + printf ("%08lx ", pps_list[i].dir); + printf ("%08lx ", pps_list[i].start); + printf ("%04x ", pps_list[i].level); + printf ("%08lx ", pps_list[i].size); + printf ("'%c", !isprint (pps_list[i].name[0]) ? ' ' : pps_list[i].name[0]); + printf ("%s\n", pps_list[i].name+1); + } + } + + /* NEXT IS VERBOSE verbose */ + verbosePPSTree (pps_list, *root, 0); +#endif + + + /* generates pps real files */ + /* NOTE: by this moment, the pps tree, + wich is made with pps_list entries, is reordered */ + verbose ("create pps files"); + { + U8 *Depot; + FILE *OLEfile, *infile; + U16 BlockSize, Offset; + size_t bytes_to_read; + U32 pps_size, pps_start; + + assert (num_of_pps >= 1); + /* i < 1 --- before i < num_of_pps --- changed so not to generate the + real files by now --- cole 2.0.0 */ + /* may be later we can rewrite this code in order to only extract the + sbfile, may be using __cole_extract_file call to avoid duplicated + code --- cole 2.0.0 */ + for (i = 0; i < 1; i++) + { + pps_list[i].filename[0] = 0; + + /* storage pps and non-valid-pps (except root) does not need files */ + /* because FlashPix file format have a root of type 5 but with no name, + we must to check if the non-valid-pps is root */ + if (pps_list[i].type == 1 + || (!pps_list[i].name[0] && pps_list[i].type != 5)) + continue; + /* pps that have level > max_level will not be extracted */ + if (max_level != 0 && pps_list[i].level > max_level) + continue; + + pps_size = pps_list[i].size; + pps_start = pps_list[i].start; +/* FIXME MARK 2 */ + /* How we get sure pps_start doesn't point to a block bigger than the + real file (input of sbfile) have? */ + + /* create the new file */ + if (pps_list[i].type == 5) + /* root entry, sbfile must be generated */ + { + if (SDepot == NULL) { + /* if there are not small blocks, not generate sbfile */ + *_sbfilename = NULL; + *_sbfile = NULL; + break; + } + assert (i == *root); + assert (i == 0); + /* tmpnam (sbfile) and next calls --- commented out so not to + generate the real files by now --- sbfilename is stored in + *_sbfilename instead --- cole 2.0.0 + */ + /* + tmpnam (sbfilename); + test_exitf (sbfilename[0], 7, ends ()); + sbfile = OLEfile = fopen (sbfilename, "wb+"); + test_exitf (OLEfile != NULL, 7, ends ()); + verboseS (sbfilename); + */ +#if defined( __WIN32__ ) || defined( __BORLANDC__ ) + *_sbfilename = (U8 *)malloc (TMPNAM_LEN); + test_exitf (*_sbfilename != NULL, 10, ends ()); + tmpnam (*_sbfilename); + test_exitf (*_sbfilename[0], 7, ends ()); + sbfile = OLEfile = fopen (*_sbfilename, "w+b"); +#else + { + int ret; + + *_sbfilename = (U8 *)malloc (TMPNAM_LEN); + test_exitf (*_sbfilename != NULL, 10, ends ()); + + strcpy(*_sbfilename, "/tmp/xlHtmlXXXXXX"); + ret = mkstemp(*_sbfilename); + if (ret == -1) { + free(*_sbfilename); + test_exitf (ret == -1, 7, ends ()); + } + + sbfile = OLEfile = fdopen(ret, "w+b"); + /* unlink() is called so this file deletes when we are done with it */ + unlink(*_sbfilename); + } +#endif + *_sbfile = sbfile; + test_exitf (OLEfile != NULL, 7, ends ()); + verboseS (*_sbfilename); + } + else + /* other entry, save in a file */ + { + /* this branch is never executed now */ +#if defined( __WIN32__ ) || defined( __BORLANDC__ ) + tmpnam (pps_list[i].filename); + test_exitf (pps_list[i].filename[0], 7, ends ()); + verbose(pps_list[i].name + (!isprint(pps_list[i].name[0]) ? 1 : 0)); + OLEfile = fopen (pps_list[i].filename, "wb"); +#else + int ret; + + strcpy(pps_list[i].filename, "/tmp/xlHtmlXXXXXX"); + ret = mkstemp(pps_list[i].filename); + test_exitf (ret == -1, 7, ends ()); + OLEfile = fdopen(ret, "wb"); +#endif + test_exitf (OLEfile != NULL, 7, ends ()); + verbose (pps_list[i].filename); + } + + if (pps_size >= 0x1000 /*is in bbd */ || + OLEfile == sbfile /*is root */ ) + { + /* read from big block depot */ + Offset = 1; + BlockSize = 0x0200; + assert (input != NULL); + assert (BDepot != NULL); + infile = input; + Depot = BDepot; + } + else + { + /* read from small block file */ + Offset = 0; + BlockSize = 0x40; + assert (sbfile != NULL); + assert (SDepot != NULL); + infile = sbfile; + Depot = SDepot; + } + + /* -2 signed long int == 0xfffffffe unsinged long int */ + while (pps_start != 0xfffffffeUL) + { +#ifdef VERBOSE + printf ("reading pps %08lx block %08lx from %s\n", + pps_list[i].ppsnumber, pps_start, + Depot == BDepot ? "big block depot" : "small block depot"); +#endif + FilePos = (pps_start + Offset) * BlockSize; + assert (FilePos >= 0); + bytes_to_read = MIN ((U32)BlockSize, pps_size); + fseek (infile, FilePos, SEEK_SET); + fread (Block, bytes_to_read, 1, infile); + test_exitf (!ferror (infile), 5, ends ()); + fwrite (Block, bytes_to_read, 1, OLEfile); + test_exitf (!ferror (infile), 5, ends ()); + pps_start = fil_sreadU32 (Depot + (pps_start * 4)); + pps_size -= MIN ((U32)BlockSize, pps_size); + if (pps_size == 0) + pps_start = 0xfffffffeUL; + } + if (OLEfile == sbfile) + /* if small block file generated */ + rewind (OLEfile); /* rewind because we will read it later */ + /*else if (!fclose (OLEfile))*/ /* close the pps file */ + /* don't know what to do here */ + /*;*/ + } + /* if (sbfile != NULL) --- commented out so conservate sbfile + open --- cole 2.0.0 */ + /* + if (sbfile != NULL) + { + fclose (sbfile); + if (!remove (sbfilename)) ; + sbfile = NULL; + } + */ + } + ends (); + return 0; +} + + +/* reorder pps tree and write levels */ +/* not sure if it is safe declare last_next_link_visited + inside reorder_pps_tree function */ +static U32 *last_next_link_visited; +static int reorder_pps_tree (pps_entry * node, U16 level) +{ + /* NOTE: in next, previous and dir link, + 0xffffffff means point to nowhere (NULL) */ + + node->level = level; + + /* reorder subtrees, if there's any */ + if (node->dir != 0xffffffffUL) + { + if (node->dir > num_of_pps || !pps_list[node->dir].name[0]) + return 0; + else if (!reorder_pps_tree (&pps_list[node->dir], (U16)(level + 1))) + return 0; + } + + /* reorder next-link subtree, saving the most next link visited */ + if (node->next != 0xffffffffUL) + { + if (node->next > num_of_pps || !pps_list[node->next].name[0]) + return 0; + else if (!reorder_pps_tree (&pps_list[node->next], level)) + return 0; + } + else + last_next_link_visited = &node->next; + + /* move the prev child to the next link and reorder it, if there's any */ + if (node->previous != 0xffffffffUL) + { + if (node->previous > num_of_pps || !pps_list[node->previous].name[0]) + return 0; + else + { + *last_next_link_visited = node->previous; + node->previous = 0xffffffffUL; + if (!reorder_pps_tree (&pps_list[*last_next_link_visited], level)) + return 0; + } + } + return 1; +} + + +/* verbose pps tree */ +static void verbosePPSTree (pps_entry * pps_list, U32 start_entry, int level) +{ + U32 entry; + int i; +#if __GNUC__ == 2 +static char cff[] = "cole235711"; +#define nextff(var) static void * nextff_var = (&nextff_var); \ +nextff_var=&var; +nextff (cff); +#endif + + + for (entry = start_entry; entry != 0xffffffffUL; entry = pps_list[entry].next) + { + if (pps_list[entry].type == 2) + { + for (i = 0; i < level * 3; i++) + printf (" "); + printf ("FILE %02lx %8ld '%c%s'\n", pps_list[entry].ppsnumber, + pps_list[entry].size, !isprint((int)pps_list[entry].name[0]) ? ' ' : pps_list[entry].name[0], pps_list[entry].name+1); + } + else + { + for (i = 0; i < level * 3; i++) + printf (" "); + printf ("DIR %02lx '%c%s'\n", pps_list[entry].ppsnumber, + !isprint((int)pps_list[entry].name[0]) ? ' ' : pps_list[entry].name[0], pps_list[entry].name+1); + verbosePPSTree (pps_list, pps_list[entry].dir, level + 1); + } + } +} + + +/* closeOLEtreefiles --- outdated because not to generate the + real files by now --- cole 2.0.0 */ +/* +#define freeNoNULL(x) { if ((x) != NULL) free (x); } +static int errorClosingTreeFiles; +void +closeOLEtreefiles (pps_entry * tree, U32 root) +{ +#ifdef VERBOSE + printf ("Visiting entry 0x%08lx to erase file\n", + tree[root].ppsnumber); +#endif + if (tree[root].previous != 0xffffffffUL) + closeOLEtreefiles (tree, tree[root].previous); + if (tree[root].next != 0xffffffffUL) + closeOLEtreefiles (tree, tree[root].next); + if (tree[root].type != 2 && tree[root].dir != 0xffffffffUL) + { +#ifdef VERBOSE + printf ("Going down to directory 0x%08lx to erase files\n", + tree[root].dir); +#endif + closeOLEtreefiles (tree, tree[root].dir); + } + else if (tree[root].type == 2) + if (!remove (tree[root].filename)) + { +#ifdef VERBOSE + printf ("Success removing %s\n", tree[root].filename); +#endif + } + else + { +#ifdef VERBOSE + printf ("Failed to remove %s\n", tree[root].filename); +#endif + errorClosingTreeFiles = 1; + } +} +*/ + +/* freeOLEtree is now useless: it only free tree -- cole 2.0.0 */ +/* + Free all the memory allocated in the tree. + Output: 0 = Sucess. + . 6 = Error removing some temporal stream files. + */ +/* +int freeOLEtree (pps_entry * tree); +*/ +/* +int +freeOLEtree (pps_entry * tree) +{ +*/ + /* errorCloseingTreeFiles --- doesn't exists because closeOLEtreefiles + was outdated because not to generate the real files by + now --- cole 2.0.0 */ + /* + errorClosingTreeFiles = 0; + */ +/* + if (tree != NULL) + { +*/ + /* closeOLEtreefiles --- outdated because not to generate the + real files by now --- cole 2.0.0 */ + /* + closeOLEtreefiles (tree, 0); + */ +/* + free (tree); + } + */ + /* errorCloseingTreeFiles --- doesn't exists because closeOLEtreefiles + was outdated because not to generate the real files by + now --- cole 2.0.0 */ + /*return*/ /* errorClosingTreeFiles ? 6 : */ /*0;*/ +/*}*/ + + +/* free memory used (except the pps tree) */ +#define freeNoNULL(x) { if ((x) != NULL) free (x); } +static void ends (void) +{ + /* if (input != NULL) and next lines --- commented out so conservate input + file open --- cole 2.0.0 */ + /* + if (input != NULL) + fclose (input); + */ + freeNoNULL (Block); + freeNoNULL (Blockx); + /* freeNoNULL (BDepot) and next line --- commented out so conservate + depots --- cole 2.0.0 */ + /* + freeNoNULL (BDepot); + freeNoNULL (SDepot); + */ + freeNoNULL (Root); + freeNoNULL (sbd_list); + freeNoNULL (root_list); + /* if (sbfile != NULL) and next lines --- commented out so conservate sbfile + open --- cole 2.0.0 */ + /* + if (sbfile != NULL) + { + fclose (sbfile); + if (!remove (sbfilename)) ; + } + */ +} + +#undef VERBOSE + diff --git a/cole/support.c b/cole/support.c new file mode 100644 index 0000000..b5795d2 --- /dev/null +++ b/cole/support.c @@ -0,0 +1,169 @@ +/* + Support - Provides some big and little endian abstraction functions, + besides another things. + Copyright (C) 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ +/* + Some code was from Caolan, but I have replaced all the code, + now all code here is mine, so I changed copyright announce in cole-1.0.0. + Arturo Tena + */ + + + +#include "support.h" + + +U16 +fil_sreadU16 (U8 * in) +{ +#ifdef WORDS_BIGENDIAN + U16 ret; + *( (U8*)(&ret) ) = *(in+1); + *( ((U8*)(&ret)) + 1 ) = *in; + return ret; +#else /* !WORDS_BIGENDIAN */ + return *((U16 *)in); +#endif +} + + +U32 +fil_sreadU32 (U8 * in) +{ +#ifdef WORDS_BIGENDIAN + U32 ret; + *( ((U8*)(&ret)) + 3 ) = *in; + *( ((U8*)(&ret)) + 2 ) = *(in+1); + *( ((U8*)(&ret)) + 1 ) = *(in+2); + *( (U8*)(&ret) ) = *(in+3); + return ret; +#else /* !WORDS_BIGENDIAN */ + return *((U32 *)in); +#endif +} + + +F64 +fil_sreadF64 (U8 * in) +{ +#ifdef WORDS_BIGENDIAN + F64 ret; + *( ((U8*)(&ret)) + 7 ) = *in; + *( ((U8*)(&ret)) + 6 ) = *(in+1); + *( ((U8*)(&ret)) + 5 ) = *(in+2); + *( ((U8*)(&ret)) + 4 ) = *(in+3); + *( ((U8*)(&ret)) + 3 ) = *(in+4); + *( ((U8*)(&ret)) + 2 ) = *(in+5); + *( ((U8*)(&ret)) + 1 ) = *(in+6); + *( (U8*)(&ret) ) = *(in+7); + return ret; +#else /* !WORDS_BIGENDIAN */ + return *((F64 *)in); +#endif +} + + +void +fil_swriteU16 (U8 * dest, U16 * src) +{ +#ifdef WORDS_BIGENDIAN + *(dest) = *(((U8*)src)+1); + *(dest+1) = *((U8*)src); +#else /* !WORDS_BIGENDIAN */ + *(dest) = *((U8*)src); + *(dest+1) = *(((U8*)src)+1); +#endif +} + + +void +fil_swriteU32 (U8 * dest, U32 * src) +{ +#ifdef WORDS_BIGENDIAN + fil_swriteU16 (dest, ( U16* )( ((U8*)src)+2 ) ); + fil_swriteU16 (dest+2, (U16*)src); +#else /* !WORDS_BIGENDIAN */ + fil_swriteU16 (dest, (U16*)src); + fil_swriteU16 (dest+2, ( U16* )( ((U8*)src)+2 ) ); +#endif +} + + +/*-* + @func (void) __cole_dump dump the content of memory + @param (void *) m memory position which content will be dumped + @param (void *) start memory position from where calculate + offset + @param (int) length size in bytes of the dumped memory + @param (char *) msg optional message, can be NULL + *-*/ +void +__cole_dump (void *_m, void *_start, int length, char *msg) +{ + unsigned char * pm; + char buff[18]; + long achar; + unsigned char * m; + unsigned char * start; + + if (_m == NULL) { + printf ("VERBOSE: can't dump because m is NULL\n"); + return; + } + if (_start == NULL) { + printf ("VERBOSE: can't dump because start is NULL\n"); + return; + } + + m = (unsigned char *)_m; + start = (unsigned char *)_start; + buff[8] = '-'; + buff[17] = 0; + if (msg != NULL) + printf ("VERBOSE: %s (from 0x%08x length 0x%08x (%d)):\n", + msg, m - start, length, length); + for (pm = m; pm - m < length; pm++) { + achar = (pm - m) % 16; + /* print offset */ + if (achar == 0) + printf ("%08x ", (pm - m) + (m - start)); + /* write char in the right column buffer */ + buff[achar + (achar < 8 ? 0 : 1)] = (char)((isprint (*pm) ? *pm : '.')); + /* print next char */ + if (! ((pm - m + 1) % 16)) + /* print right column */ + printf ("%02x %s\n", *pm, buff); + else if (! ((pm - m + 1) % 8)) + printf ("%02x-", *pm); + else + printf ("%02x ", *pm); + } + achar = (pm - m) % 16; + if (achar) { + int i; + for (i = 0; i < (16 - achar) * 3 - 1; i++) + printf (" "); + if (achar != 8) + buff [achar] = 0; + printf (" %s\n", buff); + } +} + diff --git a/cole/support.h b/cole/support.h new file mode 100644 index 0000000..2f7b113 --- /dev/null +++ b/cole/support.h @@ -0,0 +1,259 @@ +/* + Support - Provides some big and little endian abstraction functions. + Copyright (C) 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ +/* + Some code was from Caolan, but I have replaced all the code, + now all code here is mine, so I changed copyright announce in cole-1.0.0. + Arturo Tena + */ + + +#ifndef COLE_SUPPORT_H +#define COLE_SUPPORT_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#include +#include + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "config.h" + + +/* F32 */ +#if SIZEOF_FLOAT == 4 +#define F32 float +#elif SIZEOF_DOUBLE == 4 +#define F32 double +#elif SIZEOF_LONG_DOUBLE == 4 +#define F32 long double +#else +#error No 4 byte length float type found. +#endif + +/* F64 */ +#if SIZEOF_DOUBLE == 8 +#define F64 double +#elif SIZEOF_LONG_DOUBLE == 8 +#define F64 long double +#else +#error No 8 byte length float type found. +#endif + +/* U8 */ +#if SIZEOF_UNSIGNED_CHAR == 1 +#define U8 unsigned char +#else +#error No 1 byte length type found. +#error Char is not a byte! Mmmh... maybe you need another compiler. +#endif + +/* U16 */ +#if SIZEOF_UNSIGNED_INT == 2 +#define U16 unsigned int +#elif SIZEOF_UNSIGNED_SHORT == 2 +#define U16 unsigned short +#elif SIZEOF_UNSIGNED_LONG == 2 +#define U16 unsigned long +#else +#error No 2 byte length type found. +#endif + +/* S16 */ +#if SIZEOF_UNSIGNED_INT == 2 +#define S16 signed int +#elif SIZEOF_UNSIGNED_SHORT == 2 +#define S16 signed short +#elif SIZEOF_UNSIGNED_LONG == 2 +#define S16 signed long +#else +#error No 2 byte length type found. +#endif + + +/* U32 */ +#if SIZEOF_UNSIGNED_LONG == 4 +#define U32 unsigned long +#elif SIZEOF_UNSIGNED_INT == 4 +#define U32 unsigned int +#elif SIZEOF_UNSIGNED_LONG_LONG == 4 +#define U32 unsigned long long +#else +#error No 4 byte length type found. +#endif + +/* S32 */ +#if SIZEOF_UNSIGNED_LONG == 4 +#define S32 signed long +#elif SIZEOF_UNSIGNED_INT == 4 +#define S32 signed int +#elif SIZEOF_UNSIGNED_LONG_LONG == 4 +#define S32 signed long long +#else +#error No 4 byte length type found. +#endif + +#else + +/* Borland or Wintel constants */ +#define F32 float +#define F64 double +#define U8 unsigned char +#define U16 unsigned short +#define S16 signed short +#define U32 unsigned long +#define S32 signed long + +#endif + +U16 fil_sreadU16 (U8 * in); +U32 fil_sreadU32 (U8 * in); +F64 fil_sreadF64 (U8 * in); + +void fil_swriteU16 (U8 * dest, U16 * src); +void fil_swriteU32 (U8 * dest, U32 * src); + +void __cole_dump (void *_m, void *_start, int length, char *msg); + +#define verbose_return() \ + { \ + verbose_wonl ("returning from "); \ + verbose_wonl (__FILE__); \ + verbose_wonl (":"); \ + verbose_d (__LINE__); \ + } + +#define test(t,retval) \ + { \ + if (!(t)) \ + { \ + verbose_return (); \ + return retval; \ + } \ + } +#define test_exitf(t,retval,func) \ + { \ + if (!(t)) \ + { \ + func; \ + verbose_return (); \ + return (retval); \ + } \ + } +#define test_call(t,typeretval) \ + { \ + typeretval retval; \ + retval = (t); \ + if (retval) \ + { \ + verbose_return () \ + return (retval); \ + } \ + } +#define test_call_exitf(t,typeretval,func) \ + { \ + typeretval retval; \ + retval = (t); \ + if (retval) \ + { \ + func; \ + verbose_return () \ + return (retval); \ + } \ + } +#define report_bug(prog) \ + { \ + fprintf (stderr, #prog": A bug have been found: %s:%d\n"#prog \ + ":Please, download a most recent version and try again\n", \ + __FILE__, __LINE__); \ + } +#define assert_return(prog,t,retval) \ + { \ + if (!(t)) \ + { \ + fprintf (stderr, #prog": Condition "#t" is not valid: %s:%d\n", \ + __FILE__, __LINE__); \ + report_bug (prog); \ + return (retval); \ + } \ + } + + +#ifdef VERBOSE + +#define verbose_d(n) { printf ("%d\n", n); } +#define verbose(s) { puts(s); } +#define verbose_wonl(s) { printf (s); } +#define verboseU8(expr) { printf (#expr " = 0x%02x\n", expr); } +#define verboseU16(expr) { printf (#expr " = 0x%04x\n", expr); } +#define verboseU32(expr) { printf (#expr " = 0x%08x\n", expr); } +#define verboseS(expr) { printf (#expr " = %s\n", expr); } +#define verboseS_wonl(expr) { printf (#expr " = %s", expr); } +#define warning(t) { if (!(t)) printf ("warning: %s is false\n", #t); } + +#else /* ifndef VERBOSE */ + +#define verbose_d(n) ; +#define verbose(s) ; +#define verbose_wonl(s) ; +#define verboseU8(expr) ; +#define verboseU16(expr) ; +#define verboseU32(expr) ; +#define verboseS(expr) +#define verboseS_wonl(expr) +#define warning(t) + +#endif /* ifdef VERBOSE */ + + +#ifdef VERBOSE +#define verboseU32Array(array,len) \ + { \ + U32 temp; \ + for (temp = 0; temp < len; temp++) \ + printf (#array "[%lu] = 0x%08lx\n", temp, array [temp]); \ + } +#else +#define verboseU32Array(array,len) +#endif + + +#define verboseU8Array_force(rec,len,reclen) \ + __cole_dump ((rec), (rec), ((len)*(reclen)), ""); + + +#ifdef VERBOSE +#define verboseU8Array(rec,len,reclen) verboseU8Array_force(rec,len,reclen) +#else +#define verboseU8Array(rec,len,reclen) +#endif + + + +#ifdef __cplusplus +} +#endif + +#endif /* COLE_SUPPORT_H */ + diff --git a/cole/utils/Makefile.am b/cole/utils/Makefile.am new file mode 100644 index 0000000..8256dab --- /dev/null +++ b/cole/utils/Makefile.am @@ -0,0 +1,7 @@ +## Process this file with automake to produce Makefile.in + +INCLUDES = -I$(top_srcdir) +LDADD = $(top_builddir)/libcole.la + +noinst_PROGRAMS = cole_tree cole_isfs cole_isfs_fast cole_extract + diff --git a/cole/utils/Makefile.in b/cole/utils/Makefile.in new file mode 100644 index 0000000..6167caf --- /dev/null +++ b/cole/utils/Makefile.in @@ -0,0 +1,328 @@ +# 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +COLE_MAJOR = @COLE_MAJOR@ +COLE_MICRO = @COLE_MICRO@ +COLE_MINOR = @COLE_MINOR@ +DLLTOOL = @DLLTOOL@ +HOST_ALIAS_NAME = @HOST_ALIAS_NAME@ +HOST_CANONICAL_NAME = @HOST_CANONICAL_NAME@ +HOST_CPU = @HOST_CPU@ +HOST_OS = @HOST_OS@ +HOST_VENDOR = @HOST_VENDOR@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +NM = @NM@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ + +INCLUDES = -I$(top_srcdir) +LDADD = $(top_builddir)/libcole.la + +noinst_PROGRAMS = cole_tree cole_isfs cole_isfs_fast cole_extract +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +cole_tree_SOURCES = cole_tree.c +cole_tree_OBJECTS = cole_tree.o +cole_tree_LDADD = $(LDADD) +cole_tree_DEPENDENCIES = $(top_builddir)/libcole.la +cole_tree_LDFLAGS = +cole_isfs_SOURCES = cole_isfs.c +cole_isfs_OBJECTS = cole_isfs.o +cole_isfs_LDADD = $(LDADD) +cole_isfs_DEPENDENCIES = $(top_builddir)/libcole.la +cole_isfs_LDFLAGS = +cole_isfs_fast_SOURCES = cole_isfs_fast.c +cole_isfs_fast_OBJECTS = cole_isfs_fast.o +cole_isfs_fast_LDADD = $(LDADD) +cole_isfs_fast_DEPENDENCIES = $(top_builddir)/libcole.la +cole_isfs_fast_LDFLAGS = +cole_extract_SOURCES = cole_extract.c +cole_extract_OBJECTS = cole_extract.o +cole_extract_LDADD = $(LDADD) +cole_extract_DEPENDENCIES = $(top_builddir)/libcole.la +cole_extract_LDFLAGS = +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 = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = cole_tree.c cole_isfs.c cole_isfs_fast.c cole_extract.c +OBJECTS = cole_tree.o cole_isfs.o cole_isfs_fast.o cole_extract.o + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps utils/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: + +cole_tree: $(cole_tree_OBJECTS) $(cole_tree_DEPENDENCIES) + @rm -f cole_tree + $(LINK) $(cole_tree_LDFLAGS) $(cole_tree_OBJECTS) $(cole_tree_LDADD) $(LIBS) + +cole_isfs: $(cole_isfs_OBJECTS) $(cole_isfs_DEPENDENCIES) + @rm -f cole_isfs + $(LINK) $(cole_isfs_LDFLAGS) $(cole_isfs_OBJECTS) $(cole_isfs_LDADD) $(LIBS) + +cole_isfs_fast: $(cole_isfs_fast_OBJECTS) $(cole_isfs_fast_DEPENDENCIES) + @rm -f cole_isfs_fast + $(LINK) $(cole_isfs_fast_LDFLAGS) $(cole_isfs_fast_OBJECTS) $(cole_isfs_fast_LDADD) $(LIBS) + +cole_extract: $(cole_extract_OBJECTS) $(cole_extract_DEPENDENCIES) + @rm -f cole_extract + $(LINK) $(cole_extract_LDFLAGS) $(cole_extract_OBJECTS) $(cole_extract_LDADD) $(LIBS) + +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 = utils + +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: +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: diff --git a/cole/utils/cole_extract.c b/cole/utils/cole_extract.c new file mode 100644 index 0000000..0138553 --- /dev/null +++ b/cole/utils/cole_extract.c @@ -0,0 +1,95 @@ +/* + cole - A free C OLE library. + cole_extract - Extract a file from a filesystem. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include + +/* To compile this file outside cole source tree, + you must include here instead */ +#include + + +#define PRGNAME "cole_extract" +#define BUFFER_SIZE 128 + + +int +main (int argc, char **argv) +{ + COLEFS *cfs; + COLEFILE *cf; + COLERRNO colerrno; + char buffer[BUFFER_SIZE]; + size_t char_read; + + + if (argc != 3) { + fprintf (stderr, "cole_extract. Extract a file from a " + "filesystem to the standard output.\n" + "Usage: "PRGNAME" \n" + " FILE - File with the filesystem.\n" + " INFILE - Filename of the file to extract.\n"); + exit (1); + } + + + cfs = cole_mount (argv[1], &colerrno); + if (cfs == NULL) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + cf = cole_fopen (cfs, argv[2], &colerrno); + if (cf == NULL) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + while ((char_read = cole_fread (cf, buffer, BUFFER_SIZE, &colerrno))) { + if (fwrite (buffer, 1, char_read, stdout) != char_read) { + break; + } + } + if (!cole_feof (cf)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + + if (cole_fclose (cf, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + if (cole_umount (cfs, &colerrno)) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + exit (0); +} + diff --git a/cole/utils/cole_isfs.c b/cole/utils/cole_isfs.c new file mode 100644 index 0000000..b99b259 --- /dev/null +++ b/cole/utils/cole_isfs.c @@ -0,0 +1,75 @@ +/* + cole - A free C OLE library. + cole_isfs - Guess if a file is a valid filesystem. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include + +/* To compile this file outside cole source tree, + you must include here instead */ +#include + + +#define PRGNAME "cole_isfs" + + +int +main (int argc, char **argv) +{ + COLEFS * cfs; + COLERRNO colerrno; + + + if (argc != 2) { + fprintf (stderr, PRGNAME". Prints `yes' if the file is a " + "valid filesystem, otherwise it prints `no'.\n" + "Usage: "PRGNAME" \n"); + exit (1); + } + + + cfs = cole_mount (argv[1], &colerrno); + if (cfs == NULL) { + switch (colerrno) { + case COLE_ENOFILESYSTEM: + case COLE_EINVALIDFILESYSTEM: + printf ("no\n"); + break; + case COLE_EMEMORY: + case COLE_EOPENFILE: + case COLE_EUNKNOWN: + default: + cole_perror (PRGNAME, colerrno); + break; + } + exit (1); + } + if (cole_umount (cfs, &colerrno)) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + printf ("yes\n"); + + exit (0); +} + diff --git a/cole/utils/cole_isfs_fast.c b/cole/utils/cole_isfs_fast.c new file mode 100644 index 0000000..842da2e --- /dev/null +++ b/cole/utils/cole_isfs_fast.c @@ -0,0 +1,77 @@ +/* + cole - A free C OLE library. + cole_isfs_fast - Fast guess if a file is a valid filesystem. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include + +/* To compile this file outside cole source tree, + you must include here instead */ +#include + + +#define PRGNAME "cole_isfs_fast" + + +int +main (int argc, char **argv) +{ + FILE *file; + unsigned char sign[8]; + + + if (argc != 2) { + fprintf (stderr, PRGNAME". Prints `yes' if the file is a " + "valid filesystem, otherwise it prints `no'. " + "The test is not much accurate.\n" + "Usage: "PRGNAME" \n"); + exit (1); + } + + + file = fopen (argv[1], "rb"); + if (file == NULL) { + perror (PRGNAME); + exit (1); + } + + fread (sign, 1, 8, file); + if ( sign[0] != 0xd0 + || sign[1] != 0xcf + || sign[2] != 0x11 + || sign[3] != 0xe0 + || sign[4] != 0xa1 + || sign[5] != 0xb1 + || sign[6] != 0x1a + || sign[7] != 0xe1) { + printf ("no\n"); + fclose (file); + exit (1); + } + + fclose (file); + + printf ("yes\n"); + + exit (0); +} + diff --git a/cole/utils/cole_tree.c b/cole/utils/cole_tree.c new file mode 100644 index 0000000..fc96f26 --- /dev/null +++ b/cole/utils/cole_tree.c @@ -0,0 +1,68 @@ +/* + cole - A free C OLE library. + cole_tree - Prints the tree of a filesystem. + Copyright 1998, 1999 Roberto Arturo Tena Sanchez + + 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 + */ +/* + Arturo Tena + */ + + +#include + +/* To compile this file outside cole source tree, + you must include here instead */ +#include + + +#define PRGNAME "cole_tree" + + +int +main (int argc, char **argv) +{ + COLEFS * cfs; + COLERRNO colerrno; + + + if (argc != 2) { + fprintf (stderr, "cole_tree. Prints the tree of a filesystem.\n" + "Usage: "PRGNAME" \n"); + exit (1); + } + + + cfs = cole_mount (argv[1], &colerrno); + if (cfs == NULL) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + if (cole_print_tree (cfs, &colerrno)) { + cole_perror (PRGNAME, colerrno); + cole_umount (cfs, NULL); + exit (1); + } + + if (cole_umount (cfs, &colerrno)) { + cole_perror (PRGNAME, colerrno); + exit (1); + } + + exit (0); +} + diff --git a/cole/version.c.in b/cole/version.c.in new file mode 100644 index 0000000..d5246ac --- /dev/null +++ b/cole/version.c.in @@ -0,0 +1,13 @@ +#ifndef __BORLANDC__ +int cole_major_version = @COLE_MAJOR@; +int cole_minor_version = @COLE_MINOR@; +int cole_micro_version = @COLE_MICRO@; +char * cole_version = "@COLE_MAJOR@.@COLE_MINOR@.@COLE_MICRO@"; +char * cole_host_info = "@HOST_ALIAS_NAME@ (@HOST_CANONICAL_NAME@): @HOST_CPU@, @HOST_VENDOR@, @HOST_OS@"; +#else +int cole_major_version = 2; +int cole_minor_version = 0; +int cole_micro_version = 1; +char * cole_version = "2.0.1"; +char * cole_host_info = "BORLANDC (Windows): i386, GPL, Win32"; +#endif diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..0ce538b --- /dev/null +++ b/config.guess @@ -0,0 +1,1183 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# 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 . +# Please send patches to . +# +# 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). +# + +# Use $HOST_CC if defined. $CC may point to a cross-compiler +if test x"$CC_FOR_BUILD" = x; then + if test x"$HOST_CC" != x; then + CC_FOR_BUILD="$HOST_CC" + else + if test x"$CC" != x; then + CC_FOR_BUILD="$CC" + else + CC_FOR_BUILD=cc + fi + fi +fi + + +# 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 + +dummy=dummy-$$ +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 + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-cbm ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format. + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + 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 + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + 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:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + 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 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-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 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${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:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #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_FOR_BUILD $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 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${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_FOR_BUILD $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) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | 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 BSD 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/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + 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_FOR_BUILD $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 ;; + *9??*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + 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 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + 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} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | 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 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`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 ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + 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. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_help_string=`cd /; 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 + *ia64) + echo "${UNAME_MACHINE}-unknown-linux" + exit 0 + ;; + i?86linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 + ;; + elf_i?86) + echo "${UNAME_MACHINE}-pc-linux" + exit 0 + ;; + i?86coff) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 + ;; + sparclinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + armlinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32arm*) + echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" + exit 0 + ;; + armelf_linux*) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; + m68klinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32ppc | elf32ppclinux) + # Determine Lib Version + cat >$dummy.c < +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-gnu${LIBC} + exit 0 + ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + cat <$dummy.s + .data + \$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main + main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + LIBC="" + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 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 < /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __MIPSEB__ + printf ("%s-unknown-linux-gnu\n", argv[1]); +#endif +#ifdef __MIPSEL__ + printf ("%sel-unknown-linux-gnu\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + elif test "${UNAME_MACHINE}" = "s390"; then + echo s390-ibm-linux && exit 0 + 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 < +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#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_FOR_BUILD $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.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i?86:*:5:7*) + # Fixed at (any) Pentium or better + UNAME_MACHINE=i586 + if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then + echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} + 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 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i?86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # 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.*:* | i?86:LynxOS:3.[01]*:*) + 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*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + 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 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-W:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + 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`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%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_FOR_BUILD $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 diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..cea458d --- /dev/null +++ b/config.h.in @@ -0,0 +1,65 @@ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* The size of a `double', as computed by sizeof. */ +#undef SIZEOF_DOUBLE + +/* The size of a `float', as computed by sizeof. */ +#undef SIZEOF_FLOAT + +/* The size of a `long double', as computed by sizeof. */ +#undef SIZEOF_LONG_DOUBLE + +/* The size of a `unsigned char', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_CHAR + +/* The size of a `unsigned int', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_INT + +/* The size of a `unsigned long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG + +/* The size of a `unsigned long long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG_LONG + +/* The size of a `unsigned short', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_SHORT + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define if your processor stores words with the most significant byte first + (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/config.log b/config.log new file mode 100644 index 0000000..9d75946 --- /dev/null +++ b/config.log @@ -0,0 +1,30 @@ + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by config.status 2.50, executed with + > ./config.status +on moses + +config.status:5395: creating ppthtml/Makefile + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by config.status 2.50, executed with + > ./config.status +on moses + +config.status:5395: creating xlhtml/Makefile + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by config.status 2.50, executed with + > ./config.status +on moses + +config.status:5395: creating cole/Makefile diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..c8e7785 --- /dev/null +++ b/config.sub @@ -0,0 +1,1268 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# 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. + +# Written by Per Bothner . +# Please send patches to . +# +# 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 + nto-qnx* | 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 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + 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/'` + ;; + -udk*) + 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 + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +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 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | hppa64 \ + | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ + | alphaev6[78] \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | mips64orion | mips64orionel | mipstx39 | mipstx39el \ + | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ + | mips64vr5000 | miprs64vr5000el | mcore \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ + | thumb | d10v | fr30 | avr) + basic_machine=$basic_machine-unknown + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) + ;; + + # 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[34567]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. + # FIXME: clean up the formatting here. + vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ + | alphaev6[78]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ + | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ + | mipstx39-* | mipstx39el-* | mcore-* \ + | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ + | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + 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 + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + 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 + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + 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 + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-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 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + i386-go32 | go32) + basic_machine=i386-unknown + os=-go32 + ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; + 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 + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + 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 + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-unknown + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + 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 + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + 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 + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + 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 | k5 | k6 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + 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 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + 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 + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + 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 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + 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 + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + 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. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + 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 | sparcv9) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *) + 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* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -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|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk) + os=-nsk + ;; + # 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*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -*MiNT) + os=-mint + ;; + -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*-rebel) + os=-linux + ;; + 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 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-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 + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + 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 + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -*MiNT) + vendor=atari + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os diff --git a/configure b/configure new file mode 100755 index 0000000..b44f56b --- /dev/null +++ b/configure @@ -0,0 +1,5711 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.50. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Avoid depending upon Character Ranges. +ac_cr_az='abcdefghijklmnopqrstuvwxyz' +ac_cr_AZ='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +ac_cr_09='0123456789' +ac_cr_alnum=$ac_cr_az$ac_cr_AZ$ac_cr_09 + +# Sed expression to map a string onto a valid sh and CPP variable names. +ac_tr_sh="sed y%*+%pp%;s%[^_$ac_cr_alnum]%_%g" +ac_tr_cpp="sed y%*$ac_cr_az%P$ac_cr_AZ%;s%[^_$ac_cr_alnum]%_%g" + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#include +#include +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#else +# if HAVE_STRINGS_H +# include +# endif +#endif +#if HAVE_INTTYPES_H +# include +#endif +#if HAVE_UNISTD_H +# include +#endif" + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +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' + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +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 + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # 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_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$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 ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$ac_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$ac_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) 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 | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$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_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$ac_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$ac_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + 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 "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$ac_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$ac_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir \ + exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + NONE ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# 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 "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # 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 < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_status=$?; ac_signal='$ac_signal'; { (exit $ac_status); exit $ac_status; }' $ac_signal +done +ac_signal=0 + +# 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 + +# Let the site file select an alternate cache file if it wants to. +# 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 "$as_me:844: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:855: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:863: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_suggest_removing_cache=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:879: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_suggest_removing_cache=: ;; + ,set) + { echo "$as_me:883: WARNING: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: WARNING: \`$ac_var' was not set in the previous run" >&2;} + ac_suggest_removing_cache=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:889: WARNING: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: WARNING: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:891: WARNING: former value: $ac_old_val" >&5 +echo "$as_me: WARNING: former value: $ac_old_val" >&2;} + { echo "$as_me:893: WARNING: current value: $ac_new_val" >&5 +echo "$as_me: WARNING: current value: $ac_new_val" >&2;} + ac_suggest_removing_cache=: + fi;; + esac +done +if $ac_suggest_removing_cache; then + { echo "$as_me:900: WARNING: changes in the environment can compromise the build" >&5 +echo "$as_me: WARNING: changes in the environment can compromise the build" >&2;} + { echo "$as_me:902: WARNING: consider removing $cache_file and starting over" >&5 +echo "$as_me: WARNING: consider removing $cache_file and starting over" >&2;} +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:921: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:924: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +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 + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:950: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:960: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:964: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:973: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:977: error: $ac_config_sub $ac_cv_build_alias failed." >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:982: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:989: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:998: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1003: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +HOST_CANONICAL_NAME=$host +HOST_ALIAS_NAME=${host_alias} +HOST_CPU=${host_cpu} +HOST_VENDOR=${host_vendor} +HOST_OS=${host_os} + +# 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 +# AmigaOS /C/install, which installs bootblocks on floppy discs +# 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 "$as_me:1028: checking for a BSD compatible install" >&5 +echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_IFS=$IFS; IFS=$ac_path_separator + for ac_dir in $PATH; do + IFS=$ac_save_IFS + # Account for people who put trailing slashes in PATH elements. + case $ac_dir/ in + / | ./ | .// | /cC/* \ + | /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 $as_executable_p "$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. + : + elif test $ac_prog = install && + grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + +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 "$as_me:1077: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&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}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:1088: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# 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 "$as_me:1111: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { { echo "$as_me:1124: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest* +echo "$as_me:1131: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF >conftest.sed +s,\\,\\\\,g; s,\$,$$,g +EOF + program_transform_name=`echo $program_transform_name | sed -f conftest.sed` + rm -f conftest.sed +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 -z "$program_transform_name" && program_transform_name="s,x,x," + +echo "$as_me:1152: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 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 conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:1172: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:1176: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +PACKAGE=xlhtml/xlhtml + +VERSION=0.4.9.2 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { { echo "$as_me:1186: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking for working aclocal... $ECHO_C" >&6 +# 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 "$as_me:1207: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$as_me:1211: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +echo "$as_me:1215: checking for working autoconf" >&5 +echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6 +# 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 "$as_me:1222: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$as_me:1226: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +echo "$as_me:1230: checking for working automake" >&5 +echo $ECHO_N "checking for working automake... $ECHO_C" >&6 +# 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 "$as_me:1237: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$as_me:1241: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +echo "$as_me:1245: checking for working autoheader" >&5 +echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6 +# 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 "$as_me:1252: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$as_me:1256: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +echo "$as_me:1260: checking for working makeinfo" >&5 +echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6 +# 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 "$as_me:1267: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$as_me:1271: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +ac_config_headers="$ac_config_headers config.h" + +ac_config_commands="$ac_config_commands default-1" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:1287: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:1302: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1310: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1313: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:1322: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1337: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1345: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1348: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:1361: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:1376: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1384: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1387: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1396: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1411: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1419: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1422: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +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 "$as_me:1435: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1455: found $ac_dir/$ac_word" >&5 +break +done + +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 $# != 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" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1477: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1480: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:1491: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:1506: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1514: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1517: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1530: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:1545: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1553: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1556: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:1568: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +cat >conftest.$ac_ext <<_ACEOF +#line 1573 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compiler, and finding out an intuition +# of exeext. +echo "$as_me:1589: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:1592: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1595: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `ls a.exe conftest.exe a.* conftest conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1612: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:1618: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1623: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:1629: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1632: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1639: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:1647: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1654: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1656: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1659: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1661: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1664: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1680: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:1686: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:1692: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1698 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1710: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1713: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1725: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:1732: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1736: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1742 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1757: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1760: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1763: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1766: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1778: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:1784: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1790 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1802: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1805: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1808: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1811: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:1821: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1848: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1851: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1854: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1857: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1869 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1882: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1885: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1888: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1891: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1901 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1913: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1916: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1919: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1922: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +echo '#ifdef __cplusplus' >>confdefs.h +echo $ac_declaration >>confdefs.h +echo '#endif' >>confdefs.h + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:1949: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" +echo "$as_me:1964: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:1972: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:1975: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:1984: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_RANLIB="ranlib" +echo "$as_me:1999: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:2008: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:2011: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + echo "$as_me:2020: checking for strerror in -lcposix" >&5 +echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 +if test "${ac_cv_lib_cposix_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 2028 "configure" +#include "confdefs.h" + +/* 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 strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2047: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2050: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2053: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2056: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cposix_strerror=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_cposix_strerror=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2067: result: $ac_cv_lib_cposix_strerror" >&5 +echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 +if test $ac_cv_lib_cposix_strerror = yes; then + LIBS="$LIBS -lcposix" +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:2078: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + # break 2 since there is a loop in there. + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 2100 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2105: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2111: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 2134 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2138: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2144: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break 2 +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:2181: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 2191 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2196: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2202: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 2225 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2229: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2235: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:2263: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +for ac_header in malloc.h +do +ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh` +echo "$as_me:2277: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$ac_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2283 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:2287: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2293: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$ac_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$ac_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:2312: result: `eval echo '${'$ac_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6 +if test `eval echo '${'$ac_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line 2330 "configure" +#include "confdefs.h" +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:2379: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2382: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2385: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2388: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:2405: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:2408: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +echo "$as_me:2413: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2419 "configure" +#include "confdefs.h" + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2477: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2480: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2483: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2486: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_const=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2496: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\EOF +#define const +EOF + +fi + +echo "$as_me:2506: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2512 "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:2520: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2526: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line 2548 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + 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 <<_ACEOF +#line 2566 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + 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 <<_ACEOF +#line 2587 "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#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); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:2613: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2616: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:2618: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2621: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +fi +echo "$as_me:2634: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +for ac_header in stdlib.h string.h memory.h strings.h inttypes.h unistd.h +do +ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh` +echo "$as_me:2647: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$ac_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2653 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:2657: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2663: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$ac_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$ac_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:2682: result: `eval echo '${'$ac_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6 +if test `eval echo '${'$ac_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2698 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2713: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2716: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2719: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2722: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_size_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2732: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for unsigned char... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2750 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((unsigned char *) 0) + return 0; +if (sizeof (unsigned char)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2765: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2768: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2771: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2774: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_char=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_unsigned_char=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2784: result: $ac_cv_type_unsigned_char" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_char" >&6 + +echo "$as_me:2787: checking size of unsigned char" >&5 +echo $ECHO_N "checking size of unsigned char... $ECHO_C" >&6 +if test "${ac_cv_sizeof_unsigned_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_unsigned_char" = yes; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line 2796 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned char)) >= 0)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2808: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2811: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2814: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2817: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 2822 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned char)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2834: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2837: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2840: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2843: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 2859 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned char)) >= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2871: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2874: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2877: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2880: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line 2896 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned char)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2908: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2911: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2914: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2917: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +ac_cv_sizeof_unsigned_char=$ac_lo +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:2930: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 2935 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.val", "w"); +if (!f) + exit (1); +fprintf (f, "%d", (sizeof (unsigned char))); +fclose (f); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:2951: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2954: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:2956: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2959: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_unsigned_char=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_unsigned_char=0 +fi +fi +echo "$as_me:2975: result: $ac_cv_sizeof_unsigned_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_char" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking for unsigned short... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2987 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((unsigned short *) 0) + return 0; +if (sizeof (unsigned short)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3002: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3005: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3008: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3011: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_short=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_unsigned_short=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3021: result: $ac_cv_type_unsigned_short" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_short" >&6 + +echo "$as_me:3024: checking size of unsigned short" >&5 +echo $ECHO_N "checking size of unsigned short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_unsigned_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_unsigned_short" = yes; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line 3033 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned short)) >= 0)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3045: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3048: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3051: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3054: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 3059 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned short)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3071: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3074: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3077: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3080: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 3096 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned short)) >= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3108: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3111: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3114: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3117: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line 3133 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned short)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3145: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3148: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3151: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3154: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +ac_cv_sizeof_unsigned_short=$ac_lo +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:3167: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 3172 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.val", "w"); +if (!f) + exit (1); +fprintf (f, "%d", (sizeof (unsigned short))); +fclose (f); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:3188: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3191: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:3193: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3196: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_unsigned_short=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_unsigned_short=0 +fi +fi +echo "$as_me:3212: result: $ac_cv_sizeof_unsigned_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_short" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3224 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((unsigned int *) 0) + return 0; +if (sizeof (unsigned int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3239: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3242: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3245: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3248: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_int=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_unsigned_int=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3258: result: $ac_cv_type_unsigned_int" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6 + +echo "$as_me:3261: checking size of unsigned int" >&5 +echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_unsigned_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_unsigned_int" = yes; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line 3270 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned int)) >= 0)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3282: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3285: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3288: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3291: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 3296 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned int)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3308: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3311: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3314: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3317: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 3333 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned int)) >= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3345: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3348: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3351: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3354: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line 3370 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned int)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3382: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3385: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3388: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3391: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +ac_cv_sizeof_unsigned_int=$ac_lo +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:3404: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 3409 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.val", "w"); +if (!f) + exit (1); +fprintf (f, "%d", (sizeof (unsigned int))); +fclose (f); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:3425: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3428: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:3430: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3433: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_unsigned_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_unsigned_int=0 +fi +fi +echo "$as_me:3449: result: $ac_cv_sizeof_unsigned_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3461 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((unsigned long *) 0) + return 0; +if (sizeof (unsigned long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3476: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3479: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3482: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3485: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_unsigned_long=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3495: result: $ac_cv_type_unsigned_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6 + +echo "$as_me:3498: checking size of unsigned long" >&5 +echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_unsigned_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_unsigned_long" = yes; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line 3507 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned long)) >= 0)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3519: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3522: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3525: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3528: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 3533 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned long)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3545: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3548: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3551: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3554: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 3570 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned long)) >= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3582: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3585: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3588: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3591: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line 3607 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned long)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3619: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3622: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3625: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3628: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +ac_cv_sizeof_unsigned_long=$ac_lo +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:3641: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 3646 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.val", "w"); +if (!f) + exit (1); +fprintf (f, "%d", (sizeof (unsigned long))); +fclose (f); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:3662: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3665: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:3667: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3670: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_unsigned_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_unsigned_long=0 +fi +fi +echo "$as_me:3686: result: $ac_cv_sizeof_unsigned_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3698 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((unsigned long long *) 0) + return 0; +if (sizeof (unsigned long long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3713: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3716: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3719: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3722: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_long_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_unsigned_long_long=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3732: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 + +echo "$as_me:3735: checking size of unsigned long long" >&5 +echo $ECHO_N "checking size of unsigned long long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_unsigned_long_long" = yes; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line 3744 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned long long)) >= 0)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3756: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3759: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3762: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3765: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 3770 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned long long)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3782: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3785: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3788: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3791: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 3807 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned long long)) >= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3819: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3822: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3825: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3828: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line 3844 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (unsigned long long)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3856: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3859: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3862: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3865: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +ac_cv_sizeof_unsigned_long_long=$ac_lo +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:3878: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 3883 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.val", "w"); +if (!f) + exit (1); +fprintf (f, "%d", (sizeof (unsigned long long))); +fclose (f); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:3899: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3902: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:3904: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3907: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_unsigned_long_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_unsigned_long_long=0 +fi +fi +echo "$as_me:3923: result: $ac_cv_sizeof_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_long" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking for float... $ECHO_C" >&6 +if test "${ac_cv_type_float+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3935 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((float *) 0) + return 0; +if (sizeof (float)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3950: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3953: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3956: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3959: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_float=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_float=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3969: result: $ac_cv_type_float" >&5 +echo "${ECHO_T}$ac_cv_type_float" >&6 + +echo "$as_me:3972: checking size of float" >&5 +echo $ECHO_N "checking size of float... $ECHO_C" >&6 +if test "${ac_cv_sizeof_float+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_float" = yes; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line 3981 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (float)) >= 0)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3993: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3996: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3999: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4002: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 4007 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (float)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4019: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4022: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4025: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4028: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 4044 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (float)) >= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4056: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4059: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4062: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4065: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line 4081 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (float)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4093: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4096: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4099: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4102: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +ac_cv_sizeof_float=$ac_lo +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:4115: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 4120 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.val", "w"); +if (!f) + exit (1); +fprintf (f, "%d", (sizeof (float))); +fclose (f); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4136: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4139: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4141: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4144: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_float=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_float=0 +fi +fi +echo "$as_me:4160: result: $ac_cv_sizeof_float" >&5 +echo "${ECHO_T}$ac_cv_sizeof_float" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking for double... $ECHO_C" >&6 +if test "${ac_cv_type_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4172 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((double *) 0) + return 0; +if (sizeof (double)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4187: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4190: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4193: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4196: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_double=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_double=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4206: result: $ac_cv_type_double" >&5 +echo "${ECHO_T}$ac_cv_type_double" >&6 + +echo "$as_me:4209: checking size of double" >&5 +echo $ECHO_N "checking size of double... $ECHO_C" >&6 +if test "${ac_cv_sizeof_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_double" = yes; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line 4218 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (double)) >= 0)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4230: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4233: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4236: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4239: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 4244 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (double)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4256: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4259: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4262: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4265: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 4281 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (double)) >= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4293: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4296: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4299: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4302: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line 4318 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (double)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4330: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4333: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4336: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4339: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +ac_cv_sizeof_double=$ac_lo +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:4352: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 4357 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.val", "w"); +if (!f) + exit (1); +fprintf (f, "%d", (sizeof (double))); +fclose (f); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4373: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4376: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4378: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4381: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_double=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_double=0 +fi +fi +echo "$as_me:4397: result: $ac_cv_sizeof_double" >&5 +echo "${ECHO_T}$ac_cv_sizeof_double" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking for long double... $ECHO_C" >&6 +if test "${ac_cv_type_long_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4409 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((long double *) 0) + return 0; +if (sizeof (long double)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4424: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4427: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4430: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4433: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_double=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_long_double=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4443: result: $ac_cv_type_long_double" >&5 +echo "${ECHO_T}$ac_cv_type_long_double" >&6 + +echo "$as_me:4446: checking size of long double" >&5 +echo $ECHO_N "checking size of long double... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long_double" = yes; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line 4455 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (long double)) >= 0)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4467: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4470: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4473: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4476: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 4481 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (long double)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4493: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4496: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4499: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4502: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line 4518 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (long double)) >= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4530: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4533: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4536: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4539: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line 4555 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +int _array_ [1 - 2 * !((sizeof (long double)) <= $ac_mid)] + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4567: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4570: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4573: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4576: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +ac_cv_sizeof_long_double=$ac_lo +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:4589: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 4594 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.val", "w"); +if (!f) + exit (1); +fprintf (f, "%d", (sizeof (long double))); +fclose (f); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4610: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4613: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4615: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4618: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long_double=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long_double=0 +fi +fi +echo "$as_me:4634: result: $ac_cv_sizeof_long_double" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +#line 4648 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4665: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4668: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4671: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4674: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +#line 4678 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4695: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4698: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4701: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4704: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_bigendian=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { { echo "$as_me:4720: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line 4725 "configure" +#include "confdefs.h" +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4741: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4744: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4746: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4749: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_bigendian=yes +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext +fi +fi +fi +echo "$as_me:4762: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +if test $ac_cv_c_bigendian = yes; then + +cat >>confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:4775: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_STRIP="${ac_tool_prefix}strip" +echo "$as_me:4790: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:4798: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:4801: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:4810: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_STRIP="strip" +echo "$as_me:4825: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:4833: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:4836: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +COLE_MAJOR=2 +COLE_MINOR=0 +COLE_MICRO=2 +COLE_MAJOR_PLUS_COLE_MINOR=2 + +ac_config_files="$ac_config_files Makefile cole/Makefile cole/version.c cole/cole.h xlhtml/Makefile ppthtml/Makefile" +cat >confcache <<\_ACEOF +# 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, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# 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 \ + "s/'/'\\\\''/g; + s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:4930: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:5106: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # Handling of arguments. + 'Makefile' ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + 'cole/Makefile' ) CONFIG_FILES="$CONFIG_FILES cole/Makefile" ;; + 'cole/version.c' ) CONFIG_FILES="$CONFIG_FILES cole/version.c" ;; + 'cole/cole.h' ) CONFIG_FILES="$CONFIG_FILES cole/cole.h" ;; + 'xlhtml/Makefile' ) CONFIG_FILES="$CONFIG_FILES xlhtml/Makefile" ;; + 'ppthtml/Makefile' ) CONFIG_FILES="$CONFIG_FILES ppthtml/Makefile" ;; + 'default-1' ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + 'config.h' ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + + # This is an error. + -*) { { echo "$as_me:5135: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + *) { { echo "$as_me:5140: error: invalid argument: $1" >&5 +echo "$as_me: error: invalid argument: $1" >&2;} + { (exit 1); exit 1; }; };; + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me 2.50, executed with + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <<\EOF +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit $?); exit $?; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@HOST_CANONICAL_NAME@,$HOST_CANONICAL_NAME,;t t +s,@HOST_ALIAS_NAME@,$HOST_ALIAS_NAME,;t t +s,@HOST_CPU@,$HOST_CPU,;t t +s,@HOST_VENDOR@,$HOST_VENDOR,;t t +s,@HOST_OS@,$HOST_OS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CPP@,$CPP,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@COLE_MAJOR@,$COLE_MAJOR,;t t +s,@COLE_MINOR@,$COLE_MINOR,;t t +s,@COLE_MICRO@,$COLE_MICRO,;t t +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_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + 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 $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_dots$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:5395: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:5413: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:5426: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_HEADER section. +# + +# 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=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:5487: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:5498: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:5511: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +EOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# 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.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\EOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +EOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# 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.undefs <<\EOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +EOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # egrep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\EOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated automatically by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:5628: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + fi + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + case $ac_dest in + default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;; + esac +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + +echo "$as_me:5709: result: Configured $PACKAGE release $VERSION" >&5 +echo "${ECHO_T}Configured $PACKAGE release $VERSION" >&6 + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..43a0766 --- /dev/null +++ b/configure.in @@ -0,0 +1,65 @@ +AC_INIT + +dnl Host +AC_CANONICAL_HOST +HOST_CANONICAL_NAME=$host +HOST_ALIAS_NAME=${host_alias} +HOST_CPU=${host_cpu} +HOST_VENDOR=${host_vendor} +HOST_OS=${host_os} +AC_SUBST(HOST_CANONICAL_NAME) +AC_SUBST(HOST_ALIAS_NAME) +AC_SUBST(HOST_CPU) +AC_SUBST(HOST_VENDOR) +AC_SUBST(HOST_OS) + +AM_INIT_AUTOMAKE(xlhtml/xlhtml, 0.4.9.3) +AM_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_PROG_RANLIB +AC_ISC_POSIX + +AC_CHECK_HEADERS(malloc.h) + + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_CHECK_SIZEOF(unsigned char) +AC_CHECK_SIZEOF(unsigned short) +AC_CHECK_SIZEOF(unsigned int) +AC_CHECK_SIZEOF(unsigned long) +AC_CHECK_SIZEOF(unsigned long long) +AC_CHECK_SIZEOF(float) +AC_CHECK_SIZEOF(double) +AC_CHECK_SIZEOF(long double) +AC_C_BIGENDIAN + +AC_CHECK_TOOL([STRIP],[strip]) + +dnl 4a) Increment when remove or change interfaces. +dnl [USER SHOULD UPDATE] +COLE_MAJOR=2 +dnl 4a) 5) Increment when add interfaces. +dnl 6) Set to zero when remove (or change) interfaces. +dnl [PROGRAMMERS SHOULD LOOK WHAT'S NEW] +COLE_MINOR=0 +dnl 3) Increment when interfaces not changed at all, +dnl only bug fixes or internal changes. +dnl 4b) Set to zero when add, remove or change interfaces. +dnl [ONLY MAINTAINER SHOULD CARE] +COLE_MICRO=2 +dnl +dnl Set this too (I don't know how to do it automatically =) ): +COLE_MAJOR_PLUS_COLE_MINOR=2 +dnl +AC_SUBST(COLE_MAJOR) +AC_SUBST(COLE_MINOR) +AC_SUBST(COLE_MICRO) + + +AC_OUTPUT([Makefile cole/Makefile cole/version.c cole/cole.h xlhtml/Makefile ppthtml/Makefile]) + +AC_MSG_RESULT([Configured $PACKAGE release $VERSION]) + diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..e9de238 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/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=: + chmodcmd="" + 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 diff --git a/missing b/missing new file mode 100755 index 0000000..7789652 --- /dev/null +++ b/missing @@ -0,0 +1,190 @@ +#! /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 create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -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` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $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$/.in/' | + while read f; do touch "$f"; done + ;; + + 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." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + 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 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..5489cd3 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2002/03/20 15:31:55 slidedraw 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" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/ppthtml/ChangeLog b/ppthtml/ChangeLog new file mode 100644 index 0000000..af27480 --- /dev/null +++ b/ppthtml/ChangeLog @@ -0,0 +1,15 @@ + ppthtml ChangeLog + +0.3 10/19/2001 + * Renamed the program to ppthtml...all lowercase + +0.2.8 01/14/2000 + * Added man page + * Added Unicode patch from Hironori + * Many Bug Fixes + +0.0.0 10/13/1999 + *So far its just a dream. :) + + + diff --git a/ppthtml/Makefile.am b/ppthtml/Makefile.am new file mode 100644 index 0000000..07810c6 --- /dev/null +++ b/ppthtml/Makefile.am @@ -0,0 +1,14 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = README ChangeLog TODO THANKS test.ppt ppthtml.1 + +INCLUDES = -I../cole + +noinst_PROGRAMS = pptdump +man_MANS = ppthtml.1 +bin_SCRIPTS = nspptview +bin_PROGRAMS = ppthtml +LDADD = ../cole/libcole.a +ppthtml_SOURCES = ppthtml.c +AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith + diff --git a/ppthtml/Makefile.in b/ppthtml/Makefile.in new file mode 100644 index 0000000..8e27ec1 --- /dev/null +++ b/ppthtml/Makefile.in @@ -0,0 +1,381 @@ +# Makefile.in generated automatically by automake 1.4-p4 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +COLE_MAJOR = @COLE_MAJOR@ +COLE_MICRO = @COLE_MICRO@ +COLE_MINOR = @COLE_MINOR@ +HOST_ALIAS_NAME = @HOST_ALIAS_NAME@ +HOST_CANONICAL_NAME = @HOST_CANONICAL_NAME@ +HOST_CPU = @HOST_CPU@ +HOST_OS = @HOST_OS@ +HOST_VENDOR = @HOST_VENDOR@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +EXTRA_DIST = README ChangeLog TODO THANKS test.ppt ppthtml.1 + +INCLUDES = -I../cole + +noinst_PROGRAMS = pptdump +man_MANS = ppthtml.1 +bin_SCRIPTS = nspptview +bin_PROGRAMS = ppthtml +LDADD = ../cole/libcole.a +ppthtml_SOURCES = ppthtml.c +AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +ppthtml_OBJECTS = ppthtml.o +ppthtml_LDADD = $(LDADD) +ppthtml_DEPENDENCIES = ../cole/libcole.a +ppthtml_LDFLAGS = +pptdump_SOURCES = pptdump.c +pptdump_OBJECTS = pptdump.o +pptdump_LDADD = $(LDADD) +pptdump_DEPENDENCIES = ../cole/libcole.a +pptdump_LDFLAGS = +SCRIPTS = $(bin_SCRIPTS) + +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +man1dir = $(mandir)/man1 +MANS = $(man_MANS) + +NROFF = nroff +DIST_COMMON = README ChangeLog Makefile.am Makefile.in THANKS + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(ppthtml_SOURCES) pptdump.c +OBJECTS = $(ppthtml_OBJECTS) pptdump.o + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps ppthtml/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 " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(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: + +ppthtml: $(ppthtml_OBJECTS) $(ppthtml_DEPENDENCIES) + @rm -f ppthtml + $(LINK) $(ppthtml_LDFLAGS) $(ppthtml_OBJECTS) $(ppthtml_LDADD) $(LIBS) + +pptdump: $(pptdump_OBJECTS) $(pptdump_DEPENDENCIES) + @rm -f pptdump + $(LINK) $(pptdump_LDFLAGS) $(pptdump_OBJECTS) $(pptdump_LDADD) $(LIBS) + +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 + +install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done + +uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-man1 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 + +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 = ppthtml + +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-binPROGRAMS install-binSCRIPTS +install-exec: install-exec-am + +install-data-am: install-man +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-binSCRIPTS uninstall-man +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir) \ + $(DESTDIR)$(mandir)/man1 + + +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-binPROGRAMS mostlyclean-noinstPROGRAMS \ + mostlyclean-compile mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \ + clean-tags clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-noinstPROGRAMS \ + distclean-compile distclean-tags distclean-generic \ + clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-noinstPROGRAMS \ + maintainer-clean-compile 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 uninstall-binSCRIPTS install-binSCRIPTS \ +install-man1 uninstall-man1 install-man uninstall-man 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: diff --git a/ppthtml/README b/ppthtml/README new file mode 100644 index 0000000..b512177 --- /dev/null +++ b/ppthtml/README @@ -0,0 +1,69 @@ +Welcome to ppthtml. + + +I. INTRODUCTION +The ppthtml program will take a PowerPoint 97/95 file as input and convert +it to html. The output is via standard out so it can be re-directed +to files or piped to filters or used as a gateway to the internet. + +II. INSTALLATION +To build this application, from the top directory, type: + + ./configure --prefix=/ + make + make install + +Then to finish it up, you will need to go into netscape and tell the navigator +to use the nspptview script to handle Microsoft Excel files. + + e.g. /nspptview %s + +You should be able to then browse to a file and open it. There is a file +included in the ppthtml directory you can test with, test.ppt. + +The shell script nspptview works well. You may need to modify the +path in it to fit you system, though. Also, depending on where you install +it, you may have to modify your PATH environmental variable. + + +III. UNINSTALLING +You may want to keep the tar directory around since you can do a make uninstall +later. In the meantime, I suggest doing a make clean after installation to +get the size down. + + +IV. COMMANDLINE OPTIONS +ppthtml now has several command line options that let you tailor its output. The +command is now: ppthtml [] file.ppt + + +V. PERFORMANCE TUNING +There are also some user "tunable" parameters in the beginning of the +ppthtml.c file. If you get a red message at the bottom of your web browser after +converting a big presentation, these are the parameters to adjust. Generally, you +would adjust them up in value. I have them adjusted to what I call normal for +my usage. Your usage may differ. Don't increase them greatly...just 10-15% and +re-compile. If that don't work, increase another 10-15% until it works. + + +VI. TROUBLESHOOTING +Using Netscape, you may occassionally see a file not found error. This usually +comes when printing or going back to a previously converted file. This is +the default behavior and it can be changed by commenting out the rm $tmp* +in nspptview. I do this so you don't have files hanging around in your tmp +directory where other people might be able to see them. + +In general, if you can type ppthtml and get a usage error message, the PATH +is working. If you don't, your PATH environmental variable needs adjusting. +Next try passing the full path to ppthtml of the file you want converted. If it +has problems with it, you may have a file the system can't interpret. To check +your installation, try passing the full path of ppthtml/threads.ppt and see what +it does with that. + + + + +Charles N Wyble +jackshck@yahoo.com + + diff --git a/ppthtml/THANKS b/ppthtml/THANKS new file mode 100644 index 0000000..2bb616a --- /dev/null +++ b/ppthtml/THANKS @@ -0,0 +1,4 @@ + + Arturo Tena for the cole 2.0 library + Caolan McNamara for MSWordView...where I got the nsopen & nsxlview scripts + Hironori Sakamoto for the unicode patch diff --git a/ppthtml/Test.ppt b/ppthtml/Test.ppt new file mode 100644 index 0000000..3610de8 Binary files /dev/null and b/ppthtml/Test.ppt differ diff --git a/ppthtml/nspptview b/ppthtml/nspptview new file mode 100755 index 0000000..86b9dad --- /dev/null +++ b/ppthtml/nspptview @@ -0,0 +1,29 @@ +#!/bin/csh + +if ($#argv != 1) then + echo "Usage: $0 file.doc" + exit 1 +endif + +set source = $argv[1] + +#Generate a unique html filename (/tmp/scriptname.pidnum.html) +#set com = $0 +#set tmp = /tmp/$com:t.$$ +#set html = $tmp.html + +set tmp = `mktemp -q /tmp/nspptview.XXXXXX` || exit 1 +set tmp2 = `mktemp -q $tmp/nspptview.XXXXXX` || exit 1 +set html = $tmp2.html + +ppthtml $source > $html +if ((!(-r $html)) | ($status)) then + echo "$0"": failed to generate HTML file" + exit 1 +endif + +#File exists and is of length > 0, so open it +nsopen $html +rm -rf $tmp* + +exit 0 diff --git a/ppthtml/pptdump.c b/ppthtml/pptdump.c new file mode 100644 index 0000000..522da64 --- /dev/null +++ b/ppthtml/pptdump.c @@ -0,0 +1,515 @@ +/* + pptdump - dumps individual records for analysis + Copyright 2002 Charles N Wyble + + 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 + */ + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "config.h" /* Created by ./configure script */ +#include "support.h" /* Needs to be before internal.h */ +#include "internal.h" /* Needs to be before cole */ +#include "cole.h" +#else +#include "config.h.in" /* Created by ./configure script */ +#include "support.h" /* Needs to be before internal.h */ +#include "internal.h" /* Needs to be before cole */ +#include "cole.h.in" +#endif + +#include +#include +#include /* for strcpy() */ +#include /* For isprint */ + + +#define MODE 1 + +#define PRGNAME "pptdump" +#define MAX_COLS 64 +#define MAX_ROWS 512 + +static char FileName[2][32] = /* The section of the PowerPoint File we read */ +{ + "/PowerPoint Document", /* Power Point 97 & 2000 */ + "/PP40" /* Everything else ? */ +}; + +/* Function Prototypes */ +COLE_LOCATE_ACTION_FUNC dump_file; +static void output_type_string(int); + +/* Global data */ +static char filename[128]; + + +int main (int argc, char **argv) +{ + int f_ptr = 0; + COLEFS * cfs; + COLERRNO colerrno; + + if (argc < 2) + { + fprintf (stderr, "pptdump - Outputs PowerPoint file records for analysis.\n" + "Usage: "PRGNAME" \n"); + exit (1); + } + else + { + strncpy(filename, argv[1], 124); + cfs = cole_mount (filename, &colerrno); + if (cfs == NULL) + { + cole_perror (PRGNAME, colerrno); + exit (1); + } + } + + while (cole_locate_filename (cfs, FileName[f_ptr], NULL, dump_file, &colerrno)) + { + if (f_ptr) + { + cole_perror (PRGNAME, colerrno); + if (colerrno == COLE_EFILENOTFOUND) + fprintf(stderr, "Section: PowerPoint Document\n"); + break; + } + else /* Don't do this... */ + f_ptr++; + } + + if (cole_umount (cfs, &colerrno)) + { + cole_perror ("travel", colerrno); + exit (1); + } + + return 0; +} + + +void dump_file(COLEDIRENT *cde, void *_info) +{ + unsigned long cversion=0, cinstance=0, ctype=0, clength=0, ctarget=0, ccount = 0; + unsigned char buf[16]; + COLEFILE *cf; + COLERRNO err; + + cf = cole_fopen_direntry(cde, &err); + +/* Ouput Header */ + printf("\n"); + printf("%s", filename); + printf("\n"); + +/* Output body */ +#if (MODE == 1) + while (cole_fread(cf, buf, 8, &err)) /* For mode >= 1 */ +#else + while (cole_fread(cf, buf, 1, &err)) +#endif + { + if (MODE == 0) + { + if (ccount == 0) + { + cinstance = buf[0]; + ctype = 0; + clength = 0; + ctarget = 80; /* ficticious number */ + printf("\n
\n"); + } + else if (ccount == 1) + { + cinstance |= (buf[0]<<8); + cversion = cinstance &0x000F; + cinstance = (cinstance>>4); + } + else if (ccount == 2) + ctype = (unsigned)buf[0]; + else if (ccount == 3) + ctype |= (buf[0]<<8)&0x00000FFFL; + else if (ccount == 4) + clength = (unsigned)buf[0]; + else if (ccount == 5) + clength |= (buf[0]<<8); + else if (ccount == 6) + clength |= (buf[0]<<16); + else if (ccount == 7) + { + clength |= (buf[0]<<24); + ctarget = clength; + if (cversion == 0x0F) + { + printf("Container"); + ccount = -1; + } + else + printf("Atom"); + printf(" - Version:%02X Instance:%02X, Type:%03X, Length:%08X - ", + (int)cversion, (int)cinstance, (int)ctype, (int)clength); + output_type_string(ctype); + puts("
\n"); + } + if (ccount > 7) + { /* Here is where we want to process the data */ + /* based on the opcode... */ + /* process_atom(buf[0]); */ + if (isprint(buf[0])) + putc(buf[0], stdout); + } + if (ccount == (ctarget+7)) + ccount = 0; + else + ccount++; + } + else /* mode >= 1 */ + { + printf("%02x %02x %02x %02x %02x %02x %02x %02x         ", + (unsigned)buf[0], (unsigned)buf[1], (unsigned)buf[2], (unsigned)buf[3], + (unsigned)buf[4], (unsigned)buf[5], (unsigned)buf[6], (unsigned)buf[7]); + putchar(buf[0]); putchar(buf[1]); + putchar(buf[2]); putchar(buf[3]); + putchar(buf[4]); putchar(buf[5]); + putchar(buf[6]); putchar(buf[7]); + printf("
"); + } + } + +/* Output Tail */ + printf("\n"); + cole_fclose(cf, &err); +} + +static void output_type_string(int type) +{ + switch (type) + { + case 0x0001: + puts("SubContainerCompleted"); + break; + case 0x0002: + puts("IRRAtom"); + break; + case 0x0003: + puts("PSS"); + break; + case 0x0004: + puts("SubContainerException"); + break; + case 0x0006: + puts("ClientSignal1"); + break; + case 0x0007: + puts("ClientSignal2"); + break; + case 0x000A: + puts("PowerPointStateAtom"); + break; + case 0x03E8: + puts("Document"); + break; + case 0x03E9: + puts("Document Atom"); + break; + case 0x03EA: + puts("End Document"); + break; + case 0x03EB: + puts("Slide Persist"); + break; + case 0x03EC: + puts("SlideBase"); + break; + case 0x03ED: + puts("SlideBase Atom"); + break; + case 0x03EE: + puts("Slide"); + break; + case 0x03EF: + puts("Slide Atom"); + break; + case 0x03F0: + puts("Notes"); + break; + case 0x03F1: + puts("Notes Atom"); + break; + case 0x03F2: + puts("Environment"); + break; + case 0x03F3: + puts("SlidePersistAtom"); + break; + case 0x03F4: + puts("Scheme"); + break; + case 0x03F5: + puts("Scheme Atom"); + break; + case 0x03F6: + puts("DocViewInfo"); + break; + case 0x03F7: + puts("SlideLayout Atom"); + break; + case 0x03F8: + puts("MainMaster"); + break; + case 0x03F9: + puts("SlideInfo Atom"); + break; + case 0x03FA: + puts("SlideViewInfo"); + break; + case 0x03FB: + puts("Guide Atom"); + break; + case 0x03FC: + puts("ViewInfo"); + break; + case 0x03FD: + puts("ViewInfo Atom"); + break; + case 0x03FE: + puts("SlideViewInfo Atom"); + break; + case 0x03FF: + puts("VBAInfo"); + break; + case 0x0400: + puts("VBAInfo Atom"); + break; + case 0x0401: + puts("SSDocInfo Atom"); + break; + case 0x0402: + puts("Summary"); + break; + case 0x0403: + puts("Texture"); + break; + case 0x0404: + puts("VBASlideInfo"); + break; + case 0x0405: + puts("VBASlideInfo Atom"); + break; + case 0x0406: + puts("DocRoutingSlip"); + break; + case 0x0407: + puts("OutlineViewInfo"); + break; + case 0x0408: + puts("SorterViewInfo"); + break; + case 0x0409: + puts("ExObjList"); + break; + case 0x040A: + puts("ExObjList Atom"); + break; + case 0x040B: + puts("PPDrawingGroup"); + break; + case 0x040C: + puts("PPDrawing"); + break; + case 0x0410: + puts("NamedShows - Several"); + break; + case 0x0411: + puts("NamedShow - One"); + break; + case 0x0412: + puts("NamedShowSlides"); + break; + case 0x07D0: + puts("List"); + break; + case 0x07D5: + puts("Font Collection"); + break; + case 0x07E1: + puts("ListPlaceHolder"); + break; + case 0x07E3: + puts("BookMarkCollection"); + break; + case 0x07E4: + puts("SoundCollection"); + break; + case 0x07E5: + puts("SoundColl Atom"); + break; + case 0x07E6: + puts("Sound"); + break; + case 0x07E7: + puts("SoundData"); + break; + case 0x07E9: + puts("BookMarkSeed Atom"); + break; + case 0x07EA: + puts("GuideList"); + break; + case 0x07EB: + puts("RunArray"); + break; + case 0x07EC: + puts("RunArray Atom"); + break; + case 0x07ED: + puts("ArrayElement Atom"); + break; + case 0x07EE: + puts("Int4Array Atom"); + break; + case 0x07EF: + puts("ColorScheme Atom"); + break; + case 0x07F0: + puts("ColorSchemeAtom"); + break; + case 0x0BC0: + puts("OEShape"); + break; + case 0x0BC1: + puts("ExObjRef Atom"); + break; + case 0x0BC3: + puts("OEPlaceholder Atom"); + break; + case 0x0BCC: + puts("GrColor"); + break; + case 0x0BD1: + puts("Grect Atom"); + break; + case 0x0BD7: + puts("GRatio Atom"); + break; + case 0x0BD8: + puts("GScaling"); + break; + case 0x0BDA: + puts("GPoint Atom"); + break; + case 0x0BDB: + puts("OEShape Atom"); + break; + case 0x0F9E: + puts("OutlineTextRef Atom"); + break; + case 0x0F9F: + puts("TextHeader Atom"); + break; + case 0x0FA0: + puts("TextChars Atom"); + break; + case 0x0FA1: + puts("StyleTextProp Atom"); + break; + case 0x0FA2: + puts("BaseTextProp Atom"); + break; + case 0x0FA3: + puts("TxMasterStyle Atom"); + break; + case 0x0FA4: + puts("TxCFStyle Atom"); + break; + case 0x0FA5: + puts("TxPFStyle Atom"); + break; + case 0x0FA6: + puts("TextRuler Atom"); + break; + case 0x0FA7: + puts("TextBookMark Atom"); + break; + case 0x0FA8: + puts("TextBytes Atom"); + break; + case 0x0FA9: + puts("TxSiStyle Atom"); + break; + case 0x0FAA: + puts("TextSpecInfo"); + break; + case 0x0FAB: + puts("DefaultRuler Atom"); + break; + case 0x0FB7: + puts("FontEntity Atom"); + break; + case 0x0FB8: + puts("FontEmbedData"); + break; + case 0x0FB9: + puts("TypeFace"); + break; + case 0x0FBA: + puts("CString"); + break; + case 0x0FBB: + puts("ExternalObject"); + break; + case 0x0FC1: + puts("MetaFile"); + break; + case 0x0FC2: + puts("ExOleObj"); + break; + case 0x0FC3: + puts("ExOleObj Atom"); + break; + case 0x0FE9: + puts("ExQuickTime"); + break; + case 0x0FD9: + puts("HeadersFooters"); + break; + case 0x0FDA: + puts("HeadersFooters Atom"); + break; + case 0x0FF0: + puts("SlideListWithText"); + break; + case 0x0FF1: + puts("AnimationInfoAtom"); + break; + case 0x0FF2: + puts("InteractiveInfo"); + break; + case 0x0FF5: + puts("UserEditAtom"); + break; + case 0x0FF6: + puts("CurrentUserAtom"); + break; + case 0x0FF7: + puts("DateTimeMCAtom "); + break; + default: + puts("Unknown Type"); + break; + } +} + diff --git a/ppthtml/ppthtml.1 b/ppthtml/ppthtml.1 new file mode 100644 index 0000000..ce81442 --- /dev/null +++ b/ppthtml/ppthtml.1 @@ -0,0 +1,26 @@ +.TH ppthtml 1 "October 13, 2001" "ppthtml" + +.SH NAME +ppthtml \- A program for converting Microsoft Power Point Files .ppt + +.SH SYNOPSIS +.B ppthtml +.RI Filename +.br + +.SH DESCRIPTION +This manual page explains the +.B ppthtml +program. The program +.B ppthtml +is used to convert Microsoft Power Point files into either html or tab delimitted ASCII. The program can be interfaced with helper scripts for viewing email attachments. Most use of this program is through the helper scripts and one would probably rarely resort to using the commandline interface. + +.SH NOTES +To interface to Netscape Navigator: first locate the help scripts nspptview & nsopen. Go into the Edit Preferences dialog box. Click on the Navigator Category and hilight the Applications menu item. Look for Microsoft Excel Worksheet. If you don't see it create one. The MIME type should be: application/vnd.ms-powerpoint The suffixes should be: ppt,ppa,pps,pot,pwz In the handled by section of the dialog box, check the Application checkbox and set the path to wherever the nspptview helper script is located and pass a %s argument. For example, if nspptview is located in /usr/local/bin, then you would put: + +/usr/local/bin/nspptview %s + +in the Application path box.. (As a side note, make sure the nspptview script can find the ppthtml program or it won't work.) Click on the OK and you are done. You should be able to use the Test.ppt file that is distributed with the program to verify its configured correctly. + +.SH AUTHOR +Charles N Wyble diff --git a/ppthtml/ppthtml.c b/ppthtml/ppthtml.c new file mode 100644 index 0000000..35fa42e --- /dev/null +++ b/ppthtml/ppthtml.c @@ -0,0 +1,429 @@ +/* + pptHtml - Format a PowerPoint Presentation into Html + Copyright 2002 Charles N Wyble + + 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 + */ + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "config.h" /* Created by ./configure script */ +#include "support.h" /* Needs to be before internal.h */ +#include "internal.h" /* Needs to be before cole */ +#include "cole.h" +#else +#include "config.h.in" /* Created by ./configure script */ +#include "support.h" /* Needs to be before internal.h */ +#include "internal.h" /* Needs to be before cole */ +#include "cole.h.in" +#include +#endif + +#include +#include /* for strcpy() */ +#include /* For isprint */ +#include /* For exitt() */ + + +#define PRGNAME "pptHtml" +#if !(defined( __WIN32__ ) || defined( __BORLANDC__ )) +#define PRGVER VERSION +#else +#define PRGVER "0.4" +#endif +#define WORK_SIZE 8192 +static char FileName[2][32] = /* The section of the PowerPoint File we read */ +{ + "/PowerPoint Document", /* Power Point 97 & 2000 */ + "/PP40" /* Everything else ? */ +}; + + +/* Function Prototypes */ +COLE_LOCATE_ACTION_FUNC dump_file; +static void container_processor(int); +static void atom_processor(int, int, int, unsigned char); +static void print_unicode(unsigned char *, int); +static void print_utf8(unsigned short c); +static void put_utf8(unsigned short c); + +/* Global data */ +static char filename[128]; +static unsigned char working_buffer[WORK_SIZE]; +static int buf_idx=0; +static int output_this_container = 0; +static int past_first_slide = 0; +static int last_container = 0; + +int main (int argc, char **argv) +{ + int f_ptr = 0; + COLEFS * cfs; + COLERRNO colerrno; + + if (argc < 2) + { + fprintf (stderr, "pptHtml - Outputs Power Point files as Html.\n" + "Usage: "PRGNAME" \n"); + exit (1); + } + else + { + strncpy(filename, argv[1], 124); +#if defined( __WIN32__ ) || defined( __BORLANDC__ ) + { + char *ptr = strchr(filename, ':'); + if (ptr) + { + int len; + char new_drive[MAXPATH]; + fnsplit(filename, new_drive, 0, 0, 0); + if (new_drive[0] >= 'a') + setdisk(new_drive[0] - 'a'); + else + setdisk(new_drive[0] - 'A'); + ptr++; /* Get past the colon */ + len = strlen(ptr); + memmove(filename, ptr, len); + filename[len] = 0; + } + } +#endif + cfs = cole_mount (filename, &colerrno); + if (cfs == NULL) + { + cole_perror (PRGNAME, colerrno); + exit (1); + } + } + + while (cole_locate_filename (cfs, FileName[f_ptr], NULL, dump_file, &colerrno)) + { + if (f_ptr) + { /* Two strikes...we're out! */ + cole_perror (PRGNAME, colerrno); + if (colerrno == COLE_EFILENOTFOUND) + fprintf(stderr, "Section: PowerPoint Document\n"); + break; + } + else /* Don't do this... */ + f_ptr++; + } + + if (cole_umount (cfs, &colerrno)) + { + cole_perror ("travel", colerrno); + exit (1); + } + + return 0; +} + + +void dump_file(COLEDIRENT *cde, void *_info) +{ + unsigned long version=0, instance=0, type=0, length=0, target=0, count=0; + unsigned char buf[16]; + COLEFILE *cf; + COLERRNO err; + + cf = cole_fopen_direntry(cde, &err); + +/* Ouput Header */ + printf("\n"); + printf("%s", filename); + printf("\n"); + +/* Output body */ + while (cole_fread(cf, buf, 1, &err)) + { + if (count == 0) + { + instance = buf[0]; + type = 0; + length = 0; + target = 80; /* ficticious number */ + } + else if (count == 1) + { + instance |= (buf[0]<<8); + version = instance &0x000F; + instance = (instance>>4); + } + else if (count == 2) + type = (unsigned)buf[0]; + else if (count == 3) + type |= (buf[0]<<8)&0x00000FFFL; + else if (count == 4) + length = (unsigned)buf[0]; + else if (count == 5) + length |= (buf[0]<<8); + else if (count == 6) + length |= (buf[0]<<16); + else if (count == 7) + { + length |= (buf[0]<<24); + target = length; + if (version == 0x0F) + { /* Do container level Processing */ + container_processor(type); + count = -1; + } + } + if (count > 7) + { /* Here is where we want to process the data + based on the Atom type... */ + atom_processor(type, count-8, target-1, buf[0]); + } + if (count == (target+7)) + count = 0; + else + count++; + } + + if (past_first_slide) + printf("
"); + + printf(" 
\n"); + + /* Output Credit */ + printf("
Created with pptHtml %s
\n", PRGVER); + + /* Output Tail */ + printf("\n"); + cole_fclose(cf, &err); +} + +static void container_processor(int type) +{ + if (type == 0x03EE) + { + if (past_first_slide) + printf("


\n"); + else + past_first_slide = 1; + } + switch (type) + { + case 0x000D: + if (last_container == 0x11) /* suppress notes info */ + output_this_container = 0; + else + output_this_container = 1; + break; + case 0x0FF0: + output_this_container = 1; + break; + default: +/* printf("Cont:%x|\n", type); */ + output_this_container = 0; + break; + } + last_container = type; +} + +static void atom_processor(int type, int count, int buf_last, unsigned char data) +{ + if ((buf_idx >= WORK_SIZE)||(output_this_container == 0)) + return; + + if (count == 0) + { + memset(working_buffer, 0, WORK_SIZE); + buf_idx = 0; + } + + switch (type) + { + case 0x0FA0: /* Text String in unicode */ + working_buffer[buf_idx++] = data; + if (count == buf_last) + { +/* printf("Atom:%x|\n", type); */ +/* working_buffer[buf_idx++] = 0; */ +/* printf("%s
\n", working_buffer); */ + print_unicode(working_buffer, buf_idx); + printf("
\n"); + } + break; + case 0x0FA8: /* Text String in ASCII */ + working_buffer[buf_idx++] = data; + if (count == buf_last) + { + int i; +/* working_buffer[buf_idx++] = 0; */ +/* printf("Atom:%x|\n", type); */ + for (i=0;i\n"); + else + putchar(working_buffer[i]); + } + printf("
\n"); + } + break; + case 0x0FBA: /* CString - unicode... */ + working_buffer[buf_idx++] = data; + if (count == buf_last) + { +/* working_buffer[buf_idx++] = 0; */ +/* printf("%s
\n", working_buffer); */ +/* printf("Atom:%x|\n", type); */ + print_unicode(working_buffer, buf_idx); + printf("
\n"); + } + break; + default: + break; + } +} + +static void print_unicode(unsigned char *ucs, int len) +{ + int i; + for (i = 0; i < len; i += 2) + print_utf8(ucs[i] | (ucs[i+1] << 8)); +} + +static void OutputCharCorrected(unsigned char c) +{ + switch (c) + { /* Special char handlers here... */ + case '\r': + printf("
\n"); + break; + case 0x3C: + printf("<"); + break; + case 0x3E: + printf(">"); + break; + case 0x26: + printf("&"); + break; + case 0x22: + printf("""); + break; + /* Also need to cover 128-159 since MS uses this area... */ + case 0x80: /* Euro Symbol */ + printf("€"); + break; + case 0x82: /* baseline single quote */ + printf("‚"); + break; + case 0x83: /* florin */ + printf("ƒ"); + break; + case 0x84: /* baseline double quote */ + printf("„"); + break; + case 0x85: /* ellipsis */ + printf("…"); + break; + case 0x86: /* dagger */ + printf("†"); + break; + case 0x87: /* double dagger */ + printf("‡"); + break; + case 0x88: /* circumflex accent */ + printf("ˆ"); + break; + case 0x89: /* permile */ + printf("‰"); + break; + case 0x8A: /* S Hacek */ + printf("Š"); + break; + case 0x8B: /* left single guillemet */ + printf("‹"); + break; + case 0x8C: /* OE ligature */ + printf("Œ"); + break; + case 0x8E: /* #LATIN CAPITAL LETTER Z WITH CARON */ + printf("Ž"); + break; + case 0x91: /* left single quote ? */ + printf("‘"); + break; + case 0x92: /* right single quote ? */ + printf("’"); + break; + case 0x93: /* left double quote */ + printf("“"); + break; + case 0x94: /* right double quote */ + printf("”"); + break; + case 0x95: /* bullet */ + printf("•"); + break; + case 0x96: /* endash */ + printf("–"); + break; + case 0x97: /* emdash */ + printf("—"); + break; + case 0x98: /* tilde accent */ + printf("˜"); + break; + case 0x99: /* trademark ligature */ + printf("™"); + break; + case 0x9A: /* s Haceks Hacek */ + printf("š"); + break; + case 0x9B: /* right single guillemet */ + printf("›"); + break; + case 0x9C: /* oe ligature */ + printf("œ"); + break; + case 0x9F: /* Y Dieresis */ + printf("Ÿ"); + break; + default: + putchar(c); + break; + } +} + +static void print_utf8(unsigned short c) +{ + if (c == 0) + return; + + if (c < 0x80) + OutputCharCorrected(c); + else if (c < 0x800) + { + putchar(0xC0 | (c >> 6)); + put_utf8(c); + } + else + { + putchar(0xE0 | (c >> 12)); + put_utf8(c >> 6); + put_utf8(c); + } +} + +static void put_utf8(unsigned short c) +{ + putchar(0x0080 | ((short)c & 0x003F)); +} + diff --git a/stamp-h.in b/stamp-h.in new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/stamp-h.in @@ -0,0 +1 @@ +timestamp diff --git a/xlhtml/ChangeLog b/xlhtml/ChangeLog new file mode 100644 index 0000000..1ac75cc --- /dev/null +++ b/xlhtml/ChangeLog @@ -0,0 +1,198 @@ + xlHtml ChangeLog + + +0.4.9.3 03/19/02 + *Began code modularization + *Changed pointers to xlhtml web site + +0.4.9.2 03/13/02 + *Turned over xlhtml to Charles Wyble + *Added a patch to support bold formatting + +0.4.9.1 03/10/02 + * Fixed bug in cole.c which causes errors reading ppthtml files - Takahiro Kamba + * Fixed bug in page name output for non-html output + * xlhtml now uses Microsoft CodePages - Victor Wagner + +0.4.9.0 12/09/01 + * Cleanup of cole library to pass lint better + * Added command line switches for --help --ascii, usage - Charles Wyble + * Don't read past buffer end on malformed fonts. + +0.4 12/03/01 + * removed spurrious tab before closing XML tag - Mike Ralphson + * Fixed bug in trim edges + * Many signed / unsigned cleanups + * Updated the xldump utility - Charles Wyble + * Added xlcdump utility to dump chart information - Charles Wyble + * Added doxygen doco generation - Rafael Kitover + * Added patch to support String Formulas - Rafael Kitover + * Changed unsupported numeric formats to output using floating point + technique with the decimal suppressed. Was truncating to MAXINT. + * Fixed bug where CSV was not escaping currency fields - Rafael Kitover + * Fixed bug where unknown field types were not escaped in CSV + - Rafael Kitover + * Fixed bug in cell merging where the whole row was selected + * Fixed bug in mailto hyperlink + * Now supports custom colors + * New command line option -nh to suppress header & body tags in html + * Fixed bug where tab delimited was allowing an extra tab at the EOL + * Fixed bug in blank cells for CSV output - Thorsten Koch + * Added test for negative value in cole_fread + * Optimized html further so it suppresses alignment of blank rows + * Improved portability to DOS & WIN32 + * Moved everything over to U8, U16, U32, F32, & F64 data types. This is in + effort to improve support on 64 bit platforms. + * Added the xlv script from Asher Blum + +0.3 10/19/01 + * Added drive letter check for DOS & Windows + * Fixed situation where ellipses were not being rendered correctly + * Fixed Unicode problem in Label Cells + * Fixed problem where cells created by row data were not being updated + when the cell was officially created. + * Program renamed to xlhtml...all lowercase. + * Moved xlHtml over to a new makefile system. It does a static build now. + * Finished moving cole library to mkstemp from tempnam() + * Cole library unlinks temp files after opening so they are deleted + * Fixed Numeric formats that need a comma + * Fixed font name to not have Rich Text + * Added bounds checking to Row Info opcode + * Fixed hyperlinks that are unicode. + * Scripts changed to use mkstemp + * Added support for many currency & accounting formats + * Aggressive optimizations make smaller html now + * Fixed several cases where Ascii output had html in it + * Added CSV output patch from Rob Arnold + * Added support for multiple fonts in same cell + * Added patch for continuation from Hironori + * Added support for multiple style attributes in same cell + * Added support for Hyperlinks + * Added XML patch from Jason Venner + * Added xls-handler for Apache + +0.2.8 01/14/2001 + * Added man page + * Improved Error Messages - David Brukman + * Added empty SST strings - David Brukman + * Fixed bug in RKtoDouble - David Brukman + * Fixed extended string + rich string + * Fixed a misplaced array initialization for ws_array + * Fixed problem where the html closing tags were being output during error + messages when -asc option was given + * Changed all the comments over to standard C comments for increased + portability + +0.2.6 12/26/1999 + * xlHtml is now self-scaling to whatever xls file you are viewing + * More Unicode fixups + * Added -m command line option to suppress multibyte + * Added -asc & -dp commandline options to get ascii output and dump + spreadsheet parameters. + * Added -xp -xc -xr commandline options to extract a range of columns and + rows on a page. This will facilitate integration with gnuplot. + * Fixed RK floating point bug + * Increased precision from 6 digits to 15 digits. + +0.2.4 12/04/1999 + * Added Cell Merging capabilities + * Added -te command line option to "trim the edges" (empty rows or + columns at the edges of a worksheet). + * Added the contributed excel2text script to let mutt clients see xls + attachments + * Added a -v command line switch for version information + * Added code to optimize font size statements similar to font face + * Fixed Unicode bugs in font name and sheet name - Thanks Hironori ! + * Re-wrote the cole_fread function. Changes were submitted to Arturo. + +0.2.2 11/05/1999 + * Fixed problem with date calculation + * Fixed cells that had a string with only spaces in it + * Unicode, unicode, unicode + * Fixed a formula handling error for Excel 95 + * Many little bug fixes + * Ported to Borland C++ 5.0 under Win32 + +0.2.0 10/11/1999 + * Added support for fraction data formats + * Added -c command line option to center tables + * Added -bc command line option to override the background color + * Added -tc command line optine to override the text color + * Added -bi command line option to add a background image + * Added better support for Excel 95 & 5.0. Had to disable + colors since it looked crazy. Probably has a different palette. + * Added -a command line to use aggressive optimization. This doesn't + generate closing tags for TD & TR tags. This could be a problem + for older browsers. + * Further reduced generated html output. + * Program now displays the last saved value of a formula. + * Added command line option to suppress warning that formula data + may be stale or inaccurate. + * Updated uploader.pl documentation + * Added nsopen *bash* script in contrib directory + +0.1.8 9/29/1999 + * Added support for text built-in cell format + * Reduced the amount of html output + * Upgraded to the cole-2.0.1 Library + * Moved xlHtml and all its files into the xlHtml directory + +0.1.6 9/25/1999 + * Re-designed the Test.xls file to really workout xlHtml + * Added support for most built-in cell formats :date, time, + number, and scientific formats + * Added support for general formatting + * Fixed MS induced glitch in LabelSST - only very large files + would have this problem. + * Fixed bug in default Row XF's - only seen in colored blank cells + * Optimized html tags. Avg 40% less html! + * Added more documentation in README-xlHtml + * Cleaned out document folder. It had some files that were created + from the ./configure script. Reduced total tar size significantly. + * Fixed bug in RK number conversion + +0.1.4 9/15/1999 + * Added support for Sub & Superscripting + * Added -nc command line option to uncolored output + * Added support for font sizes + * Added support for vertical alignment + * Added 16 more colors to built-in palette + * Added default row formatting + * Added support for left, center, & right justification + +0.1.2 9/11/1999 + * Added Support for Bold, Underline, and Itallics Fonts + * Now extracts Font Name + * Colorizes Fonts based on default palette - 40 colors + * Continue Record Support added for big files + * Better protection for corrupt files + +0.1.0 8/23/1999 + * Added Support for RK & MulRK cells + * Now pulls the title & last updated date from Global Data + * Added stubs for all cell types that will be supported + * Minor corrections based on BIFF8 specs + +0.0.6 08/20/1999 + * Added support for Multiple Worksheets + * Added support for BoolErr for Office 97 files + * Added support for Worksheet's title from the tab + * Test.xls in examples directory is now Multi-worksheet + +0.0.4 08/17/1999 + * Added support for Floating Point (Number) Cells + * Added basic support to collect font info + * Added basic support to collect cell attributes + * Added several error messages + * Added lots of comments to the code + +0.0.2 08/13/1999 First public release. + * Packaged with the cole library and hacked the Makefile and configure + scripts. + * added disclaimer for floating point since its not correct. + * string support is finished. + * Labels are now supported. + +0.0.1 08/8/1999 Initial Release. + *So far it supports most strings, empty cells, and integers. + diff --git a/xlhtml/Makefile.am b/xlhtml/Makefile.am new file mode 100644 index 0000000..677cdf9 --- /dev/null +++ b/xlhtml/Makefile.am @@ -0,0 +1,23 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = README ChangeLog TODO THANKS Test.xls Test.html xlhtml.1 + +INCLUDES = -I../cole +noinst_PROGRAMS = xldump xlcdump +noinst_SCRIPTS = xls-handler gpdemo +man_MANS = xlhtml.1 +bin_SCRIPTS = nsopen nsxlview +bin_PROGRAMS = xlhtml +LDADD = ../cole/libcole.a +xlhtml_SOURCES = support.c xlhtml.c +xldump_SOURCES = xldump.c +xlcdump_SOURCES = xlcdump.c +AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith + +doc: + @echo Generating documentation... + doxygen doxygen.conf + @echo done. + +distclean: + rm -rf doc diff --git a/xlhtml/Makefile.in b/xlhtml/Makefile.in new file mode 100644 index 0000000..db3de13 --- /dev/null +++ b/xlhtml/Makefile.in @@ -0,0 +1,398 @@ +# Makefile.in generated automatically by automake 1.4-p4 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +COLE_MAJOR = @COLE_MAJOR@ +COLE_MICRO = @COLE_MICRO@ +COLE_MINOR = @COLE_MINOR@ +HOST_ALIAS_NAME = @HOST_ALIAS_NAME@ +HOST_CANONICAL_NAME = @HOST_CANONICAL_NAME@ +HOST_CPU = @HOST_CPU@ +HOST_OS = @HOST_OS@ +HOST_VENDOR = @HOST_VENDOR@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +EXTRA_DIST = README ChangeLog TODO THANKS Test.xls Test.html xlhtml.1 + +INCLUDES = -I../cole +noinst_PROGRAMS = xldump xlcdump +noinst_SCRIPTS = xls-handler gpdemo +man_MANS = xlhtml.1 +bin_SCRIPTS = nsopen nsxlview +bin_PROGRAMS = xlhtml +LDADD = ../cole/libcole.a +xlhtml_SOURCES = support.c xlhtml.c +xldump_SOURCES = xldump.c +xlcdump_SOURCES = xlcdump.c +AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +xlhtml_OBJECTS = support.o xlhtml.o +xlhtml_LDADD = $(LDADD) +xlhtml_DEPENDENCIES = ../cole/libcole.a +xlhtml_LDFLAGS = +xldump_OBJECTS = xldump.o +xldump_LDADD = $(LDADD) +xldump_DEPENDENCIES = ../cole/libcole.a +xldump_LDFLAGS = +xlcdump_OBJECTS = xlcdump.o +xlcdump_LDADD = $(LDADD) +xlcdump_DEPENDENCIES = ../cole/libcole.a +xlcdump_LDFLAGS = +SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) + +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +man1dir = $(mandir)/man1 +MANS = $(man_MANS) + +NROFF = nroff +DIST_COMMON = README ChangeLog Makefile.am Makefile.in THANKS TODO + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(xlhtml_SOURCES) $(xldump_SOURCES) $(xlcdump_SOURCES) +OBJECTS = $(xlhtml_OBJECTS) $(xldump_OBJECTS) $(xlcdump_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps xlhtml/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 " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(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: + +xlhtml: $(xlhtml_OBJECTS) $(xlhtml_DEPENDENCIES) + @rm -f xlhtml + $(LINK) $(xlhtml_LDFLAGS) $(xlhtml_OBJECTS) $(xlhtml_LDADD) $(LIBS) + +xldump: $(xldump_OBJECTS) $(xldump_DEPENDENCIES) + @rm -f xldump + $(LINK) $(xldump_LDFLAGS) $(xldump_OBJECTS) $(xldump_LDADD) $(LIBS) + +xlcdump: $(xlcdump_OBJECTS) $(xlcdump_DEPENDENCIES) + @rm -f xlcdump + $(LINK) $(xlcdump_LDFLAGS) $(xlcdump_OBJECTS) $(xlcdump_LDADD) $(LIBS) + +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 + +install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done + +uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-man1 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 + +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 = xlhtml + +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-binPROGRAMS install-binSCRIPTS +install-exec: install-exec-am + +install-data-am: install-man +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-binSCRIPTS uninstall-man +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir) \ + $(DESTDIR)$(mandir)/man1 + + +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-binPROGRAMS mostlyclean-noinstPROGRAMS \ + mostlyclean-compile mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \ + clean-tags clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-noinstPROGRAMS \ + distclean-compile distclean-tags distclean-generic \ + clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-noinstPROGRAMS \ + maintainer-clean-compile 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 uninstall-binSCRIPTS install-binSCRIPTS \ +install-man1 uninstall-man1 install-man uninstall-man 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 + + +doc: + @echo Generating documentation... + doxygen doxygen.conf + @echo done. + +distclean: + rm -rf doc + +# 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: diff --git a/xlhtml/README b/xlhtml/README new file mode 100644 index 0000000..c33ffa7 --- /dev/null +++ b/xlhtml/README @@ -0,0 +1,123 @@ +Welcome to xlhtml. + + +I. INTRODUCTION +The xlhtml program will take an Excel 95, or 97 file as input and convert +it to highly optimized html. The output is via standard out so it can be +re-directed to files or piped to filters or used as a gateway on the internet. + +II. INSTALLATION +If you are upgrading, run the 'make uninstall' target from the original directory +before following these steps. + +To build this application, from the top directory type: + + ./configure --prefix=/ + make + make install + +Then to finish it up, you will need to go into netscape and tell the navigator +to use the nsxlview script to handle Microsoft Excel files. + + e.g. /nsxlview %s + +You should be able to then browse to a file and open it. There is a file +included in the xlhtml directory you can test with: Test.xls. + +The shell scripts: nsxlview & nsopen may need modification to correct the +paths to fit your system. Also, depending on where you install it, you +may have to modify your PATH environmental variable. + + +III. UNINSTALLING +You may want to keep this directory around since you can do a make uninstall +later. In the meantime, I suggest doing a make clean after installation to +minimize disk space useage. + + +IV. COMMANDLINE OPTIONS +xlhtml now has several command line options that let you tailor its output. The +command is now: xlhtml [-nc -a -fw -bc -tc -bi -c] file.xls + +Where -nc tells it not to colorize the output. + -a aggressively optimize html by removing or VALIGN="bottom" + Some older browsers may not display properly in this mode. + -fw suppress formula warnings about accuracy + -bc Override the background color. e.g. -bg808080 for gray + -tc Override the text color. e.g. -tcFF0000 for red + -bi Use background image e.g. -bi/home/httpd/icon/tar.gif + -c Centers the tables horizontally + -te Trims empty rows & columns at the edges of a worksheet + -v Prints program version + -m No encoding for multibyte + -asc Ascii out of -dp and extraction data (-x?) + -dp Dump page count and max columns and rows per page + -xp Page for extraction (zero based) + -xc Columns (separated by a dash) for extraction (zero based) + -xr Rows (separated by a dash) to be extracted (zero based) + +An example of the extraction command line is: +xlhtml -fw -asc -xp:0 -xr:2-6 -xc:0-1 Test.xls + +The extraction output is: + Formatted output of cells by column left to right, columns separated + by a tab, end of row is: 0x0A, end of file: \n\n + + *NOTE: Run the gpdemo file for a demonstration plot in Netscape. Also, + you MUST specify all 3 -x commands or the results may not be as desired. + + +V. PERFORMANCE TUNING +There are some user "tunable" parameters in the beginning of the xlhtml.c file. +The program allocates resources in chunks so that it scales efficiently without +wasting memory. The smaller the chunks, the less wasted memory. The trade off, +though, is that it has to allocate memory more often - which slows things down. +Odds are, you should never need to change them from the default. + + +VI. INTERNATIONAL CHARACTERS +xlhtml uses three different character sets. It tries to use ascii until it +finds a character greater than 127. At this point, it switches to the +windows-1252 characterset. If the excel file specifies any 2 byte characters, +it switches to utf-8. This handles most situations correctly. If however, +you find yourself with a system that does not support utf-8 (text mode +browsers & some versions of unix) and you need multi-byte support, +try using the program lv.It can be downloaded from: + + http://www.ff.iij4u.or.jp/~nrt/lv/ + +The text only browser, w3m, could be used as follows for Japanese: + + xlhtml file.xls | lv -Iu8 -Oej | w3m -T text/html + + (Thanks to Hironori Sakamoto for this suggestion.) + + +VII. TROUBLESHOOTING +Using Netscape, you may occassionally see a file not found error. This usually +comes when printing or going back to a previously converted file. This is +the default behavior and it can be changed by commenting out the rm $tmp* +in nsxlview. I do this so you don't have files hanging around in your tmp +directory where other people might be able to see them. + +In general, if you can type xlhtml and get a usage error message, the PATH +is working. If you don't, your PATH environmental variable needs adjusting. +Next try passing the full path to xlhtml of the file you want converted. If it +has problems with it, you may have a file the system can't interpret. To check +your installation, try passing the full path of xlhtml/Test.xls and see what +it does with that. + +If you get an error message saying "get another compiler"...this comes from the +cole library. It needs a recent copy of automake, autoconf, or libtool. You +can manually adjust the header files if you know you machine data sizes. + + +VIII. CONTRIBUTED SCRIPTS +xlhtml now has a contributed scripts directory. If you look in the xlhtml/contrib +directory you will find what people are giving me. I cannot offer support for +files I didn't create, but there is contact information with the files. If you +have something to share...send it to me. If you've contributed...THANKS! + + +Charles N Wyble +jackshck@yahoo.com diff --git a/xlhtml/THANKS b/xlhtml/THANKS new file mode 100644 index 0000000..e684f0c --- /dev/null +++ b/xlhtml/THANKS @@ -0,0 +1,12 @@ + + Arturo Tena for the cole 2.0 library + Caolan McNamara for MSWordView...where I got the nsopen & nsxlview scripts + David Nicol for the Uploader Perl script + Bradley Marshall for converting the nsxlview & nsopen scripts to bash + Glen Stewart for rounding up the convertXLS scripts + Hironori Sakamoto for several BIG unicode patches + Gary Johnson for the excel2text mutt script + David Brukman for xlhtml patch + Jason Venner for the XML patch + Asher Blum for the xlv script + diff --git a/xlhtml/TODO b/xlhtml/TODO new file mode 100644 index 0000000..2249862 --- /dev/null +++ b/xlhtml/TODO @@ -0,0 +1,5 @@ +0.4 ? +Fix nasty Unicode bug when very large shared string tables are encountereds +Support String formulas +Reduce memory footprint +Support data types by using their format string diff --git a/xlhtml/Test.xls b/xlhtml/Test.xls new file mode 100644 index 0000000..02e12e7 Binary files /dev/null and b/xlhtml/Test.xls differ diff --git a/xlhtml/contrib/convertXLS.cgi b/xlhtml/contrib/convertXLS.cgi new file mode 100755 index 0000000..9ed46dd --- /dev/null +++ b/xlhtml/contrib/convertXLS.cgi @@ -0,0 +1,406 @@ +#!/usr/bin/perl +# +# File Upload Script, slightly modified by Caolan.McNamara@ul.ie to +# serve as a msword to html gateway. +# original notice follows +# +# modify lines 89 & 401 for your own configuration. +# +# +# +# +# File Upload Script Version 6.00 +# Created by Jeff Carnahan jeffc@terminalp.com +# Created on: 4/8/95 Last Modified on: 01/23/98 23:06 +# Scripts Archive: http://www.terminalp.com/scripts/ +# +# --------------------------------------------------------------------- +# +# Copyright (C) 1996 Jeffrey D. Carnahan +# +# 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. +# +# A full copy of the GNU General Public License can be retrieved from +# http://www.terminalp.com/scripts/license.shtml +# +# - Jeff Carnahan Variable: + # $SAVE_DIRECTORY + # --> Function: + # Defines the path to the directory + # on the server that should be used + # as the folder to save files into. + # --> Directory Permissions: + # a+rwx + # --> Additional Notes: + # This path should not have a + # trailing forward slash. Also + # remember that this is a path, not + # a URL. Use something similar to: + # + # /home/myself/www/uploads + # + + $MAXIMUM_UPLOAD = 0; + # + # --> Variable: + # $MAXIMUM_UPLOAD + # --> Function: + # Defines the number of bytes that + # can be uploaded. Files that exceed + # this limit will not be saved on the + # server. + # --> Additional Notes: + # Set this to zero in order to + # disable size checking. + # + + $ALLOW_INDEX = 0; + # + # --> Variable: + # $ALLOW_INDEX + # --> Function: + # If set to zero, files whose + # names begin with the word + # index will not be saved. + # + # Set to one to allow files + # named index* to be uploaded. + # --> Additional Notes: + # + + $SUCCESS_LOCATION = "" + # + # --> Variable: + # $SUCCESS_LOCATION + # --> Function: + # Defines the URL that users + # should be redirected to if + # the script works properly. If + # this is left blank, a default + # page will be returned to the + # user. + # --> Additional Notes: + # This is a COMPLETE URL, not + # a path. +} +# +# End of Configurable Options. +# --------------------------------------------------------------------- +# --------------------------------------------------------------------- +# --> Do Not Change Anything Below This Line. <-- # +# --------------------------------------------------------------------- +# --------------------------------------------------------------------- + + $| = 1; + chop $SAVE_DIRECTORY if ($SAVE_DIRECTORY =~ /\/$/); + use CGI qw(:standard); + $query = new CGI; + + if ( (!(-e $SAVE_DIRECTORY)) || + (!(-W $SAVE_DIRECTORY)) || + (!(-d $SAVE_DIRECTORY)) ) { + print header; + print <<__END_OF_HTML_CODE__; + + + + Error: Bad Directory + + + + + + + + +
+ +
+
+ + +

Bad Directory

+

+ The directory you specified: +
+

+ \$SAVE_DIRECTORY = "$SAVE_DIRECTORY"; +
+
+ is invalid. This problem is caused by one of the three following reasons: +
    +
  1. The directory doesn't exist. Make sure that this directory is a complete path name, not + a URL or something similar. It should look similar to /home/username/public_html/uploads +

    +

  2. The directory isn't writable. Make sure that this directory is writable by all users. At + your UNIX command prompt, type chmod 777 $SAVE_DIRECTORY +

    +

  3. The directory you specified isn't really a directory. Make sure that this is indeed a directory + and not a file. +
+
+
+ + + +__END_OF_HTML_CODE__ + exit; + } + + foreach $key (sort {$a <=> $b} $query->param()) { + next if ($key =~ /^\s*$/); + next if ($query->param($key) =~ /^\s*$/); + next if ($key !~ /^file-to-upload-(\d+)$/); + $Number = $1; + + if ($query->param($key) =~ /([^\/\\]+)$/) { + $Filename = $1; + $Filename =~ s/^\.+//; + $File_Handle = $query->param($key); + + if (!$ALLOW_INDEX && $Filename =~ /^index/i) { + print header; + print <<__END_OF_HTML_CODE__; + + + + Error: Filename Problem + + + + + + + + +
+ +
+
+ +

Filename Problem

+

+ You attempted to upload a file that isn't properly formatted. The system administrator + has decided that you can't upload files that begin with the word 'index'. Please + rename the file on your computer, and try uploading it again. +

+


+ +
+ + + +__END_OF_HTML_CODE__ + exit; + } + } else { + $FILENAME_IN_QUESTION = $query->param($key); + + print header; + print <<__END_OF_HTML_CODE__; + + + + Error: Filename Problem + + + + + + + + +
+ +
+
+ + +

Filename Problem

+

+ You attempted to upload a file that isn't properly formatted. The file in question + is $FILENAME_IN_QUESTION Please rename the file on your computer, and + attempt to upload it again. Files may not have forward or backward slashes in their + names. Also, they may not be prefixed with one (or more) periods. +

+


+ +
+ + + +__END_OF_HTML_CODE__ + exit; + } + + if (!open(OUTFILE, ">$SAVE_DIRECTORY\/$Filename")) { + print "Content-type: text/plain\n\n"; + print "-------------------------\n"; + print "Error:\n"; + print "-------------------------\n"; + print "File: $SAVE_DIRECTORY\/$Filename\n"; + print "-------------------------\n"; + print "There was an error opening the Output File\n"; + print "for Writing.\n\n"; + print "Make sure that the directory:\n"; + print "$SAVE_DIRECTORY\n"; + print "has been chmodded with the permissions '777'.\n\n"; + print "Also, make sure that if your attempting\n"; + print "to overwrite an existing file, that the\n"; + print "existing file is chmodded '666' or better.\n\n"; + print "The Error message below should help you diagnose\n"; + print "the problem.\n\n"; + print "Error: $!\n"; + exit; + } + + undef $BytesRead; + undef $Buffer; + + while ($Bytes = read($File_Handle,$Buffer,1024)) { + $BytesRead += $Bytes; + print OUTFILE $Buffer; + } + + push(@Files_Written, "$SAVE_DIRECTORY\/$Filename"); + $TOTAL_BYTES += $BytesRead; + $Confirmation{$File_Handle} = $BytesRead; + + close($File_Handle); + close(OUTFILE); + + chmod (0666, "$SAVE_DIRECTORY\/$Filename"); + } + + $FILES_UPLOADED = scalar(keys(%Confirmation)); + + + if ($TOTAL_BYTES > $MAXIMUM_UPLOAD && $MAXIMUM_UPLOAD > 0) { + foreach $File (@Files_Written) { + unlink $File; + } + + print header; + print <<__END_OF_HTML_CODE__; + + + + Error: Limit Reached + + + + + + + + +
+ +
+
+ +

Limit Reached

+

+ You have reached your upload limit. You attempted to upload $FILES_UPLOADED files, totalling + $TOTAL_BYTES. This exceeds the maximum limit of $MAXIMUM_UPLOAD bytes, set by the system + administrator. None of your files were successfully saved. Please try again. +

+


+ +
+ + + +__END_OF_HTML_CODE__ + exit; + } + + if ($SUCCESS_LOCATION !~ /^\s*$/) { + print $query->redirect($SUCCESS_LOCATION); + } else { + + + print header; + $command = join(' ',"/opt/bin/xlhtml -a ","\"$SAVE_DIRECTORY\/$Filename\""); + system($command); + system "rm -f $SAVE_DIRECTORY/$Filename"; + + foreach $key (keys (%Confirmation)) { + print "$key - $Confirmation{$key} bytes\n"; + } + + print <<__END_OF_HTML_CODE__; + +

+


+__END_OF_HTML_CODE__ + exit; + } + +# --------------------------------------------------------------------- +# EOF diff --git a/xlhtml/contrib/convertXLS.html b/xlhtml/contrib/convertXLS.html new file mode 100644 index 0000000..4aaadfb --- /dev/null +++ b/xlhtml/contrib/convertXLS.html @@ -0,0 +1,43 @@ + +MS Excel Spreadsheet converter Web Gateway + +
+

An Excel Sheet converter Web Gateway

+
+This is a web gateway converter for Excel Spreadsheet + documents to html. This tool will convert any Microsoft Excel spreadsheet (XLS) file you +send it, and then display the results in HTML format for you to read with your web +browser. +

+To use this tool, press the Browse button below, and select the MS Excel XLS document +you want to convert. Then Press the Upload File button to send it here for conversion. +

+

+ + + + + + + + + + + + +
+ File: + + +
 
+ + + +
+
+ +
+
+ + + diff --git a/xlhtml/contrib/convertXLS.txt b/xlhtml/contrib/convertXLS.txt new file mode 100644 index 0000000..2f1f802 --- /dev/null +++ b/xlhtml/contrib/convertXLS.txt @@ -0,0 +1,20 @@ +convertXLS is a cgi-bin script that allows you to set up a file +conversion server. There are no restrictions on file size. + +To set it up on Apache: + +1) copy convertXLS.html to /home/httpd/html + +2) copy convertXLS.cgi to /home/httpd/cgi-bin + +3) Change to the cgi-bin directory in step 2 and open + the convertXLS.cgi file with an editor. Find line + 388 and change the path to where you installed + xlhtml. + +To Test: + +1) start Netscape and goto http://localhost/convertXLS.html + +2) Browse to xlhtml directory and chose Test.xls if you + don't have an Excel file. diff --git a/xlhtml/contrib/excel2text b/xlhtml/contrib/excel2text new file mode 100755 index 0000000..ed457ba --- /dev/null +++ b/xlhtml/contrib/excel2text @@ -0,0 +1,23 @@ +#!/bin/sh +# excel2text - convert MS Excel files to ASCII text +# +# Written by Gary Johnson, Agilent Technologies . + +prog=${0##*/} +htmlfile=$1.html + +if [ $# -ne 1 ] +then + echo "Usage: $prog file" >&2 + exit 2 +fi + +if [ -f $htmlfile ] +then + echo "$prog: $htmlfile already exists." >&2 + exit 2 +fi + +xlhtml -te $1 > $htmlfile +w3m -dump $htmlfile +rm -f $htmlfile diff --git a/xlhtml/contrib/excel2text.txt b/xlhtml/contrib/excel2text.txt new file mode 100644 index 0000000..6dbec5f --- /dev/null +++ b/xlhtml/contrib/excel2text.txt @@ -0,0 +1,24 @@ +To enable Mutt to display Excel attachments, follow these steps. + +1. Make sure the following programs are in a directory in your PATH: + excel2text + xlhtml + w3m + +2. Add these lines to Mutt's mailcap file: + + application/excel; excel2text %s; copiousoutput + application/ms-Excel; excel2text %s; copiousoutput + application/msexcel; excel2text %s; copiousoutput + application/vnd.ms-excel; excel2text %s; copiousoutput + application/x-excel; excel2text %s; copiousoutput + application/x-msexcel; excel2text %s; copiousoutput + +3. To have Mutt automatically expand Excel attachments in-line, in + addition to being able to view the attachments from the attachments + menu, add these lines to Mutt's configuration file (e.g., + ~/.muttrc): + + auto_view application/excel application/ms-Excel + auto_view application/msexcel application/vnd.ms-excel + auto_view application/x-excel application/x-msexcel diff --git a/xlhtml/contrib/nsopen b/xlhtml/contrib/nsopen new file mode 100755 index 0000000..1af756b --- /dev/null +++ b/xlhtml/contrib/nsopen @@ -0,0 +1,30 @@ +#!/bin/sh + +if [ $# != 1 ]; +then + echo "Usage: $0 file" + exit 1 +fi + +file=$1 +if [ ! -f $file ] +then + echo "$0: $file is not a file!" + exit 2 +fi + +if [ ! -r $file ] +then + echo "$0: File $file cannot be read" + exit 4 +fi + +#Try to open file in an existing netscape window +(netscape -no-about-splash -remote "openFile(${file})") >& /dev/null + +#if this fails, it means that netscape is not running, so start it +if [ $status ] +then + netscape -no-about-splash -no-install file:${file} +fi + diff --git a/xlhtml/contrib/nsxlview b/xlhtml/contrib/nsxlview new file mode 100755 index 0000000..607335d --- /dev/null +++ b/xlhtml/contrib/nsxlview @@ -0,0 +1,47 @@ +#!/bin/bash + +file=$1 + +if [ "$file"xx == xx ] +then + echo "Usage: $0 file.doc" + exit 1 +fi + +source=$1 + +#Generate a unique html filename (/tmp/scriptname.pidnum.html) +# should use mkstemp, this is wholly bogus. +com=basename $0 +tmp=/tmp/${com}:t.$$ +html=${tmp}.html + +xlhtml $source > $html + +if [ ! $? ] +then + echo "xlhtml failed" + exit 4 +fi + +if [ ! -s $html ] +then + echo "$0: failed to generate HTML file" + exit 1 +fi + +#File exists and is of length > 0, so open it +nsopen $html + +#I do NOT remove the html file so that the user can click +#on the "Back" button without generating a "file not found" +#error - but uncomment the next line if you want it. + +if [ "$tmp"zz == zz ]; +then + echo "Aargh: \$tmp was null." +else + rm ${tmp}* +fi + +exit 0 diff --git a/xlhtml/contrib/uploader.pl b/xlhtml/contrib/uploader.pl new file mode 100755 index 0000000..4d69e3d --- /dev/null +++ b/xlhtml/contrib/uploader.pl @@ -0,0 +1,274 @@ +#!/usr/bin/perl + +=pod + +primary key is in $in{'pk'} +FILE ITSELF is in the data somehow + +Then we offer a variety of links to go to next -- enterimage for +all entries with a text entry but no photo entry? + +=cut + +sub mydie($){ + print <<"BLAM"; +
+Error $_[0] +BLAM + +exit +} +flock LOG,LOCK_EX; +seek(LOG,0,2); +print LOG +scalar(localtime)," $ENV{'REMOTE_ADDR'} $0 $$;$S\n"; + +print <<"FOO"; +Content-Type: text/html + +FOO + +foreach $C (split(';',$ENV{'HTTP_COOKIE'})){ + $C =~ m/^(\w+)=(.*)$/ and $Cookies{$1} = $2; +}; + +&ReadParsearoni; + +=pod + $in{'filename'} is the file name. + +while(my ($k,$v) = each %in){ + print "$k --> $v
\n"; +}; +=cut + +# adjust path to your xlhtml executable in the next line +print `/opt/bin/xlhtml -a $in{'filename'}`; +unlink $in{'filename'}; # comment out to keep uploaded files + + +exit; + +sub PrintForm(){ +print < +Excel Spreadsheet Converter + +
+
+ + + + + + + +
What Excel file to display?
  
 
+
+ + +FORM + +exit; +}; + +=pod + +file uploading code ripped from + +# Perl Routines to Manipulate CGI input +# cgi-lib@pobox.com +# $Id: uploader.pl,v 1.1 2002/03/20 15:33:03 slidedraw Exp $ +# +# Copyright (c) 1993-1998 Steven E. Brenner +# For more information, see: +# http://cgi-lib.stanford.edu/cgi-lib/ + +and modified heavily. +(david nicol davidnicol@acm.org 02/22/1999) + +and yet again +(david nicol davidnicol@acm.org 09/27/1999) + +=cut + +sub ReadParsearoni { + +# Parameters affecting cgi-lib behavior +# User-configurable parameters affecting file upload. + +# Do not change the following parameters unless you have special reasons +$cgi_lib'bufsize = 8192; # default buffer size when reading multipart +$cgi_lib'maxbound = 100; # maximum boundary length to be encounterd + + + # Get several useful env variables + $type = $ENV{'CONTENT_TYPE'}; + $len = $ENV{'CONTENT_LENGTH'}; + $meth = $ENV{'REQUEST_METHOD'}; + $maxdata = 131072; # maximum bytes to accept via POST - 2^17 + + if ($len > $maxdata) { + mydie "Excel file is too large, at $len. The maximum size permitted is $maxdata"; + } + + unless ($ENV{'CONTENT_TYPE'} =~ m#^multipart/form-data#) { + # mydie "expecting multipart/form-data to upload an Excel Spreadsheet"; + PrintForm; + }; + + local ($buf, $boundary, $head, @heads, $cd, $ct, $fname, $ctype, $blen); + local ($bpos, $lpos, $left, $amt, $fn, $ser); + local ($bufsize, $maxbound) = + ($cgi_lib'bufsize, $cgi_lib'maxbound); + + + # The following lines exist solely to eliminate spurious warning messages + $buf = ''; + + ($boundary) = $type =~ /boundary="([^"]+)"/; #"; # find boundary + ($boundary) = $type =~ /boundary=(\S+)/ unless $boundary; + mydie ("Boundary not provided: probably a bug in your server") + unless $boundary; + $boundary = "--" . $boundary; + $blen = length ($boundary); + + if ($ENV{'REQUEST_METHOD'} ne 'POST') { + mydie("Invalid request method for multipart/form-data: $meth\n"); + } + + $writefiles = './tempdata/'; + stat ($writefiles); + mydie "Cannot write to directory $writefiles" unless -d _ && -w _; + + # read in the data and split into parts: + # put headers in @in and data in %in + # General algorithm: + # There are two dividers: the border and the '\r\n\r\n' between + # header and body. Iterate between searching for these + # Retain a buffer of size(bufsize+maxbound); the latter part is + # to ensure that dividers don't get lost by wrapping between two bufs + # Look for a divider in the current batch. If not found, then + # save all of bufsize, move the maxbound extra buffer to the front of + # the buffer, and read in a new bufsize bytes. If a divider is found, + # save everything up to the divider. Then empty the buffer of everything + # up to the end of the divider. Refill buffer to bufsize+maxbound + # Note slightly odd organization. Code before BODY: really goes with + # code following HEAD:, but is put first to 'pre-fill' buffers. BODY: + # is placed before HEAD: because we first need to discard any 'preface,' + # which would be analagous to a body without a preceeding head. + + $left = $len; + PART: # find each part of the multi-part while reading data + while (1) { + die $@ if $errflag; + + $amt = ($left > $bufsize+$maxbound-length($buf) + ? $bufsize+$maxbound-length($buf): $left); + $errflag = (($got = read(STDIN, $buf, $amt, length($buf))) != $amt); + mydie "Short Read: wanted $amt, got $got\n" if $errflag; + $left -= $amt; + + $in{$name} .= "\0" if defined $in{$name}; + $in{$name} .= $fn if $fn; + + $name=~/([-\w]+)/; # This allows $insfn{$name} to be untainted + if (defined $1) { + $insfn{$1} .= "\0" if defined $insfn{$1}; + $insfn{$1} .= $fn if $fn; + } + + BODY: + while (($bpos = index($buf, $boundary)) == -1) { + if ($left == 0 && $buf eq '') { + foreach $value (values %insfn) { + unlink(split("\0",$value)); + } + mydie("cgi-lib.pl: reached end of input while seeking boundary " . + "of multipart. Format of CGI input is wrong.\n"); + } + die $@ if $errflag; + if ($name) { # if no $name, then it's the prologue -- discard + if ($fn) { print FILE substr($buf, 0, $bufsize); } + else { $in{$name} .= substr($buf, 0, $bufsize); } + } + $buf = substr($buf, $bufsize); + $amt = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf); + $errflag = (($got = read(STDIN, $buf, $amt, length($buf))) != $amt); + die "Short Read: wanted $amt, got $got\n" if $errflag; + $left -= $amt; + } + if (defined $name) { # if no $name, then it's the prologue -- discard + if ($fn) { print FILE substr($buf, 0, $bpos-2); } + else { $in {$name} .= substr($buf, 0, $bpos-2); } # kill last \r\n + } + close (FILE); + last PART if substr($buf, $bpos + $blen, 2) eq "--"; + substr($buf, 0, $bpos+$blen+2) = ''; + $amt = ($left > $bufsize+$maxbound-length($buf) + ? $bufsize+$maxbound-length($buf) : $left); + $errflag = (($got = read(STDIN, $buf, $amt, length($buf))) != $amt); + die "Short Read: wanted $amt, got $got\n" if $errflag; + $left -= $amt; + + + undef $head; undef $fn; + HEAD: + while (($lpos = index($buf, "\r\n\r\n")) == -1) { + if ($left == 0 && $buf eq '') { + foreach $value (values %insfn) { + unlink(split("\0",$value)); + } + mydie("cgi-lib: reached end of input while seeking end of " . + "headers. Format of CGI input is wrong.\n$buf"); + } + die $@ if $errflag; + $head .= substr($buf, 0, $bufsize); + $buf = substr($buf, $bufsize); + $amt = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf); + $errflag = (($got = read(STDIN, $buf, $amt, length($buf))) != $amt); + die "Short Read: wanted $amt, got $got\n" if $errflag; + $left -= $amt; + } + $head .= substr($buf, 0, $lpos+2); + push (@in, $head); + @heads = split("\r\n", $head); + ($cd) = grep (/^\s*Content-Disposition:/i, @heads); + ($ct) = grep (/^\s*Content-Type:/i, @heads); + + ($name) = $cd =~ /\bname="([^"]+)"/i; #"; + ($name) = $cd =~ /\bname=([^\s:;]+)/i unless defined $name; + + ($fname) = $cd =~ /\bfilename="([^"]*)"/i; #"; # filename can be null-str + ($fname) = $cd =~ /\bfilename=([^\s:;]+)/i unless defined $fname; + $incfn{$name} .= (defined $in{$name} ? "\0" : "") . + (defined $fname ? $fname : ""); + + ($ctype) = $ct =~ /^\s*Content-type:\s*"([^"]+)"/i; #"; + ($ctype) = $ct =~ /^\s*Content-Type:\s*([^\s:;]+)/i unless defined $ctype; + $inct{$name} .= (defined $in{$name} ? "\0" : "") . $ctype; + + $fn = $writefiles."temp$$"."a"; + while (-e $fn){ $fn++ }; + open (FILE, ">$fn") || mydie("Couldn't open $fn $!\n"); + #print "Wanting to write " and mydie("Couldn't open $fn $!\n"); + substr($buf, 0, $lpos+4) = ''; + undef $fname; + undef $ctype; + } + + if ($errflag) { + local ($errmsg, $value); + $errmsg = $@ || $errflag; + foreach $value (values %insfn) { + unlink(split("\0",$value)); + } + mydie($errmsg); + } else { + # everything's ok. + } + } + + + diff --git a/xlhtml/contrib/uploader.txt b/xlhtml/contrib/uploader.txt new file mode 100644 index 0000000..373c5a1 --- /dev/null +++ b/xlhtml/contrib/uploader.txt @@ -0,0 +1,25 @@ +uploader.pl is a cgi-bin wrapper that allows a server with xlhtml +to convert xls files via the Netscape Upload form. Note: there is a +file size limit of 128K. Here's the steps to get it working on Apache: + +1) With a editor, go to line 45 and correct the path to the xlhtml + executable on your system. You can use 'which xlhtml' if you don't know. + Also, line 1 may need changing depending on where perl is on your system. +2) Copy the file uploader to /home/httpd/cgi-bin +3) cd /home/httpd/cgi-bin +4) chmod +x uploader.pl from the cgi-bin directory +5) In the cgi-bin directory mkdir tempdata +6) chmod 0007 tempdata +7) In Netscape, type: http://localhost/cgi-bin/uploader.pl and press Enter. + If it is setup correctly, you should have a form and then you can + select Test.xls if you don't have one and try it. + + + +enjoy + + +________________________________________________________________________ + David Nicol 816.235.1187 nicold@umkc.edu + "Atomkraft? Nein, danke!" -- Martin Schwartz + diff --git a/xlhtml/contrib/xlhtml.dtd b/xlhtml/contrib/xlhtml.dtd new file mode 100644 index 0000000..bb9c920 --- /dev/null +++ b/xlhtml/contrib/xlhtml.dtd @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xlhtml/contrib/xlhtml.dtd.txt b/xlhtml/contrib/xlhtml.dtd.txt new file mode 100644 index 0000000..31f7393 --- /dev/null +++ b/xlhtml/contrib/xlhtml.dtd.txt @@ -0,0 +1,2 @@ +xlhtml.dtd is the dtd file that is needed for the XML output option. + diff --git a/xlhtml/contrib/xlv b/xlhtml/contrib/xlv new file mode 100755 index 0000000..8fffd30 --- /dev/null +++ b/xlhtml/contrib/xlv @@ -0,0 +1,72 @@ +#!/usr/bin/perl -w +# +# xlv - pass xl file thru xlHtml and display as plain text +# The point of this script is to produce legible approximation of the +# spreadsheet within 80 columns, sacrificing data as necessary to fit. +# This aids reading mail with mutt. Works well for phone lists and stuff +# like that. +# +# Copyright Asher Blum November 2000 +# Released per the GNU General Public License + +use strict; +my $term_width = 80; +undef $/; +my $xls = <>; +my $fn = "/tmp/$$.xls"; +open "XL", ">$fn" or die "Can't open XLS: $!"; +print XL $xls; +close XL; +open HTML, "xlhtml $fn |" or die "Can't start xlhtml: $!"; +my $page = ; +close HTML; +my @table; +$page =~ s/ / /g; +$page =~ s/\s+/ /g; +my @rows = split(/]*>/i, $page); +shift @rows; +my @total_width = my @width = map 0, split /]*>/i, $rows[ 0 ]; +foreach my $row(@rows) { + my @cells = split /]*>/i, $row; + shift @cells; + pop @cells; + for(0..$#cells) { + $cells[ $_ ] =~ s/<[^>]+>//g; + $cells[ $_ ] =~ s/\s+$//; + $width[ $_ ] = length($cells[ $_ ]) + unless $width[ $_ ] > length($cells[ $_ ]); + $total_width[ $_ ] += length($cells[ $_ ]); + } + push @table, [ @cells ]; +} + +# Now trim the widths to fit avail terminal width + +my @avg_width = map($_ / @rows, @total_width); +my @waste_width = map($width[ $_ ] - $avg_width[ $_ ], 0..$#width); +while(sum(@width) > $term_width - @width) { # remember, we waste 1 +space + my $mw = most_wasteful(); + $width[ most_wasteful() ]--; + @waste_width = map($width[ $_ ] - $avg_width[ $_ ], 0..$#width); +} +foreach my $row(@table) { + for(0..(@$row - 1)) { + + printf('%-' . $width[ $_ ] . '.' . $width[ $_ ] . 's ', $row->[ $_ ]); + } + print"\n"; +} +sub sum { + my $s; + $s += $_ for @_; + $s; +} +sub most_wasteful { + my $max = 0; + for(0..$#waste_width) { + $max = $_ if $waste_width[ $_ ] > $max; + } + $max; +} + diff --git a/xlhtml/doxygen.conf b/xlhtml/doxygen.conf new file mode 100644 index 0000000..c622d01 --- /dev/null +++ b/xlhtml/doxygen.conf @@ -0,0 +1,164 @@ +# Doxyfile 0.1 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = xlhtml +PROJECT_NUMBER = +OUTPUT_DIRECTORY = doc +OUTPUT_LANGUAGE = English +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = NO +CLASS_DIAGRAMS = NO +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = NO +SHOW_INCLUDE_FILES = NO +JAVADOC_AUTOBRIEF = NO +INHERIT_DOCS = YES +INLINE_INFO = NO +SORT_MEMBER_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = YES +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = xlhtml.c +FILE_PATTERNS = +RECURSIVE = NO +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = diff --git a/xlhtml/gpdemo b/xlhtml/gpdemo new file mode 100755 index 0000000..2b6d2e5 --- /dev/null +++ b/xlhtml/gpdemo @@ -0,0 +1,46 @@ +#!/bin/csh + +# File to render +set source = Test.xls + +#Generate a unique html filename (/tmp/scriptname.pidnum.html) +set com = $0 +set tmp = /tmp/$com:t.$$ +set gpcommand = $tmp.gp +set gpdata = $tmp.dat +set gpout = $tmp.gif + +# create gnuplot command file +echo "set terminal gif small size 250,125 interlace xfdf5e6 x000000 x404040 x0000ff x00ff00" > $gpcommand +echo "set grid ytics" >> $gpcommand +echo "set nokey" >> $gpcommand +echo "set nolabel" >> $gpcommand +echo "set data style lines" >> $gpcommand +echo "set noxzeroaxis" >> $gpcommand +echo "set noyzeroaxis" >> $gpcommand +echo 'set output "'$gpout'"' >> $gpcommand +echo 'plot "'$gpdata'"' >> $gpcommand + +# create the data file +xlhtml -fw -asc -xp:0 -xc:0-1 -xr:2-6 $source > $gpdata + +if ((!(-s $gpcommand)) | (!(-s $gpdata)) |($status)) then + echo "$0: failed to generate gnuplot command or data files" + exit 1 +endif + +#File exists and is of length > 0, so do it... +gnuplot $gpcommand + +if (!(-s $gpout)) then + echo "$0: failed to generate gif file" + exit 1 +endif + +# Display the results in Netscape +nsopen $gpout + +# Clean up +rm $tmp* + +exit 0 diff --git a/xlhtml/nsopen b/xlhtml/nsopen new file mode 100755 index 0000000..7903f1b --- /dev/null +++ b/xlhtml/nsopen @@ -0,0 +1,20 @@ +#!/bin/csh + +if ($#argv != 1) then + echo "Usage: $0 file" + exit 1 +endif + +set file = $argv[1] +if (!(-r $file)) then + echo "$0"": File $file cannot be read" + exit 1 +endif + +#Try to open file in an existing netscape window +(netscape -no-about-splash -remote "openFile(${file})") >& /dev/null + +#if this fails, it means that netscape is not running, so start it +if ($status) then + netscape -no-about-splash -no-install file:${file} +endif diff --git a/xlhtml/nsxlview b/xlhtml/nsxlview new file mode 100755 index 0000000..8745b40 --- /dev/null +++ b/xlhtml/nsxlview @@ -0,0 +1,30 @@ +#!/bin/csh + +if ($#argv != 1) then + echo "Usage: $0 file.xls" + exit 1 +endif + +set source = $argv[1] + +#Generate a unique html filename (/tmp/scriptname.pidnum.html) +#set com = $0 +#set tmp = /tmp/$com:t.$$ +#set html = $tmp.html + +set tmp = `mktemp -q /tmp/nsxlview.XXXXXX` || exit 1 +set tmp2 = `mktemp -q $tmp/nsxlview.XXXXXX` || exit 1 +set html = $tmp2.html + + +xlhtml -a $source > $html +if ((!(-r $html)) | ($status)) then + echo "$0"": failed to generate HTML file" + exit 1 +endif + +#File exists and is of length > 0, so open it +nsopen $html +rm -rf $tmp* + +exit 0 diff --git a/xlhtml/support.c b/xlhtml/support.c new file mode 100644 index 0000000..e8a288d --- /dev/null +++ b/xlhtml/support.c @@ -0,0 +1,63 @@ + +/* Various support functions for xlhtml. */ + +#include +#include "support.h" + +void print_version(void) +{ + printf("xlhtml \nCopyright (c) 1999-2002, Charles Wyble\n" + "Released under GPL.\n"); + exit(1); +} + +void display_usage(void) +{ +fprintf(stderr, "\nxlhtml converts excel files (.xls) to Html.\n" + "Copyright (c) 1999-2001, Charles Wyble. Released under GPL.\n" +"Usage: xlhtml [-xp:# -xc:#-# -xr:#-# -bc###### -bi???????? -tc######] \n" + "\t-a: aggressive html optimization\n" + "\t-asc ascii output for -dp & -x? options\n" + "\t-csv comma separated value output for -dp & -x? options\n" + "\t-xml XML output\n" + "\t-bc: Set default background color - default white\n" + "\t-bi: Set background image path\n" + "\t-c: Center justify tables\n" + "\t-dp: Dumps page count and max rows & colums per page\n" + "\t-v: Prints program version number\n" + "\t-fw: Suppress formula warnings\n" + "\t-m: No encoding for multibyte\n" + "\t-nc: No Colors - black & white\n" + "\t-nh: No Html Headers\n" + "\t-tc: Set default text color - default black\n" + "\t-te: Trims empty rows & columns at the edges of a worksheet\n" + "\t-xc: Columns (separated by a dash) for extraction (zero based)\n" + "\t-xp: Page extracted (zero based)\n" + "\t-xr: Rows (separated by a dash) to be extracted (zero based)\n"); + fprintf(stderr, "\nReport bugs to jackshck@yahoo.com\n"); + exit (1); +} + +void do_cr(void) +{ + extern int aggressive; + if (!aggressive) + putchar('\n'); +} + +U16 getShort(U8 *ptr) +{ + if (ptr == 0) + return (U16)0; + + return (U16)((*(ptr+1)<<8)+*ptr); +} + +/*! This is used in the RK number, so signedness counts */ +S32 getLong(U8 *ptr) +{ + if (ptr == 0) + return (S32)0; + + return (S32)(*(ptr+3)<<24)+(*(ptr+2)<<16)+(*(ptr+1)<<8)+*ptr; +} diff --git a/xlhtml/tuneable.h b/xlhtml/tuneable.h new file mode 100644 index 0000000..8d4e5cc --- /dev/null +++ b/xlhtml/tuneable.h @@ -0,0 +1,7 @@ + +#define XFORMATS_INCR 64 /*!< Increments to allocate extended formats */ +#define FONTS_INCR 32 /*!< Increments to allocate fonts */ +#define WORKSHEETS_INCR 4 /*!< Increments to allocate worksheet pages */ +#define COLS_INCR (U16)24 /*!< Increments to allocate Columns per Worksheet page */ +#define ROWS_INCR (U32)128 /*!< Increments to allocate Rows per Worksheet page */ +#define STRINGS_INCR 256UL /*!< Increments to allocate the string array - */ diff --git a/xlhtml/xlcdump.c b/xlhtml/xlcdump.c new file mode 100644 index 0000000..0410878 --- /dev/null +++ b/xlhtml/xlcdump.c @@ -0,0 +1,372 @@ +/* + xlcdump - dumps individual chart records for analysis + Copyright 2002 Charles N Wyble + + 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 + */ + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "config.h" /* Created by ./configure script */ +#include "cole.h" +#else +#include "config.h.in" /* Created by ./configure script */ +#include "cole.h.in" +#include /* for umask */ +#endif +#include +#include +#include /* for strcpy() */ +#include /* For isprint */ + + +#define MODE 0 /* 0 - ascii; 1 - hex */ +#define TEXT 0 /* In ascii mode, 0 - ascii, 1 - hex */ + +#define PRGNAME "xlcdump" +#define MAX_COLS 64 +#define MAX_ROWS 512 + +static char FileName[2][12] = /* The section of the Excel Spreadsheet we read in */ +{ + "/Workbook", /* Office 97 */ + "/Book" /* Everything else ? */ +}; + +/* Function Prototypes */ +COLE_LOCATE_ACTION_FUNC dump_file; +static void output_opcode_string(int); + +/* Global data */ +static char filename[128]; + + +int main (int argc, char **argv) +{ + int f_ptr = 0; + COLEFS * cfs; + COLERRNO colerrno; + + if (argc < 2) + { + fprintf (stderr, "dump - Outputs excel chart records for analysis.\n" + "Usage: "PRGNAME" \n"); + exit (1); + } + else + { + strncpy(filename, argv[1], 124); + cfs = cole_mount (filename, &colerrno); + if (cfs == NULL) + { + cole_perror (PRGNAME, colerrno); + exit (1); + } + } + + while (cole_locate_filename (cfs, FileName[f_ptr], NULL, dump_file, &colerrno)) + { + if (f_ptr) + { + cole_perror (PRGNAME, colerrno); + break; + } + else + f_ptr++; + } + + if (cole_umount (cfs, &colerrno)) + { + cole_perror ("travel", colerrno); + exit (1); + } + + return 0; +} + + +void dump_file(COLEDIRENT *cde, void *_info) +{ + unsigned int length=0, opcode=0, target=0, count = 0; + unsigned char buf[16]; + COLEFILE *cf; + COLERRNO err; + + cf = cole_fopen_direntry(cde, &err); + + /* Ouput Header */ + printf("\n"); + printf("%s", filename); + printf("\n"); + +/* Output body */ +#if (MODE == 1) + while (cole_fread(cf, buf, 8, &err)) /* For mode >= 1 */ +#else + while (cole_fread(cf, buf, 1, &err)) +#endif + { + if (MODE == 0) + { + if (count == 0) + { + length = 0; + opcode = (unsigned)buf[0]; + target = 80; /* ficticious number */ + printf("
"); + } + else if (count == 1) + opcode |= (buf[0]<<8)&0x0000FFFFL; + else if (count == 2) + length = (unsigned)buf[0]; + else if (count == 3) + { + length |= (buf[0]<<8); + target = length; + printf("
\nLength:%04X Opcode:%04X - ", length, opcode); + output_opcode_string(opcode); + puts("
\n"); + } + if (count > 3) + { /* Here is where we want to process the data */ + /* based on the opcode... */ +#if (TEXT == 0) + if (isprint(buf[0])) + putc(buf[0], stdout); +#else + printf("%02X ", buf[0]); + if (((count-3) % 8) == 0) + printf("
\n"); +#endif + } + if (count == (target+3)) + count = 0; + else + count++; + } + else /* mode >= 1 */ + { + printf("%02x %02x %02x %02x %02x %02x %02x %02x         ", + (unsigned)buf[0], (unsigned)buf[1], (unsigned)buf[2], (unsigned)buf[3], + (unsigned)buf[4], (unsigned)buf[5], (unsigned)buf[6], (unsigned)buf[7]); + putchar(buf[0]); putchar(buf[1]); + putchar(buf[2]); putchar(buf[3]); + putchar(buf[4]); putchar(buf[5]); + putchar(buf[6]); putchar(buf[7]); + printf("
\n"); + } + } + +/* Output Tail */ + printf("\n"); + cole_fclose(cf, &err); +} + + + +static void output_opcode_string(int opcode) +{ + switch (opcode&0x00FF) + { + + case 0x10: + case 0x01: + puts("UNITS: Chart Units"); + break; + case 0x02: + puts("CHART: Location and overall chart dimensions"); + break; + case 0x03: + puts("SERIES: Series Definition"); + break; + case 0x06: + puts("DATAFORMAT: Series and Data Point Numbers"); + break; + case 0x07: + puts("LINEFORMAT: Style of a line or border"); + break; + case 0x09: + puts("MARKERFORMAT: Style of a line marker"); + break; + case 0x0A: + puts("AREAFORMAT: Colors and patterns for an area"); + break; + case 0x0B: + puts("PIEFORMAT: Position of the pie slice"); + break; + case 0x0C: + puts("ATTACHEDLABEL: Series data/value labels"); + break; + case 0x0D: + puts("SERIESTEXT: Legend/category/value text"); + break; + case 0x14: + puts("CHARTFORMAT: Parent record for chart group"); + break; + case 0x15: + puts("LEGEND: Legend type and position"); + break; + case 0x16: + puts("SERIESLIST: Specifies the series in an overlay chart"); + break; + case 0x17: + puts("BAR: Chart group is a bar or column chart group"); + break; + case 0x18: + puts("LINE: Chart group is a line chart group"); + break; + case 0x19: + puts("PIE: Chart group is a pie chart group"); + break; + case 0x1A: + puts("AREA: Chart group is an area chart group"); + break; + case 0x1B: + puts("SCATTER: Chart group is a scatter chart group"); + break; + case 0x1C: + puts("CHARTLINE: Drop/Hi-Lo/Series Lines on a line chart"); + break; + case 0x1D: + puts("AXIS: Axis Type"); + break; + case 0x1E: + puts("TICK: Tick marks and labels format"); + break; + case 0x1F: + puts("VALUERANGE: Defines value axis scale"); + break; + case 0x20: + puts("CATSERRANGE: Defines a category or series axis"); + break; + case 0x21: + puts("AXISLINEFORMAT: Defines a line that spans an axis"); + break; + case 0x22: + puts("CHARTFORMTLINK: Not Used"); + break; + case 0x24: + puts("DEFAULTTEXT: Default data label text properties"); + break; + case 0x25: + puts("TEXT: Defines display of text fields"); + break; + case 0x26: + puts("FONTX: Font Index"); + break; + case 0x27: + puts("OBJECTLINK: Attaches Text to chart or chart item"); + break; + case 0x32: + puts("FRAME: Defines border shape around displayed text"); + break; + case 0x33: + puts("BEGIN: Defines the beginning of an object"); + break; + case 0x34: + puts("END: Defines the end of an object"); + break; + case 0x35: + puts("PLOTAREA: Frame belongs to ploat area"); + break; + case 0x3A: + puts("3d Chart group"); + break; + case 0x3C: + puts("PICF: Picture Format"); + break; + case 0x3D: + puts("DROPBAR: Defines drop bars"); + break; + case 0x3E: + puts("RADAR: Chart group is a radar chart group"); + break; + case 0x3F: + puts("SURFACE: Chart group is a surface chart group"); + break; + case 0x40: + puts("RADARAREA: Chart group is a radar area chart group"); + break; + case 0x41: + puts("AXISPARENT: Axis size and location"); + break; + case 0x43: + puts("LEGENDXN: Legend Exception"); + break; + case 0x44: + puts("SHTPROPS: Sheet Properties"); + break; + case 0x45: + puts("SERTOCRT: Series chart-group index"); + break; + case 0x46: + puts("AXESUSED: Number of axes sets"); + break; + case 0x48: + puts("SBASEREF: PivotTable Reference"); + break; + case 0x4A: + puts("SERPARENT: Trendline or Errorbar series index"); + break; + case 0x4B: + puts("SERAUXTREND: Series trendline"); + break; + case 0x4E: + puts("IFMT: Number-Format Index"); + break; + case 0x4F: + puts("POS: Position information"); + break; + case 0x50: + puts("ALRUNS: Text formatting"); + break; + case 0x51: + puts("AI: Linked data"); + break; + case 0x5B: + puts("Series ErrorBar"); + break; + case 0x5D: + puts("SERFMT: Series Format"); + break; + case 0x60: + puts("FBI: Font Basis"); + break; + case 0x61: + puts("BOPPOP: Bar of pie/pie of pie chart options"); + break; + case 0x62: + puts("AXCEXT: Axis options"); + break; + case 0x63: + puts("DAT: Data Table Options"); + break; + case 0x64: + puts("PLOTGROWTH: Font scale factors"); + break; + case 0x65: + puts("SIINDEX: Series Index"); + break; + case 0x66: + puts("GELFRAME: Fill data"); + break; + case 0x67: + puts("Custom bar of pie/ pie of pie chart options"); + break; + default: + puts("Unknown Chart Opcode"); + break; + } +} + diff --git a/xlhtml/xldump.c b/xlhtml/xldump.c new file mode 100644 index 0000000..9e7a497 --- /dev/null +++ b/xlhtml/xldump.c @@ -0,0 +1,591 @@ +/* + dump - dumps individual records for analysis + Copyright 2002 Charles N Wyble + + 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 + */ + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "config.h" /* Created by ./configure script */ +#include "cole.h" +#else +#include "config.h.in" /* Created by ./configure script */ +#include "cole.h.in" +#include /* for umask */ +#endif +#include +#include +#include /* for strcpy() */ +#include /* For isprint */ + + +#define MODE 0 /* 0 - ascii; 1 - hex */ +#define TEXT 0 /* In ascii mode, 0 - ascii, 1 - hex */ + +#define PRGNAME "xldump" +#define MAX_COLS 64 +#define MAX_ROWS 512 + +static char FileName[2][12] = /* The section of the Excel Spreadsheet we read in */ +{ + "/Workbook", /* Office 97 */ + "/Book" /* Everything else ? */ +}; + +/* Function Prototypes */ +COLE_LOCATE_ACTION_FUNC dump_file; +/*static void main_line_processor(int opcode, char data);*/ +static void output_opcode_string(int); + +/* Global data */ +static char filename[128]; + + +int main (int argc, char **argv) +{ + int f_ptr = 0; + COLEFS * cfs; + COLERRNO colerrno; + + if (argc < 2) + { + fprintf (stderr, "dump - Outputs excel file records for analysis.\n" + "Usage: "PRGNAME" \n"); + exit (1); + } + else + { + strncpy(filename, argv[1], 124); + cfs = cole_mount (filename, &colerrno); + if (cfs == NULL) + { + cole_perror (PRGNAME, colerrno); + exit (1); + } + } + + while (cole_locate_filename (cfs, FileName[f_ptr], NULL, dump_file, &colerrno)) + { + if (f_ptr) + { + cole_perror (PRGNAME, colerrno); + break; + } + else + f_ptr++; + } + + if (cole_umount (cfs, &colerrno)) + { + cole_perror ("travel", colerrno); + exit (1); + } + + return 0; +} + + +void dump_file(COLEDIRENT *cde, void *_info) +{ + unsigned int length=0, opcode=0, target=0, count = 0; + unsigned char buf[16]; + COLEFILE *cf; + COLERRNO err; + + cf = cole_fopen_direntry(cde, &err); + + /* Ouput Header */ + printf("\n"); + printf("%s", filename); + printf("\n"); + +/* Output body */ +#if (MODE == 1) + while (cole_fread(cf, buf, 8, &err)) /* For mode >= 1 */ +#else + while (cole_fread(cf, buf, 1, &err)) +#endif + { + if (MODE == 0) + { + if (count == 0) + { + length = 0; + opcode = (unsigned)buf[0]; + target = 80; /* ficticious number */ + printf("
"); + } + else if (count == 1) + opcode |= (buf[0]<<8)&0x0000FFFFL; + else if (count == 2) + length = (unsigned)buf[0]; + else if (count == 3) + { + length |= (buf[0]<<8); + target = length; + printf("
\nLength:%04X Opcode:%04X - ", length, opcode); + output_opcode_string(opcode); + puts("
\n"); + } + if (count > 3) + { /* Here is where we want to process the data */ + /* based on the opcode... */ +#if (TEXT == 0) + if (isprint(buf[0])) + putc(buf[0], stdout); +#else + printf("%02X ", buf[0]); + if (((count-3) % 8) == 0) + printf("
\n"); +#endif + } + if (count == (target+3)) + count = 0; + else + count++; + } + else /* mode >= 1 */ + { + printf("%02x %02x %02x %02x %02x %02x %02x %02x         ", + (unsigned)buf[0], (unsigned)buf[1], (unsigned)buf[2], (unsigned)buf[3], + (unsigned)buf[4], (unsigned)buf[5], (unsigned)buf[6], (unsigned)buf[7]); + putchar(buf[0]); putchar(buf[1]); + putchar(buf[2]); putchar(buf[3]); + putchar(buf[4]); putchar(buf[5]); + putchar(buf[6]); putchar(buf[7]); + printf("
\n"); + } + } + +/* Output Tail */ + printf("\n"); + cole_fclose(cf, &err); +} + +/*static void main_line_processor(int opcode, char data) +{ +} +*/ + +static void output_opcode_string(int opcode) +{ + switch (opcode&0x00FF) + { + + /* start of documented general opcodes */ + + case 0x0A: + puts("\nEOF: End of File"); + break; + case 0x0C: + puts("CALCCOUNT: Iteration count"); + break; + case 0x0D: + puts("CalcMode: Calculation mode"); + break; + case 0x0E: + puts("Precision"); + break; + case 0x0F: + puts("Reference Mode"); + break; + case 0x10: + puts("Delta: Iteration Increment"); + break; + case 0x11: + puts("Iteration Mode"); + break; + case 0x12: + puts("Protection Flag"); + break; + case 0x13: + puts("Protection Password"); + break; + case 0x14: + puts("Print Header on each page"); + break; + case 0x15: + puts("Print Footer on each page"); + break; + case 0x16: + puts("External Count: Number of external references"); + break; + case 0x17: + puts("External reference"); + break; + case 0x19: + puts("Windows are Protected"); + break; + case 0x1A: + puts("Vertical Page Breaks"); + break; + case 0x1B: + puts("Horizontal Page Breaks"); + break; + case 0x1C: + puts("Cell Note"); + break; + case 0x1D: + puts("Selection"); + break; + case 0x22: + puts("1904 date system"); + break; + case 0x26: + puts("Left Margin Measurement"); + break; + case 0x27: + puts("Right Margin Measurement"); + break; + case 0x28: + puts("Top Margin Measurement"); + break; + case 0x29: + puts("Bottom Margin Measurement"); + break; + case 0x2A: + puts("Print Row/Column Labels"); + break; + case 0x2B: + puts("Print Gridlines Flag"); + break; + case 0x2F: + puts("File is Password protected"); + break; + case 0x3C: + puts("Continues long records"); + break; + case 0x3D: + puts("Window1"); + break; + case 0x40: + puts("BACKUP: Save Backup Version of the File"); + break; + case 0x41: + puts("Number of Panes and their position"); + break; + + /* error in ms docs. + case 0x42: + puts("CODEPAGE: Default code page"); + break; + case 0x42: + puts("CODENAME: VBE Object Name"); + break; + */ + + case 0x4D: + puts("PLS: Environment specific print record"); + break; + case 0x50: + puts("DCON: Data consolidation information"); + break; + case 0x51: + puts("DCONREF: Data consolidation references"); + break; + case 0x52: + puts("DCONNAME: Data Consolidation Named References"); + break; + case 0x55: + puts("DEFCOLWIDTH: Default Column Width"); + break; + case 0x59: + puts("XCT: CRN Record Count"); + break; + case 0x5A: + puts("CRN: Nonresident operands"); + break; + case 0x5B: + puts("FILESHARING:File-sharing information"); + break; + case 0x5C: + puts("Write Access"); + break; + case 0x5D: + puts("OBJ: Describes a Graphic object"); + break; + case 0x5E: + puts("UNCALCED: Recalculation Status"); + break; + case 0x5F: + puts("SAVERECALC: Recalculate before save"); + break; + case 0x60: + puts("TEMPLATE: Workbook is a template"); + break; + case 0x63: + puts("OBJPROTECT: Objects are protected"); + break; + case 0x7D: + puts("COLINFO: Column formatting information"); + break; + case 0x7E: + puts("RK Number"); + break; + case 0x7F: + puts("IMDATA: Image data"); + break; + case 0x80: + puts("GUTS: Size of row and column gutters"); + break; + case 0x81: + puts("WSBOOL: Additional workspace information"); + break; + case 0x82: + puts("GRIDSET: State change of gridlines option"); + break; + case 0x83: + puts("HCENTER: Center between horizontal margins"); + break; + case 0x84: + puts("VCENTER: Center between vertical margins"); + break; + case 0x85: + puts("BoundSheet"); + break; + case 0x86: + puts("WRITEPROT: Workbook is Write-protected"); + break; + case 0x87: + puts("ADDIN: Workbook is add-in macro"); + break; + case 0x88: + puts("EDG: Edition globals"); + break; + case 0x89: + puts("PUB: Publisher"); + break; + case 0x8C: + puts("COUNTRY: Default country and WIN.INI Country"); + break; + case 0x8D: + puts("HIDEOBJ: Object display options"); + break; + case 0x90: + puts("SORT: Sorting options"); + break; + case 0x91: + puts("SUB: Subscriber"); + break; + case 0x92: + puts("Palette Info"); + break; + case 0x94: + puts("LHRECORD: .WK? File Conversion Information"); + break; + case 0x95: + puts("LHNGRAPH: Named Graph Information"); + break; + case 0x96: + puts("SOUND: Sound note"); + break; + case 0x98: + puts("LPR: Sheet was printed using LINE.PRINT()"); + break; + case 0x99: + puts("STANDARDWIDTH: Standard column width"); + break; + case 0x9A: + puts("FNGROUPNAME: Function Group name"); + break; + case 0x9B: + puts("FILTERMODE: Sheet contains filtered list"); + break; + case 0x9C: + puts("FNGROUPCOUNT: Built-in function group count"); + break; + case 0x9D: + puts("AUTOFILTERINFO: Drop Down Arrow Count"); + break; + case 0x9E: + puts("AUTOFILTER: AutoFilter data"); + break; + case 0xA0: + puts("SCL: Window Zoom magnification"); + break; + case 0xA1: + puts("Page Setup"); + break; + case 0xA9: + puts("COORDLIST: Polygon Object Vertex coordinates"); + break; + case 0xAB: + puts("GCW: Global Column-Wdith flags"); + break; + case 0xAE: + puts("SCENMAN: Scenario Output data"); + break; + case 0xAF: + puts("PROT4REV: Shared Workbook protection flag"); + break; + case 0xB0: + puts("SXVIEW: View Definition"); + break; + case 0xB1: + puts("SXVD: View Fields"); + break; + case 0xB2: + puts("SXVI: View Item"); + break; + case 0xB4: + puts("SXIVD: Row/Column Field Ids"); + break; + case 0xB5: + puts("SXLI: Line item array"); + break; + case 0xB6: + puts("SXPI: Page item"); + break; + case 0xB8: + puts("DOCROUTE: Routing slip information"); + break; + case 0xB9: + puts("RECIPNAME: Recipient name"); + break; + case 0xBC: + puts("SHRFMLA: Shared formula"); + break; + case 0xBD: + puts("MULRK: Multiple RK cells"); + break; + case 0xBE: + puts("Multiple Blanks"); + break; + case 0xC1: + puts("MMS: ADDMENU/DELMENU Record Group count"); + break; + case 0xC2: + puts("ADDMENU: Menu Addition"); + break; + case 0xC3: + puts("DELMENU: Menu Deletion"); + break; + case 0xC5: + puts("SXDI: Data Item"); + break; + case 0xC6: + puts("SXDB: PivtoTable Cache Data"); + break; + case 0xCD: + puts("SXSTRING: String"); + break; + case 0xD0: + puts("SXTBL: Multiple Consolidation Source Info"); + break; + case 0xD1: + puts("SXTBRGIITM: Page Item Name Count"); + break; + case 0xD2: + puts("SXTBPG: Page Item Indexes"); + break; + case 0xD3: + puts("OBPROJ: Visual Basic Project"); + break; + case 0xD5: + puts("SXIDSTM: Stream ID"); + break; + case 0xD6: + puts("RString"); + break; + case 0xD7: + puts("DBCELL: Stream offsets"); + break; + case 0xDA: + puts("BOOKBOOL: Workbook option flag"); + break; + + /* error in ms docs + case 0xDC: + puts("PARAMQRY: Query parameters"); + break; + case 0xDC: + puts("SXEXT: External source information"); + break; + */ + + case 0xDD: + puts("SCENPROTECT: Scenario protection"); + break; + case 0xDE: + puts("OLESIZE: Size of an OLE object"); + break; + case 0xDF: + puts("UDDESC: Description string for chart autoformat"); + break; + case 0xE0: + puts("Extended Format"); + break; + case 0xE1: + puts("INTERFACEHDR: Beginning of User Interface Records"); + break; + case 0xE2: + puts("INTERFACEEND: End of User interface records"); + break; + case 0xE3: + puts("SXVS: View source"); + break; + case 0xEA: + puts("TABIDCONF: Sheet tab ID of Conflict history"); + break; + case 0xEB: + puts("MSODRAWINGGROUP: MS Office Drawing Group"); + break; + case 0xEC: + puts("MSODRAWING: MS Office Drawing"); + break; + case 0xED: + puts("MS Office Drawing Selection"); + break; + case 0xF0: + puts("SXRULE: PivotTable Rule data"); + break; + case 0xF1: + puts("SXEX: PivotTable Extended information"); + break; + case 0xF2: + puts("SXFILT: PivotTable Rule Filter"); + break; + case 0xF6: + puts("SXNAME: PivotTable Name"); + break; + case 0xF7: + puts("SXSELECT: PivotTable Selection Information"); + break; + case 0xF8: + puts("PivotTable Name Pair"); + break; + case 0xF9: + puts("PivotTable Parsed Expression"); + break; + case 0xFB: + puts("PivotTable Format Record"); + break; + case 0xFC: + puts("Shared String Table"); + break; + case 0xFD: + puts("Cell Value, String Constant/SST"); + break; + case 0xFF: + puts("Extended Shared String Table"); + break; + + + default: + puts("Unknown Opcode"); + break; + } +} + diff --git a/xlhtml/xlhtml.1 b/xlhtml/xlhtml.1 new file mode 100644 index 0000000..f987b81 --- /dev/null +++ b/xlhtml/xlhtml.1 @@ -0,0 +1,75 @@ +.\"Created with GNOME Manpages Editor Wizard +.\"http://gmanedit.sourceforge.net +.\"Sergio Rua +.\" +.TH xlhtml 1 "October 13, 2001" "xlhtml" + +.SH NAME +xlhtml \- A program for converting Microsoft Excel Files .xls + +.SH SYNOPSIS +.B xlhtml +.RI [ -nc ] [ -a ] [ -fw ] [ -bcNNNNNN ] [ -tcNNNNNN ] [ -bi/path ] [ -c ] [ -te ] [ -v ] [ -m ] [ -asc ] [ -dp ] [ -xp:N ] [ -xc:N ] [ -xr:N ] [ -xml ] [ -csv ] +.br + +.SH DESCRIPTION +This manual page explains the +.B xlhtml +program. The program +.B xlhtml +is used to convert Microsoft Excel Spreadsheet files into either html or tab delimitted ASCII. The program can be interfaced with helper scripts for viewing email attachments. Most use of this program is through the helper scripts and one would probably rarely resort to using the commandline interface. + +.SH OPTIONS +.B +.IP -nc +tells it not to colorize the output. +.IP -a +aggressively optimize html by removing or VALIGN="bottom" Some older browsers may not display properly in this mode. +.IP -fw +suppress formula warnings about accuracy +.IP -bc +Override the background color. e.g. -bg808080 for gray +.IP -tc +Override the text color. e.g. -tcFF0000 for red +.IP -bi +Use background image. e.g. -bi/home/httpd/icon/tar.gif +.IP -c +Centers the tables horizontally +.IP -te +Trims empty rows & columns at the edges of a worksheet +.IP -v +Prints program version +.IP -m +No encoding for multibyte +.IP -asc +Ascii out of -dp and extraction data (-x?) +.IP -dp +Dump page count and max columns and rows per page +.IP -xp +Page for extraction (zero based) +.IP -xc +Columns (separated by a dash) for extraction (zero based) +.IP -xr +Rows (separated by a dash) to be extracted (zero based) +.IP -xml +Output in XML +.IP -csv +Output in Comma Separated Values +.IP -nh +Suppress header and body tags in html output + +An example of the extraction command line is: +xlhtml -fw -asc -xp:0 -xr:2-6 -xc:0-1 Test.xls + +The extraction output is: +Formatted output of cells by column left to right, columns separated by a tab, end of row is: 0x0A, end of file: \n\n + +.SH NOTES +To interface to Netscape Navigator: first locate the help scripts nsxlview & nsopen. Go into the Edit Preferences dialog box. Click on the Navigator Category and hilight the Applications menu item. Look for Microsoft Excel Worksheet. If you don't see it create one. The MIME type should be: application/vnd.ms-excel The suffixes should be: xls,xlt,xlm,xld,xla,xlc,xlw,xll In the handled by section of the dialog box, check the Application checkbox and set the path to wherever the nsxlview helper script is located and pass a %s argument. For example, if nsxlview is located in /usr/local/bin, then you would put: + +/usr/local/bin/nsxlview %s + +in the Application path box.. (As a side note, make sure the nsxlview script can find the xlhtml program or it won't work.) Click on the OK and you are done. You should be able to use the Test.xls file that is distributed with the program to verify its configured correctly. + +.SH AUTHOR +Charles N Wyble diff --git a/xlhtml/xlhtml.c b/xlhtml/xlhtml.c new file mode 100644 index 0000000..e9b5969 --- /dev/null +++ b/xlhtml/xlhtml.c @@ -0,0 +1,4636 @@ +/*! \file xlhtml.c + \brief converts excel files to Html + + xlhtml generates HTML, XML, csv and tab-delimitted versions of Excel + spreadsheets. +*/ + +/* + Copyright 2002 Charles N Wyble + + 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 + + */ + +#include "tuneable.h" +#include "xlhtml.h" + + +static char SectionName[2][12] = /* The section of the Excel Stream where the workbooks are kept */ +{ + "/Workbook", /*!< Excel 97 & 2000 */ + "/Book" /*!< Everything else ? */ +}; + + +typedef struct /*!< This encapsulates the Unicode String */ +{ + U8 uni; /*!< Unicode String: 0==ASCII/8859-1, 1==windows-1252, 2==utf-8 */ + U8 *str; /*!< Characters of string */ + U16 len; /*!< Length of string */ + U8 *fmt_run; /*!< formatting run, short pairs: offset, index to font */ + U8 crun_cnt; /*!< The count of format runs */ +}uni_string; + +typedef struct /*!< This is everything we need for a cell */ +{ + U16 xfmt; /*!< The high bit will tell us which version 0 =< 2; 1 == 2+ */ + U16 type; /*!< This will record the record type that generated the cell */ + U16 spanned; /*!< If 1 don't output */ + uni_string ustr; /*!< The cell's displayed contents */ + U16 rowspan; /*!< rows to span */ + U16 colspan; /*!< columns to span */ + uni_string h_link; /*!< If a hyperlinked cell, this is the link*/ +}cell; + +typedef struct /*!< This encapsulates some information about each worksheet */ +{ + U32 first_row; + S32 biggest_row; + U32 max_rows; + U16 first_col; + S16 biggest_col; + U16 max_cols; + uni_string ws_title; + cell **c_array; + U16 spanned; +}work_sheet; + +typedef struct /*!< This is everything we need to know about fonts */ +{ + U16 size; + U16 attr; + U16 c_idx; + U16 bold; + U16 super; + U8 underline; + uni_string name; +}font_attr; + +typedef struct +{ + uni_string *name; + U16 cnt; +}fnt_cnt; + +typedef struct /*!< This covers the Extended Format records */ +{ + U16 fnt_idx; + U16 fmt_idx; + U16 gen; + U16 align; + U16 indent; + U16 b_style; + U16 b_l_color; + U32 b_t_color; + U16 cell_color; +}xf_attr; + +typedef struct /*!< HTML Attribute */ +{ + int fflag; /*!< Font Flag */ + int bflag; /*!< Bold Flag */ + int iflag; /*!< Itallic Flag */ + int sflag; /*!< Strike thru flag */ + int uflag; /*!< Underline flag */ + int sbflag; /*!< Subscript */ + int spflag; /*!< Superscript */ +}html_attr; + + +static int numCustomColors = 0; +static U8 **customColors = 0; +static char colorTab[MAX_COLORS][8] = +{ + "000000", /* FIXME: Need to find these first 8 colors! */ + "FFFFFF", + "FFFFFF", + "FFFFFF", + "FFFFFF", + "FFFFFF", + "FFFFFF", + "FFFFFF", + "FFFFFF", /*0x08 - This one's Black, too ??? */ + "FFFFFF", /* This one's normal */ + "red", /* "FF0000", */ + "lime", /* "00FF00", */ + "blue", /* "0000FF", */ + "FFFF00", + "FF00FF", + "aqua", /* "00FFFF", */ + "800000", /* 0x10 */ + "green", /* "008000", */ + "navy", /* "000080", */ + "808000", + "800080", + "teal", /* "008080", */ + "C0C0C0", + "gray", /* "808080", */ + "9999FF", /* 0x18 */ + "993366", + "FFFFCC", + "CCFFFF", + "660066", + "FF8080", + "0066CC", + "CCCCFF", + "000080", + "FF00FF", /* 0x20 */ + "FFFF00", + "00FFFF", + "800080", + "800000", + "008080", + "0000FF", + "00CCFF", /* 0x28 */ + "CCFFFF", + "CCFFCC", + "FFFF99", + "99CCFF", + "FF99CC", + "CC99FF", + "FFCC99", + "3366FF", /* 0x30 */ + "33CCCC", + "99CC00", + "FFCC00", + "FF9900", + "FF6600", + "666699", + "969696", + "003366", /* 0x38 */ + "339966", + "003300", + "333300", + "993300", + "993366", + "333399", + "333333", + "FFFFFF" /* 0x40 */ +}; + +/* FIXME: Support major languages here...not just English */ +static const char month_abbr[12][5] = { "Jan", "Feb", "Mar", "Apr", "May", "June", + "July", "Aug", "Sep", "Oct", "Nov", "Dec" }; +static const int ndays[]={31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; +static const int ldays[]={31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + + +/************************************************************************** +* Functions and data are declared static to prevent name collisions. +***************************************************************************/ +/* Function Prototypes */ +extern void print_version(void); +extern void display_usage(void); + +COLE_LOCATE_ACTION_FUNC scan_file; +void OutputPartialTableAscii(void); +static void OutputTableHTML(void); +static void OutputTableXML(void); + +extern void do_cr(void); +static void main_line_processor(U16, U16, U32, U16, U8); +static void SetupExtraction(void); +static void output_header(void); +static void output_footer(void); +extern U16 getShort(U8 *); +extern S32 getLong(U8 *); +static void getDouble(U8 *, F64 *); +static void RKtoDouble(S32, F64 *); +static void decodeBoolErr(U16, U16, char *); +static int IsCellNumeric(cell *); +static int IsCellSafe(cell *); +static int IsCellFormula(cell *); +static void output_cell(cell *, int); +static void output_formatted_data(uni_string *, U16, int, int); +static void PrintFloatComma(char *, int, F64); +static void print_as_fraction(F64, int); +static void NumToDate(long, int *, int *, int *); +static void FracToTime(U8 *, int *, int *, int *, int *); +static void trim_sheet_edges(unsigned int); +static void update_default_font(unsigned int); +static void incr_f_cnt(uni_string *); +static int get_default_font(void); +static void update_default_alignment(unsigned int, int); +static int null_string(U8 *); +static void OutputString(uni_string *); +static void OutputCharCorrected(U8); +static void update_crun_info(U16 *loc, U16 *fnt_idx, U16 crun_cnt, U8 *fmt_run); +static void put_utf8(U16); +static void print_utf8(U16); +static void uni_string_clear(uni_string *); +static int uni_string_comp(uni_string *, uni_string *); +static void output_start_html_attr(html_attr *h, unsigned int, int); +static void output_end_html_attr(html_attr *h); +static void html_flag_init(html_attr *h); +static void output_start_font_attribute(html_attr *h, U16 fnt_idx); + +/* The array update functions */ +static int ws_init(int); +static int add_more_worksheet_ptrs(void); +static int resize_c_array(work_sheet *, U32, U16); +static void add_wb_array(U16, U16, U16, U16, U8, U8 *, U16, U16, U8 *); +static void update_cell_xf(U16, U16, U16); +static void update_cell_hyperlink(U16 r, U16 c, U8 *hyperlink, int len, U16 type); +static void add_str_array(U8, U8 *, U16, U8 *, U8); +static void add_font(U16, U16, U16, U16, U16, U8, U16, U8 *, U16); +static void add_ws_title(U16, U8 *, U16); +static void add_xf_array(U16 fnt_idx, U16 fmt_idx, U16 gen, U16 align, + U16 indent, U16 b_style, U16 b_l_color, U32 b_t_color, U16 cell_color); + + +/* Global data */ +static char filename[128]; +static int file_version = 0; +static U32 next_string=0; +static unsigned int next_font=0, next_ws_title=0, next_xf=0; +static U8 working_buffer[WBUFF_SIZE]; +static unsigned int bufidx, buflast; /*!< Needed for working buffer */ +static U8 grbit=0; /*!< Needed by the SST Opcode FC */ +static U16 crun=0, cch=0; /*!< Needed by the SST Opcode FC */ +static U32 extrst=0; /*!< Needed by the SST Opcode FC */ +static U16 nonascii = 0; /*!< Needed by the SST Opcode FC */ +static int sheet_count=-2; /*!< Number of worksheets found */ +static U16 last_opcode = -1; /*!< Used for the continue command */ +static unsigned int cont_grbit=0, cont_str_array=0; +static uni_string default_font; /*!< Font for table */ +static int default_fontsize = 3; /*!< Default font size for table */ +static char *default_alignment = 0; /*!< Alignment for table */ +static int first_sheet = 0; /*!< First worksheet to display */ +static int last_sheet = WORKSHEETS_INCR-1; /*!< The last worksheet to display */ +static S16 xp=0, xr1=-1, xr2=-1, xc1=-1, xc2=-1; /*!< Extraction info... */ +static int currency_symbol = '$'; /*!< What to use for currency */ +static U16 str_formula_row = 0; /*!< Data holders for string formulas */ +static U16 str_formula_col = 0; /*!< Data holders for string formulas */ +static U16 str_formula_format = 0; /*!< Data holders for string formulas */ + +/* Limits */ +static unsigned int max_fonts = FONTS_INCR; +static unsigned int max_xformats = XFORMATS_INCR; +static unsigned long max_strings = STRINGS_INCR; +static unsigned int max_worksheets = WORKSHEETS_INCR; + +/* Global arrays */ +static xf_attr **xf_array; +static work_sheet **ws_array; +static uni_string **str_array; +static font_attr **font_array; +static fnt_cnt *f_cnt; +static int fnt_size_cnt[7]; /*!< Html has only 7 sizes... */ +static uni_string author; +static char *title = 0; +static char *lastUpdated = 0; + +/* Command Line flags */ +static int use_colors = 1; /*!< Whether or not to use colors in output */ +int aggressive = 0; /*!< Aggressive html optimization */ +static int formula_warnings = 1; /*!< Whether or not to suppress formula warnings */ +static int center_tables = 0; /*!< Whether or not to center justify tables or leave it left */ +static int trim_edges = 0; /*!< Whether or not to trim the edges of columns or rows */ +static char *default_text_color = "000000"; +static char *default_background_color="FFFFFF"; +static char *default_image=NULL; /*!< Point to background image */ +static int Ascii = 0; /*!< Whether or not to out ascii instaed of html */ +static int Csv = 0; /*!< Whether or not to out csv instaed of html */ +static int OutputXML = 0; /*!< Output as xml */ +static int DumpPage = 0; /*!< Dump page count & max cols & rows */ +static int Xtract = 0; /*!< Extract a range on a page. */ +static int MultiByte = 0; /*!< Output as multibyte */ +static int NoHeaders = 0; /*!< Dont output html header */ + + +/* Some Global Flags */ +static int notAccurate = 0; /*!< Flag used to indicate that stale data was used */ +static int NoFormat = 0; /*!< Flag used to indicated unimplemented format */ +static int NotImplemented = 0; /*!< Flag to print unimplemented cell type message */ +static int Unsupported = 0; /*!< Flag to print unsupported cell type message */ +static int DatesR1904 = 0; /*!< Flag that the dates are based on McIntosh Dates system */ +static int MaxPalExceeded = 0; +static int MaxXFExceeded = 0; +static int MaxFormatsExceeded = 0; +static int MaxColExceeded = 0; +static int MaxRowExceeded = 0; +static int MaxWorksheetsExceeded = 0; +static int MaxStringsExceeded = 0; +static int MaxFontsExceeded = 0; +static int UnicodeStrings = 0; /*!< 0==ASCII, 1==windows-1252, 2==uft-8 */ +static int CodePage = 0; /*!< Micosoft CodePage as specified in the Excel file. */ + + + + +int main (int argc, char **argv) +{ + int i, f_ptr = 0; + U16 k; + U32 j; + COLEFS * cfs; + COLERRNO colerrno; + + if (argc < 2) + { + printf("Incorrect usage. Try xlhtml --help for more information\n"); + exit(0); + } + else + { + strncpy(filename, argv[argc-1], 124); + filename[124] = 0; + for (i=1; i<(argc-1); i++) + { + if (strcmp(argv[i], "-nc") == 0) + use_colors = 0; + else if(strcmp(argv[i], "-xml") == 0 ) + OutputXML = 1; + else if (strcmp(argv[i], "-asc") == 0) + Ascii = 1; + else if (strcmp(argv[i], "--ascii") == 0) + Ascii = 1; + else if (strcmp(argv[i], "-csv") == 0) + { + Ascii = 1; + Csv = 1; + + } + else if (strcmp(argv[i], "-a") == 0) + aggressive = 1; + else if (strcmp(argv[i], "-fw") == 0) + formula_warnings = 0; + else if (strcmp(argv[i], "-c") == 0) + center_tables = 1; + else if (strcmp(argv[i], "-dp") == 0) + DumpPage = 1; + else if (strcmp(argv[i], "-m") == 0) + MultiByte = 1; + else if (strncmp(argv[i], "-tc", 3) == 0) + { + default_text_color = &argv[i][3]; + if (strlen(default_text_color) != 6) + display_usage(); + } + else if (strncmp(argv[i], "-bc", 3) == 0) + { + default_background_color = &argv[i][3]; + if (strlen(default_background_color) != 6) + display_usage(); + } + else if (strncmp(argv[i], "-bi", 3) == 0) + { + default_image = &argv[i][3]; + use_colors = 0; + } + else if (strncmp(argv[i], "-te", 3) == 0) + trim_edges = 1; + else if (strcmp(argv[i], "-v") == 0) + print_version(); + else if(strcmp(argv[i], "-nh") == 0 ) + NoHeaders = 1; + else if (strncmp(argv[i], "-xc:", 4) == 0) + { + int d1, d2; + if (sscanf(argv[i] + 4, "%d-%d", &d1, &d2) != 2) + { + fprintf(stderr, "column range %s not valid, expected -xc:FIRST-LAST\n", argv[i] + 4); + display_usage(); + } + xc1 = (S16)d1; + xc2 = (S16)d2; + Xtract = 1; + if (xc1 > xc2) + { + fprintf(stderr, "last column must be >= the first\n"); + exit(1); + } + } + else if (strncmp(argv[i], "-xp:", 4) == 0) + { + Xtract = 1; + xp = (S16)atoi(&(argv[i][4])); + if (xp < 0) + { + fprintf(stderr, "Negative numbers are illegal.\n"); + exit(1); + } + } + else if (strncmp(argv[i], "-xr:", 4) == 0) + { + char *ptr, *buf; + Xtract = 1; + buf = strdup(argv[i]); + ptr = strrchr(buf, '-'); + xr2 = (S16)atoi(ptr+1); + *ptr = 0; + ptr = strchr(buf, ':'); + xr1 = (S16)atoi(ptr+1); + free(buf); + if (xr1 > xr2) + { + fprintf(stderr, "row's 2nd digit must be >= the first\n"); + exit(1); + } + } + else + display_usage(); + } + if (strcmp(filename, "-v") == 0) + { + print_version(); + exit(0); + } + if (strcmp(filename, "--version") == 0) + { + print_version(); + exit(0); + } + + if (strcmp(filename, "--help") == 0) + display_usage(); + if (strcmp(filename, "-?") == 0) + display_usage(); + } + if (Ascii) + { /* Disable it if DumpPage or Xtract isn't used... */ + if (!(DumpPage||Xtract)) + Ascii = 0; + } + if (Xtract) + trim_edges = 0; /* No trimming when extracting... */ + if (OutputXML) + aggressive = 0; + + /* Init arrays... */ + ws_array = (work_sheet **)malloc(max_worksheets * sizeof(work_sheet*)); + for (i=0; i<(int)max_worksheets; i++) + ws_array[i] = 0; + + str_array = (uni_string **)malloc(max_strings*sizeof(uni_string *)); + for (i=0; i<(int)max_strings; i++) + str_array[i] = 0; + + font_array = (font_attr **)malloc(max_fonts * sizeof(font_attr *)); + f_cnt = (fnt_cnt *)malloc(max_fonts * sizeof(fnt_cnt)); + for (i=0; i<(int)max_fonts; i++) + { /* I assume these won't fail since we are just starting up... */ + font_array[i] = 0; + f_cnt[i].name = 0; + } + xf_array = (xf_attr **)malloc(max_xformats * sizeof(xf_attr *)); + for (i=0; i<(int)max_xformats; i++) + xf_array[i] = 0; + + uni_string_clear(&author); + uni_string_clear(&default_font); + umask(GLOBAL_UMASK); + +#if defined( __WIN32__ ) || defined( __BORLANDC__ ) + { + char *ptr = strchr(filename, ':'); + if (ptr) + { + int len; + char new_drive[MAXPATH]; + fnsplit(filename, new_drive, 0, 0, 0); + if (new_drive[0] >= 'a') + setdisk(new_drive[0] - 'a'); + else + setdisk(new_drive[0] - 'A'); + ptr++; /* Get past the colon */ + len = strlen(ptr); + memmove(filename, ptr, len); + filename[len] = 0; + } + } +#endif + /* If successful, this calls scan_file to extract the work book... */ + cfs = cole_mount(filename, &colerrno); + if (cfs == NULL) + { + cole_perror (NULL, colerrno); + exit(1); + } + while (cole_locate_filename (cfs, SectionName[f_ptr], NULL, scan_file, &colerrno)) + { + if (f_ptr) + { /* Two strikes...we're out! */ + cole_perror (PRGNAME, colerrno); + if (colerrno == COLE_EFILENOTFOUND) + fprintf(stderr, "Section: Workbook\n"); + break; + } + else + f_ptr++; + } + + if (cole_umount (cfs, &colerrno)) + { + cole_perror (PRGNAME, colerrno); + exit(1); + } + + /* For some reason, this loop core dumps on some */ + /* files from Central Europe...so it's commented out for now */ +/* for (i=0; istr) + free(str_array[i]->str); + free(str_array[i]); + } + } */ + + for (i=0; i<(int)max_fonts; i++) + { + if (font_array[i]) + { + if (font_array[i]->name.str) + free(font_array[i]->name.str); + free(font_array[i]); + if (f_cnt[i].name) + { + if (f_cnt[i].name->str) + free(f_cnt[i].name->str); + free(f_cnt[i].name); + } + } + } + free(font_array); + free(f_cnt); + for (i=0; i<(int)max_worksheets; i++) + { + if (ws_array[i]) + { + if (ws_array[i]->ws_title.str) + free(ws_array[i]->ws_title.str); + if (ws_array[i]->c_array) + { + for (j=0; jmax_rows; j++) + { + for (k=0; kmax_cols; k++) + { + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]) + { + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->ustr.str) + free(ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->ustr.str); + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->ustr.fmt_run) + free(ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->ustr.fmt_run); + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->h_link.str) + free(ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->h_link.str); + free(ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]); + } + } + } + free(ws_array[i]->c_array); + } + free(ws_array[i]); + } + } + + for (i=0; i<(int)max_xformats; i++) + { + if (xf_array[i]) + free(xf_array[i]); + } + free(xf_array); + + if (numCustomColors) + { + for (i=0; i 3) + main_line_processor(opcode, version, count-4, target, buf[0]); + else if (count == 0) + { /* Init everything */ + length = 0; + opcode = (U16)buf[0]; + target = 80; /* ficticious number */ + } + else if (count == 1) + version = (U16)buf[0]; + else if (count == 2) + length = (U16)buf[0]; + else if (count == 3) + { + length |= (U16)(buf[0]<<8); + target = length; + } + + if (count == (U32)(target+3)) + count = 0; + else + count++; + if (MaxColExceeded || MaxRowExceeded || MaxWorksheetsExceeded) + break; /* We're outta memory and therefore...done */ + + } + cole_fclose(cf, &err); + + if (Ascii) + { + if (DumpPage) + { /* Output the XLS Parameters */ + int i; + printf("There are %d pages total.\n", sheet_count+1); + for (i=0; i<=sheet_count; i++) + { + printf("Page:%d Name:%s MaxRow:%ld MaxCol:%d\n", i, + ws_array[i]->ws_title.str ? (char *)ws_array[i]->ws_title.str : "(Unknown Page)", + ws_array[i]->biggest_row, ws_array[i]->biggest_col); + } + } + else if (Xtract) + OutputPartialTableAscii(); + } + else + { + if (DumpPage) + { /* Output the XLS Parameters */ + int i; + output_header(); + printf("

There are %d pages total.

\n", sheet_count+1); + for (i=0; i<=sheet_count; i++) + { + printf("

Page:%d Name:%s MaxRow:%ld MaxCol:%d

\n", i, + ws_array[i]->ws_title.str ? (char *)ws_array[i]->ws_title.str : "(Unknown Page)", + ws_array[i]->biggest_row, ws_array[i]->biggest_col); + } + output_footer(); + } + else + { + if( OutputXML ) + OutputTableXML(); + else + OutputTableHTML(); + } + } +} + + + + + +static void OutputTableHTML(void) +{ + int i, j, k; + + output_header(); + if (center_tables) + { + printf("
"); + do_cr(); + } + + SetupExtraction(); + + /* Here's where we dump the Html Page out */ + for (i=first_sheet; i<=last_sheet; i++) /* For each worksheet */ + { + update_default_font(i); + if (ws_array[i] == 0) + continue; + if ((ws_array[i]->biggest_row == -1)||(ws_array[i]->biggest_col == -1)) + continue; + if (ws_array[i]->c_array == 0) + continue; + trim_sheet_edges(i); + + /* Print its name */ + if (next_ws_title > 0) + { + if (ws_array[i]->ws_title.str) + { + printf("

"); + OutputString(&ws_array[i]->ws_title); + printf("


"); + do_cr(); + } + else + { + printf("

(Unknown Page)


"); + do_cr(); + } + } + + /* Now dump the table */ + printf(""); + do_cr(); + printf(""); + do_cr(); + for (j=ws_array[i]->first_row; j<=ws_array[i]->biggest_row; j++) + { + update_default_alignment(i, j); + printf(""); + else + { + if (strcmp(default_alignment, "left") != 0) + printf(" ALIGN=\"%s\"", default_alignment); + if (!aggressive) + printf(" VALIGN=\"bottom\">\n"); + else + printf(">"); + } + for (k=ws_array[i]->first_col; k<=ws_array[i]->biggest_col; k++) + { + output_cell(ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k],0); /* This stuff happens for each cell... */ + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]) + { + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->colspan != 0) + k += ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->colspan-1; + } + } + + if (!aggressive) + printf("\n"); + } + printf("

"); + do_cr(); + } + + if (center_tables) + { + printf("
"); + do_cr(); + } + + /* Print the author's name in itallics... */ + if (author.str) + { + printf("Spreadsheet's Author: "); + OutputString(&author); + printf("
"); + do_cr(); + } + + /* Print when & how the file was last updated. */ + printf("Last Updated "); + if (lastUpdated) + printf("%s  ", lastUpdated); + switch (file_version) + { + case EXCEL95: + printf("with Excel 5.0 or 95"); + break; + case EXCEL97: + printf("with Excel 97"); + break; + default: + printf("with Excel ????"); + break; + } + printf("
"); + do_cr(); + + /* Next print Disclaimers... */ + if (NoFormat) + { + printf("
* This cell's format is not supported.
"); + do_cr(); + } + if ((notAccurate)&&(formula_warnings)) + { + printf("
** This cell's data may not be accurate.
"); + do_cr(); + } + if (NotImplemented) + { + printf("
*** This cell's data type will be supported in the future.
"); + do_cr(); + } + if (Unsupported) + { + printf("
**** This cell's type is unsupported.
"); + do_cr(); + } + + /* Now out exceeded capacity warnings... */ + if (MaxWorksheetsExceeded || MaxRowExceeded || MaxColExceeded || MaxStringsExceeded || + MaxFontsExceeded || MaxPalExceeded || MaxXFExceeded || MaxFormatsExceeded ) + printf("", colorTab[0x0A]); + if (MaxWorksheetsExceeded) + { + printf("The Maximum Number of Worksheets was exceeded, you might want to increase it.
"); + do_cr(); + } + if (MaxRowExceeded) + { + printf("The Maximum Number of Rows was exceeded, you might want to increase it.
"); + do_cr(); + } + if (MaxColExceeded) + { + printf("The Maximum Number of Columns was exceeded, you might want to increase it.
"); + do_cr(); + } + if (MaxStringsExceeded) + { + printf("The Maximum Number of Strings was exceeded, you might want to increase it.
"); + do_cr(); + } + if (MaxFontsExceeded) + { + printf("The Maximum Number of Fonts was exceeded, you might want to increase it.
"); + do_cr(); + } + if (MaxPalExceeded) + { + printf("The Maximum Number of Color Palettes was exceeded, you might want to increase it.
"); + do_cr(); + } + if (MaxXFExceeded) + { + printf("The Maximum Number of Extended Formats was exceeded, you might want to increase it.
"); + do_cr(); + } + if (MaxFormatsExceeded) + { + printf("The Maximum Number of Formats was exceeded, you might want to increase it.
"); + do_cr(); + } + if (MaxWorksheetsExceeded || MaxRowExceeded || MaxColExceeded || MaxStringsExceeded || + MaxFontsExceeded || MaxPalExceeded || MaxXFExceeded || MaxFormatsExceeded ) + printf("
"); + + printf(" 
"); + do_cr(); + + /* Output Credit */ + printf("
Created with xlhtml %s
", VERSION); + do_cr(); + + /* Output Tail */ + output_footer(); +} + +static void OutputTableXML(void) +{ + int i, j, k; + + printf( "\n"); /* Latin-1 */ + break; + case 1: + printf("windows-1252\"?>\n"); /* Microsoft */ + break; + default: + printf("utf-8\"?>\n"); /* Unicode */ + break; + } + + SetupExtraction(); + + printf( "\n" ); + printf( "\t\n" ); + + /* Here's where we dump the Html Page out */ + for (i=first_sheet; i<=last_sheet; i++) /* For each worksheet */ + { + trim_sheet_edges(i); + update_default_font(i); + if (ws_array[i] == 0) + continue; + if ((ws_array[i]->biggest_row == -1)||(ws_array[i]->biggest_col == -1)) + continue; + if (ws_array[i]->c_array == 0) + continue; + + printf( "\t\t\n" ); + printf( "\t\t\t%d\n", i ); + + /* Print its name */ + if (next_ws_title > 0) + { + if (ws_array[i]->ws_title.str) + { + printf("\t\t\t"); + OutputString(&ws_array[i]->ws_title); + printf("\n"); + } + else + printf("\t\t\t(Unknown Page)\n"); + } + + printf( "\t\t\t%ld\n", ws_array[i]->first_row ); + printf( "\t\t\t%ld\n", ws_array[i]->biggest_row ); + printf( "\t\t\t%d\n", ws_array[i]->first_col ); + printf( "\t\t\t%d\n", ws_array[i]->biggest_col ); + printf( "\t\t\t\n" ); + + for (j=ws_array[i]->first_row; j<=ws_array[i]->biggest_row; j++) + { + update_default_alignment(i, j); + printf("\t\t\t\t\n"); + for (k=ws_array[i]->first_col; k<=ws_array[i]->biggest_col; k++) + { + printf("\t\t\t\t\t", j, k ); + output_cell(ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k], 1); /* This stuff happens for each cell... */ + printf("\n" ); + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]) + { + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->colspan != 0) + k += ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->colspan-1; + } + + } + + printf("\n"); + } + printf( "\t\t\t\n" ); + printf("\t\t\n"); + } + printf( "\t\n" ); + + /* Print the author's name in itallics... */ + if (author.str) + { + printf("\t"); + OutputString(&author); + printf("\n"); + } + + /* Print when & how the file was last updated. */ + if (lastUpdated) + printf("\t%s", lastUpdated); + printf( "\t" ); + switch (file_version) + { + case EXCEL95: + printf("using Excel 5.0 or 95"); + break; + case EXCEL97: + printf("using Excel 97/2000"); + break; + default: + printf("using Excel ????"); + break; + } + printf("\n"); + + /* Next print Disclaimers... */ + if (NoFormat) + printf("\t%d\n", NoFormat ); + if ((notAccurate)&&(formula_warnings)) + printf("\t%d\n", notAccurate ); + if (NotImplemented) + printf("\t%d\n", NotImplemented ); + if (Unsupported) + printf("\t%d\n", Unsupported ); + + /* Now out exceeded capacity warnings... */ + if (MaxWorksheetsExceeded) + printf("\tThe Maximum Number of Worksheets were exceeded, you might want to increase it.\n "); + if (MaxRowExceeded) + printf("\tThe Maximum Number of Rows were exceeded, you might want to increase it.\n "); + if (MaxColExceeded) + printf("\tThe Maximum Number of Columns were exceeded, you might want to increase it.\n"); + if (MaxStringsExceeded) + printf("\tThe Maximum Number of Strings were exceeded, you might want to increase it.\n"); + if (MaxFontsExceeded) + printf("\tThe Maximum Number of Fonts were exceeded, you might want to increase it.\n"); + if (MaxPalExceeded) + printf("\tThe Maximum Number of Color Palettes were exceeded, you might want to increase it.\n"); + if (MaxXFExceeded) + printf("\tThe Maximum Number of Extended Formats were exceeded, you might want to increase it.\n"); + if (MaxFormatsExceeded) + printf("\tThe Maximum Number of Formats were exceeded, you might want to increase it.\n"); + + /* Output Credit */ + printf("\tCreated with xlhtml %s\n", VERSION); + printf("\thttp://www.xlhtml.org/\n"); + printf( "\n" ); +} + +static void SetupExtraction(void) +{ + if (Xtract) + { /* Revise the page settings... */ +/* printf("-%d %d %d %d %d
\n", xp, xr1, xr2, xc1, xc2); */ + if ((xp >= first_sheet)&&(xp <= last_sheet)&&(xp <= sheet_count)) + { + first_sheet = xp; + last_sheet = xp; + if (xr1 < 0) + { + xr1 = (S16)ws_array[xp]->first_row; + xr2 = (S16)ws_array[xp]->biggest_row; + } + else if ((xr1 >= ws_array[xp]->first_row)&&(xr1 <= ws_array[xp]->biggest_row) + &&(xr2 >= ws_array[xp]->first_row)&&(xr2 <= ws_array[xp]->biggest_row)) + { + ws_array[xp]->first_row = xr1; + ws_array[xp]->biggest_row = xr2; + + if (xc1 < 0) + { + xc1 = ws_array[xp]->first_col; + xc2 = ws_array[xp]->biggest_col; + } + else if((xc1 >= ws_array[xp]->first_col)&&(xc1 <= ws_array[xp]->biggest_col) + &&(xc2 >= ws_array[xp]->first_col)&&(xc2 <= ws_array[xp]->biggest_col)) + { + ws_array[xp]->first_col = xc1; + ws_array[xp]->biggest_col = xc2; + } + else + { + if (Ascii) + fprintf(stderr, "Error - Col not in range during extraction" + " (%d or %d not in [%d..%d])\n", xc1, xc2, ws_array[xp]->first_col, ws_array[xp]->biggest_col); + else + { + printf("Error - Col not in range during extraction.\n"); + output_footer(); + } + return; + } + } + else + { + if (Ascii) + fprintf(stderr, "Error - Row not in range during extraction" + " (%d or %d not in [%ld..%ld])\n", xr1, xr2, ws_array[xp]->first_row, ws_array[xp]->biggest_row); + else + { + printf("Error - Row not in range during extraction."); + output_footer(); + } + return; + } + } + else + { + if (Ascii) + fprintf(stderr, "Error - Page not in range during extraction."); + else + { + printf("Error - Page not in range during extraction."); + output_footer(); + } + return; + } + } +} + +static void output_header(void) +{ /* Ouput Header */ + if (NoHeaders) + return; + if (!aggressive) + { + printf(""); + do_cr(); + } + printf(""); + do_cr(); + printf("", CodePage); + else + { + switch (UnicodeStrings) + { + case 0: + printf("iso-8859-1\">"); /* Latin-1 */ + break; + case 1: + printf("windows-1252\">"); /* Microsoft */ + break; + default: + printf("utf-8\">"); /* Unicode */ + break; + } + } + do_cr(); + + if (!aggressive) + { + printf(""); + do_cr(); + } + printf(""); + if (title) + printf("%s", title); + else + printf("%s", filename); + printf(""); + do_cr(); + printf(""); + do_cr(); + do_cr(); + printf("
"); + do_cr(); +} + +static void output_footer(void) +{ + if (NoHeaders) + return; + printf(""); + do_cr(); + fflush(stdout); +} + +/*!****************************************************************** +* \param count the absolute count in the record +* \param last the size of the record +* \param bufidx the index into the working buffer +* \param buflast the expected length of the working buffer +********************************************************************/ +static void main_line_processor(U16 opcode, U16 version, U32 count, U16 last, U8 data) +{ + U16 cont_opcode = 0; + + /* If first pass, reset stuff. */ + if (count == 0) + { + if (opcode != 0x3C) /* continue command */ +/* { + printf("\n* * * * * * CONTINUE * * * * * * * * *\n\n"); + } + else */ + { /* Normal path... */ + last_opcode = opcode; + bufidx = 0; + buflast = 0; + cont_str_array = 0; + memset(working_buffer, 0, WBUFF_SIZE); + } + } + if (opcode == 0x3C) + { + opcode = last_opcode; + cont_opcode = 1; + } + + /* Abort processing if too big. Next opcode will reset everything. */ + if (bufidx >= WBUFF_SIZE) + { + /*printf("OC:%02X C:%04X I:%04X BL:%04X cch:%04X gr:%04X\n", opcode, count, bufidx, buflast, cch, grbit); */ + /*abort(); */ + return; + } + + /* no chart processing for now. */ + if (version == 0x0010) + return; + + switch (opcode) + { + case 0x09: /* BOF */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + if (file_version == 0) + { /* File version info can be gathered here... + * 4 = Excel version 4 + * 1280 = Excel version 5 + * 0500 = Excel 95 + * 1536 = Excel 97 */ + if (version == 8) + file_version = getShort(&working_buffer[0]); + else + file_version = version; + if (file_version == EXCEL95) + { + use_colors = 0; + HARD_MAX_ROWS = HARD_MAX_ROWS_95; + } +/* printf("Biff:%X\n", file_version); */ + } + sheet_count++; + if (sheet_count >= (int)max_worksheets) + add_more_worksheet_ptrs(); + } + break; + case 0x01: /* Blank */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 r, c, f; + + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[2]); + if (version == 2) + f = getShort(&working_buffer[4]); + else + f = 0; + add_wb_array(r, c, f, opcode, (U16)0, (U8 *)0, 0, (U16)0, 0); + } + break; + case 0x02: /* Integer */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 r, c, i, f; + char temp[32]; + + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[2]); + if (version == 2) + { + f = getShort(&working_buffer[4]); + i = getShort(&working_buffer[7]); + sprintf(temp, "%d", i); + } + else + { + f = 0; + Unsupported++; + strcpy(temp, OutputXML ? "INT" : "****INT"); + } + add_wb_array(r, c, f, opcode, (U16)0, (U8 *)temp, (U16)strlen(temp), 0, NULL); + } + break; + case 0x03: /* Number - Float */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 r, c, f; + F64 d; + char temp[64]; + + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[2]); + if (version == 2) + { + f = getShort(&working_buffer[4]); + getDouble(&working_buffer[6], &d); + sprintf(temp, "%.15g", d); + } + else + { /* Who knows what the future looks like */ + f = 0; + Unsupported = 1; + sprintf(temp, "****FPv:%d", version); + } + add_wb_array(r, c, f, opcode, (U16)0, (U8 *)temp, (U16)strlen(temp), 0, 0); + } + break; + case 0xD6: /* RString */ + working_buffer[bufidx++] = data; + if ((bufidx == 8)&&(buflast == 0)) + buflast = 8 + getShort(&working_buffer[6]); + if (buflast) + { + if (bufidx == buflast) + { + U16 r, c, l, f; + + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[2]); + f = getShort(&working_buffer[4]); + l = getShort(&working_buffer[6]); + working_buffer[8+l] = 0; + + add_wb_array(r, c, f, opcode, (U16)0, &working_buffer[8], + (U16)strlen((char *)&working_buffer[8]), 0, 0); + } + } + break; + case 0x04: /* Label - UNI */ + working_buffer[bufidx++] = data; + if (file_version == EXCEL95) + { + if (bufidx == last) + { + U16 r, c, f; + + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[2]); + f = getShort(&working_buffer[4]); + working_buffer[bufidx] = 0; + + add_wb_array(r, c, f, opcode, (U16)0, &working_buffer[8], + (U16)strlen((char *)&working_buffer[8]), 0, 0); + } + } + else if (file_version == EXCEL97) + { /* Remember, bufidx is 1 more than it should be */ + if ((bufidx == 8)&&(buflast == 0)) + { /* buflast = working_buffer[7]; */ + cch = getShort(&working_buffer[6]); + buflast = cch + 9; + } + if (bufidx == 9) + { + if (working_buffer[8] == 1) + buflast = (cch << 1) + 9; + } + if (buflast) + { + if (bufidx == buflast) + { + U16 r, c, f; + U16 len; + + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[2]); + if (version == 2) + f = getShort(&working_buffer[4]); + else /* Unknown version */ + f = 0; + working_buffer[bufidx] = 0; + + len = (U16)strlen((char *)&working_buffer[8]); + if (working_buffer[8] == 1) + { + UnicodeStrings = 2; + add_wb_array(r, c, f, opcode, (U16)2, &working_buffer[9], (U16)(cch << 1), 0, 0); + } + else + add_wb_array(r, c, f, opcode, (U16)0, &working_buffer[8], len, 0, 0); + } + } + } + break; + case 0x05: /* Boolerr */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 r, c, f; + char temp[16]; + + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[2]); + if (version == 2) + { + f = getShort(&working_buffer[4]); + decodeBoolErr(working_buffer[6], working_buffer[7], temp); + add_wb_array(r, c, f, opcode, (U16)0, (U8 *)temp, (U16)strlen(temp), 0, 0); + } + else + { + f = 0; + Unsupported = 1; + strcpy(temp, "****Bool"); + add_wb_array(r, c, f, opcode, (U16)0, (U8 *)temp, (U16)strlen(temp), 0, 0); + } + } + break; + /************ + * This function has 2 entry points. 1 is the mainline FC opcode. + * In this event there are several bytes that setup the type of + * strings that will follow. Then there is the continue entry + * point which is immediate - e.g location 0. + *************/ + case 0xFC: /* Packed String Array A.K.A. SST Shared String Table...UNI */ + if ((count > 7)||(cont_opcode == 1)) /* Skip the 1st 8 locations they are bs */ + { +/* if ((count == 0)&&(data == 0)&&(buflast)) */ + if ((count == 0)&&(cont_opcode == 1)&&(buflast)) + { +/* printf("Adjusting...\n"); */ +/* printf("I:%04X BL:%04X\n", bufidx, buflast); */ + cont_str_array = 1; + cont_grbit = data; + return; + } + + working_buffer[bufidx] = data; + bufidx++; + + if((cont_str_array)&&(grbit & 0x01)&& !(cont_grbit & 0x01)) + { /* ASCII -> unicode */ + working_buffer[bufidx] = 0; + bufidx++; + } + + if (buflast == 0) /* Header processor */ + { + if (bufidx == 0x03) /* After 3 locations we have length */ + { /* and type of chars... */ + cch = getShort(&working_buffer[0]); + grbit = working_buffer[2]; + + if (grbit < 0x04) /* Normal run */ + { + nonascii = 0; + bufidx = 0; + crun = 0; + extrst = 0; + buflast = cch << (grbit & 0x01); + + /* special case for empty strings */ + if (!cch && !buflast) + add_str_array(0, (U8 *)0, 0, 0, 0); + else + memset(working_buffer, 0, WBUFF_SIZE); + } + } + else if (bufidx == 0x05) + { + if ((grbit & 0x0C) == 0x08) /* Rich string only */ + { + nonascii = 0; + bufidx = 0; + crun = getShort(&working_buffer[3]); + extrst = 0; + buflast = (cch << (grbit & 0x01)) + (crun*4); +/* printf("rtbuflast:%X cch%X grbit:%X extrst:%X crun:%X last:%X\n", + buflast, cch, grbit, extrst, crun, last); + printf("%02X %02X %02X %02X %02X %02X\n", + working_buffer[0], working_buffer[1], working_buffer[2], + working_buffer[3], working_buffer[4], working_buffer[5]); */ + memset(working_buffer, 0, WBUFF_SIZE); + } + } + else if (bufidx == 0x07) + { + if ((grbit & 0x0C) == 0x04) /* Extended string only */ + { + nonascii = 0; + bufidx = 0; + crun = 0; + extrst = getLong(&working_buffer[3]); + buflast = (cch << (grbit & 0x01)) + extrst; +/* printf("esbuflast:%X cch%X grbit:%X extrst:%X last:%X\n", + buflast, cch, grbit, extrst, last); + printf("%02X %02X %02X %02X %02X %02X\n", + working_buffer[0], working_buffer[1], working_buffer[2], + working_buffer[3], working_buffer[4], working_buffer[5]); */ + memset(working_buffer, 0, WBUFF_SIZE); + } + } + else if (bufidx == 0x09) + { + if ((grbit & 0x0C) == 0x0C) + { + /* Rich String + Extended String **/ + nonascii = 0; + bufidx = 0; + crun = getShort(&working_buffer[3]); + extrst = getLong(&working_buffer[5]); + buflast = (cch << (grbit & 0x01)) + extrst + (crun*4); +/* printf("xrtbuflast:%X cch%X grbit:%X extrst:%X crun:%X last:%X\n", + buflast, cch, grbit, extrst, crun, last); + printf("%02X %02X %02X %02X %02X %02X\n", + working_buffer[0], working_buffer[1], working_buffer[2], + working_buffer[3], working_buffer[4], working_buffer[5]); */ + memset(working_buffer, 0, WBUFF_SIZE); + } + } +/* printf("*%02X ", data); */ + } + else /* payload processor */ + { +/* if (cont_opcode == 1) + printf(" %02X", data); */ + if (data > 127) + nonascii = 1; + if (bufidx == buflast) + { + U8 uni; + U16 len = (U16)(cch << (grbit & 0x01)); +/* int i; */ + + if (grbit & 01) + { + uni = 2; + UnicodeStrings = 2; + } + else + uni = nonascii; + working_buffer[bufidx] = 0; +/* fprintf(stderr,":buflast-"); */ +/* { int i; */ +/* for (i=0; i UnicodeStrings) /* Try to "upgrade" charset */ + UnicodeStrings = uni; + bufidx = 0; + buflast = 0; + cch = 0; + cont_str_array = 0; + memset(working_buffer, 0, WBUFF_SIZE); + } + } + } + break; + case 0xFD: /* String Array Index A.K.A. LABELSST */ + working_buffer[count] = data; + if (count == (last - 1)) + { + U32 i; + U16 r, c, f; + + /* This is byte reversed... */ + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[2]); + f = getShort(&working_buffer[4]); + i = getLong(&working_buffer[6]); + if (i < next_string) + { +/* printf("String used:%d\n", (int)i); */ + if (str_array[i]) + { + if (str_array[i]->str) + add_wb_array( + r, c, f, opcode, + str_array[i]->uni, str_array[i]->str, + str_array[i]->len, str_array[i]->crun_cnt, str_array[i]->fmt_run); + } + else /* Error, so just set it empty */ + add_wb_array( r, c, f, opcode, + (U16)0, (U8 *)"String Table Error", 18, 0, 0); + } + else + MaxStringsExceeded = 1; + } + break; + case 0x31: /* Font */ + working_buffer[bufidx++] = data; + if (bufidx > 14) /* Address 14 has length in unicode chars */ + { + if ((file_version == EXCEL95)&&(bufidx == last)) + { /* Microsoft doesn't stick to their documentation. Excel 97 is supposed + to be 0x0231...but its not. Have to use file_version to separate them. */ + unsigned int i; + U16 size, attr, c_idx, b, su; + U8 u; + + size = getShort(&working_buffer[0]); + attr = getShort(&working_buffer[2]); + c_idx = getShort(&working_buffer[4]); + b = getShort(&working_buffer[6]); + su = getShort(&working_buffer[8]); + u = working_buffer[10]; + buflast = working_buffer[14]; + for (i=0; i 0x0080U) && (uni == 0)) + uni = 1; + } + } + else + { + for (i=0; i (last-3)) + len = (U16)(last-3); + if (file_version == EXCEL97) + { + /* Check for unicode. Terminate the buffer at 2x len + since unicode is 2bytes per char. Then see if + strlen is short...upperbyte is usually 0 in + western chararcter sets. */ + int t = len << 1; + if ((t+3) < WBUFF_SIZE) + working_buffer[t+3] = 0; + else + working_buffer[len+3] = 0; + if ((len+3) < last) + { + uni = 2; + len = (U16)t; + } + str = &working_buffer[3]; + } + else if (file_version == EXCEL95) + { + str = &working_buffer[2]; + working_buffer[len+2] = 0; + } + else + { + if (OutputXML) + str = (U8*)"String Formula"; + else + str = (U8*)"***String Formula"; + len = (U16)strlen((char*)str); + NotImplemented++; + } + add_wb_array(str_formula_row, str_formula_col, str_formula_format, opcode, uni, str, len, 0, 0); + } + break; + case 0x5C: /* Author's name A.K.A. WRITEACCESS */ + working_buffer[bufidx++] = data; + if ((bufidx == last)&&(author.str == 0)) + { + if (file_version == EXCEL97) + { + author.len = getShort(&working_buffer[0]); + if ((int)working_buffer[2] & 0x01) + { + author.len *= (U16)2; + author.uni = 2; + } + else + author.uni = 0; + if (author.len > (last-2)) + author.len = (U16)(last-2); + author.str = (U8 *)malloc(author.len+1); + if (author.str) + { + memcpy(author.str, &working_buffer[3], author.len); + author.str[author.len] = 0; + } + } + else if (file_version == EXCEL95) + { + author.len = working_buffer[0]; + author.str = (U8 *)malloc(author.len+1); + if (author.str) + { + memcpy(author.str, &working_buffer[1], author.len); + author.str[author.len] = 0; + } + author.uni = 0; + } + } + break; + case 0x08: /* Row Data */ + /* There's actually some other interesting things + here that we're not collecting. For now, we'll + Just get the dimensions of the sheet. */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + /* question...what is the actual limit? + This can go as high as 64K. Is this really OK? */ + U16 i, r, fc, lc, d, xf; + r = getShort(&working_buffer[0]); + fc = getShort(&working_buffer[2]); + lc = (U16)(getShort(&working_buffer[4]) - (U16)1); + d = getShort(&working_buffer[12]); + xf = getShort(&working_buffer[14]); + + if (ws_array[sheet_count] == 0) + if (ws_init(sheet_count)) + return; + + if (r > ws_array[sheet_count]->biggest_row) + { + if (r < ws_array[sheet_count]->max_rows) + ws_array[sheet_count]->biggest_row = r; + else + { /* Resize the array... */ + if (MaxRowExceeded == 0) + { + int diff = (r/ROWS_INCR) + 1; + if(resize_c_array(ws_array[sheet_count], ROWS_INCR*diff, 0)) + { + ws_array[sheet_count]->biggest_row = ws_array[sheet_count]->max_rows - 1; + MaxRowExceeded = 1; + return; + } + else + ws_array[sheet_count]->biggest_row = r; + } + else + return; + } + } + + if (lc > ws_array[sheet_count]->biggest_col) + { + if (lc < ws_array[sheet_count]->max_cols) + ws_array[sheet_count]->biggest_col = lc; + else + { /* Resize array... */ + if (MaxColExceeded == 0) + { + int diff = (lc/COLS_INCR) + 1; + if (resize_c_array(ws_array[sheet_count], 0, (U16)(COLS_INCR*diff))) + { + ws_array[sheet_count]->biggest_col = (S16)(ws_array[sheet_count]->max_cols - 1); + MaxColExceeded = 1; + lc = ws_array[sheet_count]->max_cols; + } + else + ws_array[sheet_count]->biggest_col = lc; + } + else + lc = ws_array[sheet_count]->max_cols; + } + } + if ((fc < ws_array[sheet_count]->max_cols)&&(d & 0x0080)) /* fGhostDirty flag */ + { + for (i=fc; i>2; + switch (t) + { + case 0: + RKtoDouble(n2, &d); + sprintf(temp, "%.15g", d); + break; + case 1: + RKtoDouble(n2, &d); + sprintf(temp, "%.15g", d / 100.0); + break; + case 2: + sprintf(temp, "%ld", (S32)n2); + break; + default: + d = (F64) n2; + sprintf(temp, "%.15g", d / 100.0 ); + break; + } + add_wb_array(r, c, f, opcode, (U16)0, (U8 *)temp, (U16)strlen(temp), 0, 0); + } + break; + case 0xBC: /* Shared Formula's */ +/* working_buffer[bufidx++] = data; + if (bufidx == last) + { + int fr, lr, fc, lc, i, j; + fr = getShort(&working_buffer[0]); + lr = getShort(&working_buffer[2]); + fc = working_buffer[4]; + lc = working_buffer[5]; + for (i=fr; i<=lr; i++) + { + for (j=fc; j<=lc; j++) + add_wb_array(i, j, (U16)0, opcode, 0, "***SHRFORMULA", 13); + } + NotImplemented = 1; + } */ + break; + case 0x21: /* Arrays */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 fr, lr, fc, lc, i, j; + fr = getShort(&working_buffer[0]); + lr = getShort(&working_buffer[2]); + fc = working_buffer[4]; + lc = working_buffer[5]; + for (i=fr; i<=lr; i++) + { + for (j=fc; j<=lc; j++) + add_wb_array(i, j, (U16)0, opcode, 0, (U8 *)"***Array", 8, 0, 0); + } + NotImplemented = 1; + } + break; + case 0xBD: /* MULRK */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 r, fc, lc; + int i; + r = getShort(&working_buffer[0]); + fc = getShort(&working_buffer[2]); + lc = getShort(&working_buffer[last-2]); + for (i=0; i<=(lc-fc); i++) + { + U32 t; + S32 n2, n; /* Must be signed long !!! */ + U16 f; + F64 d; + char temp[64]; + + f = getShort(&working_buffer[4+(i*6)]); + n = getLong(&working_buffer[6+(i*6)]); + t = n & 0x03; + n2 = n>>2; + switch (t) + { + case 0: + RKtoDouble(n2, &d); + sprintf(temp, "%.15g", d); + break; + case 1: + RKtoDouble(n2, &d); + sprintf(temp, "%.15g", d / 100.0); + break; + case 2: + sprintf(temp, " %ld", (S32)n2); + break; + default: + d = (F64) n2; + sprintf(temp, "%.15g", d / 100.0 ); + break; + } +/* printf("%08X %02X %s %d %d\n", n2, t, temp, r, fc+i); */ + add_wb_array(r, fc+i, f, opcode, (U16)0, (U8 *)temp, (U16)strlen(temp), 0, 0); + } + } + break; + case 0xBE: /* MULBLANK */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 r, fc, lc, j, f; + r = getShort(&working_buffer[0]); + fc = getShort(&working_buffer[2]); + lc = getShort(&working_buffer[last-2]); + for (j=0; j<=(lc-fc); j++) + { /* This just stores format strings... */ + f = getShort(&working_buffer[4+(j*2)]); + add_wb_array(r, fc+j, f, opcode, (U16)0, (U8 *)0, (U16)0, 0, 0); + } + } + break; + case 0x18: /* Name UNI */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + char *ptr; + working_buffer[bufidx] = 0; + ptr = (char *)strstr((char *)&working_buffer[15], "LastUpdate"); + if (ptr) + { + ptr += 13; + lastUpdated = (char *)malloc(strlen(ptr)+1); + if (lastUpdated) + strcpy(lastUpdated, ptr); + } + else + { + ptr = (char *)strstr((char *)&working_buffer[15], "Title"); + if (ptr) + { + ptr += 8; + title = (char *)malloc(strlen(ptr)+1); + if (title) + strcpy(title, ptr); + } + } + } + break; + case 0xE0: /* Extended format */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 fnt_idx; + U16 fmt_idx; + U16 gen; + U16 align; + U16 indent; + U16 b_style; + U16 b_l_color; + U32 b_t_color; + U16 cell_color; + + fnt_idx = getShort(&working_buffer[0]); + fmt_idx = getShort(&working_buffer[2]); + gen = getShort(&working_buffer[4]); + align = getShort(&working_buffer[6]); + indent = getShort(&working_buffer[8]); + b_style = getShort(&working_buffer[10]); + if (file_version == EXCEL95) + { + b_l_color = 0; + b_t_color = 0; + cell_color = (U16)(getShort(&working_buffer[12]) & (U16)0x1FFF); + } + else /* Excel 97 + */ + { + b_l_color = getShort(&working_buffer[12]); + b_t_color = getLong(&working_buffer[14]); + cell_color = getShort(&working_buffer[18]); + } + + /* printf("XF:%02X FG:%02X BG:%02X\n", next_xf, cell_color&0x007F, (cell_color&0x1F80)>>7); */ + /* printf("XF:%02X M:%02X b_t:%04X
\n", next_xf, indent, b_t_color); */ + add_xf_array(fnt_idx, fmt_idx, gen, align, indent, b_style, + b_l_color, b_t_color, cell_color); + } + break; + case 0xE5: /* CELL MERGE INSTRUCTIONS */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { + U16 num, fr, lr, fc, lc, i, j, k; + ws_array[sheet_count]->spanned = 1; + num = getShort(&working_buffer[0]); + if (ws_array[sheet_count]->c_array == 0) + return; + + for (i=0; ic_array) + { + if ((fr > lr)||(fr > ws_array[sheet_count]->biggest_row)||(lr > ws_array[sheet_count]->biggest_row)) + lr = (U16)ws_array[sheet_count]->biggest_row; + if ((fc > lc)||(fc > ws_array[sheet_count]->biggest_col)||(lc > ws_array[sheet_count]->biggest_col)) + lc = ws_array[sheet_count]->biggest_col; + for(j=fr; j<=lr; j++) + { /* For each row */ + for(k=fc; k<=lc; k++) + { /* for each column */ + c = ws_array[sheet_count]->c_array[(j*ws_array[sheet_count]->max_cols)+k]; + if (c != 0) + { + c->spanned = 1; + c->rowspan = 0; + if (k == fc) + c->colspan = (U16)((lc-fc)+1); + else + c->colspan = 0; + } +/* else + { / Need to create one... + printf("Bad One at:%d %d %d
\n", sheet_count, j, k); + } */ + } + } + } + /* Now reset the first one... */ +/* printf("s:%d fr:%d fc:%d lr:%d lc:%d
\n", sheet_count, fr, fc, lr, lc); */ + c = ws_array[sheet_count]->c_array[(fr*ws_array[sheet_count]->max_cols)+fc]; + if (c != 0) + { + c->spanned = 0; + c->rowspan = (U16)(lr-fr); + c->colspan = (U16)(lc-fc); + if (c->rowspan) + c->rowspan++; + if (c->colspan) + c->colspan++; + } + } + } + } + break; + case 0xB8: /* Hyperlink */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { /* This is based on Office 97 info... */ + U16 r, c, uni_type, off; + U32 len; + + r = getShort(&working_buffer[0]); + c = getShort(&working_buffer[4]); + if (working_buffer[32] == 0xE0) + { /* Unicode format */ + len = getLong(&working_buffer[48]); + off = 52; + uni_type = 2; + } + else + { /* Ascii format */ + len = getLong(&working_buffer[50]); + off = 54; + uni_type = 0; + } + if (len > (U32)(bufidx - off)) + { /* correct misidentified links */ + if (uni_type == 0) + { + off = 36; + uni_type = 2; + len = getLong(&working_buffer[32]) * 2; + } + else + len = bufidx - off; /* safety measure to make sure it doen't blow up */ + } + update_cell_hyperlink(r, c, &working_buffer[off], len, uni_type); + } + break; + case 0x92: /* Color Palette */ + working_buffer[bufidx++] = data; + if (bufidx == last) + { /* This is based on Office 97 info... */ + int i; + U8 red, green, blue; + U16 cnt = getShort(&working_buffer[0]); + numCustomColors = cnt; + customColors = (U8 **)calloc(cnt+1, sizeof(char *)); + for (i=0; i */ +/*! Little Endian - 0x86 family */ +static void getDouble(U8 *ptr, F64 *d) +{ + size_t i; + F64 dd; + U8 *t = (U8 *)ⅆ + + for (i=0; isw) + +#ifndef WORDS_BIGENDIAN /*! Defined in */ +/*! Little Endian - 0x86 family */ +static void RKtoDouble(S32 n, F64 *d) +{ + noaliasdub(swords,d)[0] = 0; + noaliasdub(swords,d)[1] = n << 2; +} +#else +/*! Big Endian version - UltraSparc's, etc. */ +static void RKtoDouble(S32 n, F64 *d) +{ + U8 *ptr = (U8 *)&n; + + noaliasdub(swords,d)[1] = 0; + noaliasdub(swords,d)[0] = + ((*(ptr+0)<<24)+(*(ptr+1)<<16)+(*(ptr+2)<<8)+(*(ptr+3))) << 2; +} +#endif + +/*! returns 1 on error, 0 on success */ +static int ws_init(int i) +{ + U32 j; + U16 k; + if (i >= (int)max_worksheets) + return 1; + + ws_array[i] = (work_sheet *)malloc(sizeof(work_sheet)); + if (ws_array[i]) + { + ws_array[i]->spanned = 0; + ws_array[i]->first_row = 0; + ws_array[i]->biggest_row = -1; + ws_array[i]->max_rows = ROWS_INCR; + ws_array[i]->first_col = 0; + ws_array[i]->biggest_col = -1; + ws_array[i]->max_cols = COLS_INCR; + uni_string_clear(&ws_array[i]->ws_title); + ws_array[i]->c_array = (cell **)malloc(ROWS_INCR*COLS_INCR*sizeof(cell *)); + if (ws_array[i]->c_array == 0) + return 1; + for (j=0; jc_array[(j*ws_array[i]->max_cols)+k] = 0; + } + else + return 1; + + return 0; +} + +/*! returns 1 on error, 0 on success */ +static int add_more_worksheet_ptrs(void) +{ + work_sheet **tws_array; + int pages; + + if (MaxWorksheetsExceeded) + return 1; + + if (sheet_count > (int)max_worksheets) + pages = (((sheet_count - max_worksheets)/WORKSHEETS_INCR) + 1) * WORKSHEETS_INCR; + else + pages = WORKSHEETS_INCR; + tws_array = (work_sheet **)realloc(ws_array, + (max_worksheets + pages) * sizeof(work_sheet *)); + + if (tws_array == NULL) + { + MaxWorksheetsExceeded = 1; + return 1; + } + else + { /* Next init the array... */ + unsigned int i; + + ws_array = tws_array; + + for (i=max_worksheets; ic_array == 0) + return 1; + + tc_array = (cell **)malloc((ws->max_rows+new_rows)*(ws->max_cols+new_cols)*sizeof(cell *)); + + if (tc_array == NULL) + return 1; + else + { + U32 j; + U16 k; + + memset(tc_array, 0, (ws->max_rows+new_rows)*(ws->max_cols+new_cols)*sizeof(cell *)); + for (j=0; j<(ws->max_rows); j++) + { + for (k=0; kmax_cols; k++) + tc_array[(j*(ws->max_cols+new_cols))+k] = ws->c_array[(j*ws->max_cols)+k]; + } + ws->max_cols += new_cols; + ws->max_rows += new_rows; + free(ws->c_array); + ws->c_array = tc_array; + } + return 0; +} + +static void add_wb_array(U16 r, U16 c, U16 xf, U16 type, U8 uni, + U8 *str, U16 len, U16 crun_cnt, U8 *fmt_run) +{ + work_sheet *ws; + + if ((sheet_count < 0)||(r > HARD_MAX_ROWS)||(c > HARD_MAX_COLS)) + return; + if (sheet_count >= (int)max_worksheets) + { + if (add_more_worksheet_ptrs()) + return; + } + if (ws_array[sheet_count] == 0) + { + if (ws_init(sheet_count)) + return; + } + ws = ws_array[sheet_count]; + if (r >= ws->max_rows) + { + if (MaxRowExceeded) + return; + else + { + int diff = ((r-ws->max_rows)/ROWS_INCR)+1; + if(resize_c_array(ws, ROWS_INCR*diff, 0)) + { + MaxRowExceeded = 1; + return; + } + } + } + if (c >= ws->max_cols) + { + if (MaxColExceeded) + return; + else + { + U16 diff = (U16)(((c-ws->max_cols)/COLS_INCR)+1); + if(resize_c_array(ws, 0, (U16)(COLS_INCR*diff))) + { + MaxColExceeded = 1; + return; + } + } + } + if (ws->c_array[(r*ws->max_cols)+c] == 0) + { + if (r > ws_array[sheet_count]->biggest_row) + ws_array[sheet_count]->biggest_row = r; + if (c > ws_array[sheet_count]->biggest_col) + ws_array[sheet_count]->biggest_col = c; + ws->c_array[(r*ws->max_cols)+c] = (cell *)malloc(sizeof(cell)); + if (ws->c_array[(r*ws->max_cols)+c]) + { + if (str) + { + ws->c_array[(r*ws->max_cols)+c]->ustr.str = (U8 *)malloc(len+1); + if (ws->c_array[(r*ws->max_cols)+c]->ustr.str) + { + memcpy(ws->c_array[(r*ws->max_cols)+c]->ustr.str, str, len); + ws->c_array[(r*ws->max_cols)+c]->ustr.str[len] = 0; + } + ws->c_array[(r*ws->max_cols)+c]->ustr.uni = uni; + ws->c_array[(r*ws->max_cols)+c]->ustr.len = len; + if (fmt_run && crun_cnt) + { + int rlen = crun_cnt*4; + + ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run = malloc(rlen); + if (ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run) + { + memcpy(ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run, fmt_run, rlen); + ws->c_array[(r*ws->max_cols)+c]->ustr.crun_cnt = crun_cnt; + } + else + ws->c_array[(r*ws->max_cols)+c]->ustr.crun_cnt = 0; + } + else + { + ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run = 0; + ws->c_array[(r*ws->max_cols)+c]->ustr.crun_cnt = 0; + } + } + else + uni_string_clear(&ws->c_array[(r*ws->max_cols)+c]->ustr); + + ws->c_array[(r*ws->max_cols)+c]->xfmt = xf; + ws->c_array[(r*ws->max_cols)+c]->type = type; + ws->c_array[(r*ws->max_cols)+c]->spanned = 0; + ws->c_array[(r*ws->max_cols)+c]->rowspan = 0; + ws->c_array[(r*ws->max_cols)+c]->colspan = 0; + uni_string_clear(&ws->c_array[(r*ws->max_cols)+c]->h_link); + } + } + else /* Default attributes already copied */ + { + if (r > ws_array[sheet_count]->biggest_row) + ws_array[sheet_count]->biggest_row = r; + if (c > ws_array[sheet_count]->biggest_col) + ws_array[sheet_count]->biggest_col = c; + if (str) + { /* Check if a place holder is there and free it */ + if (ws->c_array[(r*ws->max_cols)+c]->ustr.str != 0) + free(ws->c_array[(r*ws->max_cols)+c]->ustr.str); + + ws->c_array[(r*ws->max_cols)+c]->ustr.str = (U8 *)malloc(len+1); + if (ws->c_array[(r*ws->max_cols)+c]->ustr.str) + { + memcpy(ws->c_array[(r*ws->max_cols)+c]->ustr.str, str, len); + ws->c_array[(r*ws->max_cols)+c]->ustr.str[len] = 0; + } + ws->c_array[(r*ws->max_cols)+c]->ustr.len = len; + ws->c_array[(r*ws->max_cols)+c]->ustr.uni = uni; + if (fmt_run && crun_cnt) + { + int rlen = crun_cnt*4; + + ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run = malloc(rlen); + if (ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run) + { + memcpy(ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run, fmt_run, rlen); + ws->c_array[(r*ws->max_cols)+c]->ustr.crun_cnt = crun_cnt; + } + else + ws->c_array[(r*ws->max_cols)+c]->ustr.crun_cnt = 0; + } + else + { + ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run = 0; + ws->c_array[(r*ws->max_cols)+c]->ustr.crun_cnt = 0; + } + } + else + { + if (ws->c_array[(r*ws->max_cols)+c]->ustr.str == 0) + { + ws->c_array[(r*ws->max_cols)+c]->ustr.len = 0; + ws->c_array[(r*ws->max_cols)+c]->ustr.uni = 0; + ws->c_array[(r*ws->max_cols)+c]->ustr.fmt_run = 0; + ws->c_array[(r*ws->max_cols)+c]->ustr.crun_cnt = 0; + } + } + ws->c_array[(r*ws->max_cols)+c]->xfmt = xf; + ws->c_array[(r*ws->max_cols)+c]->type = type; + ws->c_array[(r*ws->max_cols)+c]->spanned = 0; + ws->c_array[(r*ws->max_cols)+c]->rowspan = 0; + ws->c_array[(r*ws->max_cols)+c]->colspan = 0; + } +} + +static void update_cell_xf(U16 r, U16 c, U16 xf) +{ + work_sheet *ws; + + if ((sheet_count < 0)||(r > HARD_MAX_ROWS)||(c > HARD_MAX_COLS)) + return; + if (sheet_count >= (int)max_worksheets) + { + if (add_more_worksheet_ptrs()) + return; + } + if (ws_array[sheet_count] == 0) + { + if (ws_init(sheet_count)) + return; + } + if (r >= ws_array[sheet_count]->max_rows) + { + if (MaxRowExceeded) + return; + else + { + int diff = ((r-ws_array[sheet_count]->max_rows)/ROWS_INCR)+1; + if(resize_c_array(ws_array[sheet_count], ROWS_INCR*diff, 0)) + { + MaxRowExceeded = 1; + return; + } + } + } + if (c >= ws_array[sheet_count]->max_cols) + { + if (MaxColExceeded) + return; + else + { + int diff = ((c-ws_array[sheet_count]->max_cols)/COLS_INCR)+1; + if (resize_c_array(ws_array[sheet_count], 0, (U16)(COLS_INCR*diff))) + { + MaxColExceeded = 1; + return; + } + } + } + + ws = ws_array[sheet_count]; + if (ws->c_array[(r*ws->max_cols)+c] == 0) + { + ws->c_array[(r*ws->max_cols)+c] = (cell *)malloc(sizeof(cell)); + if (ws->c_array[(r*ws->max_cols)+c]) + { + uni_string_clear(&ws->c_array[(r*ws->max_cols)+c]->ustr); + ws->c_array[(r*ws->max_cols)+c]->xfmt = xf; + ws->c_array[(r*ws->max_cols)+c]->type = 1; /* This is the Blank Cell type */ + + if (r > ws_array[sheet_count]->biggest_row) + ws_array[sheet_count]->biggest_row = r; + if (c > ws_array[sheet_count]->biggest_col) + ws_array[sheet_count]->biggest_col = c; + ws->c_array[(r*ws->max_cols)+c]->spanned = 0; + ws->c_array[(r*ws->max_cols)+c]->rowspan = 0; + ws->c_array[(r*ws->max_cols)+c]->colspan = 0; + uni_string_clear(&ws->c_array[(r*ws->max_cols)+c]->h_link); + } + } +/* else + { + printf("R:%02X C:%02X XF:%02X is:%02X\n", + r, c, xf, ws->c_array[r][c]->xfmt); + } */ +} + +static void update_cell_hyperlink(U16 r, U16 c, U8 *hyperlink, int len, U16 uni) +{ + work_sheet *ws; + + if (sheet_count < 0) /* Used to do a "0 <" check on r & c */ + return; + if (sheet_count >= (int)max_worksheets) + { + if (add_more_worksheet_ptrs()) + return; + } + if (ws_array[sheet_count] == 0) + { + if (ws_init(sheet_count)) + return; + } + if (r >= ws_array[sheet_count]->max_rows) + { + if (MaxRowExceeded) + return; + else + { + int diff = ((r-ws_array[sheet_count]->max_rows)/ROWS_INCR)+1; + if(resize_c_array(ws_array[sheet_count], ROWS_INCR*diff, 0)) + { + MaxRowExceeded = 1; + return; + } + } + } + if (c >= ws_array[sheet_count]->max_cols) + { + if (MaxColExceeded) + return; + else + { + int diff = ((c-ws_array[sheet_count]->max_cols)/COLS_INCR)+1; + if(resize_c_array(ws_array[sheet_count], 0, (U16)(COLS_INCR*diff))) + { + MaxColExceeded = 1; + return; + } + } + } + + ws = ws_array[sheet_count]; + if (ws->c_array[(r*ws->max_cols)+c] == 0) + { /* should not get here, but just in case */ + return; + } + if (ws->c_array[(r*ws->max_cols)+c]->h_link.str == 0) + { + ws->c_array[(r*ws->max_cols)+c]->h_link.str = (U8 *)malloc(len); + if (ws->c_array[(r*ws->max_cols)+c]->h_link.str) + memcpy(ws->c_array[(r*ws->max_cols)+c]->h_link.str, hyperlink, len); + ws->c_array[(r*ws->max_cols)+c]->h_link.uni = uni; + if (len) + { + if (uni < 2) + ws->c_array[(r*ws->max_cols)+c]->h_link.len = (U16)(len-1); + else + ws->c_array[(r*ws->max_cols)+c]->h_link.len = (U16)(len-2); + } + } +/* else + { + printf("R:%02X C:%02X XF:%02X is:%s\n", + r, c, xf, ws->c_array[r][c]->h_link.str); + } */ +} + +static void add_str_array(U8 uni, U8 *str, U16 len, U8 *fmt_run, U8 crun_cnt) +{ + + if ((str == 0)||(len == 0)) + { + next_string++; /* increment for empty strings, too */ + return; + } + if (next_string >= max_strings) + { + uni_string **tstr_array; + size_t new_size = (max_strings + STRINGS_INCR) * sizeof(uni_string *); + + tstr_array = (uni_string **)realloc(str_array, new_size); + + if (tstr_array == NULL) + { + MaxStringsExceeded = 1; +/* fprintf(stderr, "%s: cannot allocate %d bytes for string storage %d: %s", + PRGNAME, new_size, errno, strerror(errno)); */ + return; + } + else + { + unsigned long i; + + str_array = tstr_array; + + /* Clear the new string slots */ + for (i=max_strings; i<(max_strings + STRINGS_INCR); i++) + str_array[i] = 0; + + max_strings += STRINGS_INCR; + } + } + + if (str_array[next_string] == 0) + { + str_array[next_string] = (uni_string *)malloc(sizeof(uni_string)); + if (str_array[next_string]) + { + str_array[next_string]->str = (U8 *)malloc(len+1); + if (str_array[next_string]->str) + { + memcpy(str_array[next_string]->str, str, len); + str_array[next_string]->str[len] = 0; + str_array[next_string]->len = len; + str_array[next_string]->uni = uni; + if (fmt_run && crun_cnt) + { + int rlen = crun_cnt*4; + + str_array[next_string]->fmt_run = malloc(rlen); + if (str_array[next_string]->fmt_run) + { + memcpy(str_array[next_string]->fmt_run, fmt_run, rlen); + str_array[next_string]->crun_cnt = crun_cnt; + } + else + str_array[next_string]->crun_cnt = 0; + } + else + { + str_array[next_string]->fmt_run = 0; + str_array[next_string]->crun_cnt = 0; + } + } + } + } + next_string++; +} + +static void add_font(U16 size, U16 attr, U16 c_idx, U16 bold, U16 super, U8 underline, + U16 uni, U8 *n, U16 len) +{ + if (n == 0) + return; + if (next_font >= max_fonts) + { + font_attr **tfont_array; + fnt_cnt *tf_cnt; + tfont_array = (font_attr **)realloc(font_array, (max_fonts * FONTS_INCR) * sizeof(font_attr *)); + tf_cnt = (fnt_cnt *)realloc(f_cnt, (max_fonts * FONTS_INCR) * sizeof(fnt_cnt)); + + if ((tf_cnt == NULL) || (tfont_array == NULL)) + { + MaxFontsExceeded = 1; + return; + } + else + { /* Next init the array... */ + unsigned int i; + + font_array = tfont_array; + f_cnt = tf_cnt; + + for (i=max_fonts; iname.str = (U8 *)malloc(len+1); + if (font_array[next_font]->name.str) + { + font_array[next_font]->attr = attr; + font_array[next_font]->c_idx = c_idx; + font_array[next_font]->bold = bold; + font_array[next_font]->super = super; + font_array[next_font]->underline = underline; + font_array[next_font]->name.uni = uni; + memcpy(font_array[next_font]->name.str, n, len); + font_array[next_font]->name.str[len] = 0; + font_array[next_font]->name.len = len; + font_array[next_font]->name.fmt_run = 0; + font_array[next_font]->name.crun_cnt = 0; + + /* We will "pre-digest" the font size.. */ + if (size >= 0x02D0) /* 36 pts */ + font_array[next_font]->size = 7; + else if (size >= 0x01E0) /* 24 pts */ + font_array[next_font]->size = 6; + else if (size >= 0x0168) /* 18 pts */ + font_array[next_font]->size = 5; + else if (size >= 0x00F0) /* 12 pts */ + font_array[next_font]->size = 4; + else if (size >= 0x00C8) /* 10 pts */ + font_array[next_font]->size = 3; + else if (size >= 0x00A0) /* 8 pts */ + font_array[next_font]->size = 2; + else + font_array[next_font]->size = 1; + } + } + } + next_font++; + if (next_font == 4) /* Per the doc's - number 4 doesn't exist. */ + next_font++; +} + +static void add_ws_title(U16 uni, U8 *n, U16 len) +{ + if (n == 0) + return; + + if (next_ws_title >= max_worksheets) + { + if (add_more_worksheet_ptrs()) + return; + } + + if (ws_array[next_ws_title] == 0) + { + if (ws_init(next_ws_title)) + return; + } + if (ws_array[next_ws_title]->ws_title.str == 0) + { + ws_array[next_ws_title]->ws_title.str = (U8 *)malloc(len+1); + if (ws_array[next_ws_title]->ws_title.str) + { + ws_array[next_ws_title]->ws_title.uni = uni; + memcpy(ws_array[next_ws_title]->ws_title.str, n, len); + ws_array[next_ws_title]->ws_title.str[len] = 0; + ws_array[next_ws_title]->ws_title.len = len; + ws_array[next_ws_title]->ws_title.crun_cnt = 0; + ws_array[next_ws_title]->ws_title.fmt_run = 0; + } + } + next_ws_title++; +} + +static void add_xf_array(U16 fnt_idx, U16 fmt_idx, U16 gen, U16 align, + U16 indent, U16 b_style, U16 b_l_color, U32 b_t_color, U16 cell_color) +{ + if (next_xf >= max_xformats) + { + xf_attr **txf_array; + + txf_array = (xf_attr **)realloc(xf_array, (max_xformats + XFORMATS_INCR) * sizeof(xf_attr *)); + if (txf_array == NULL) + { + MaxXFExceeded = 1; + return; + } + else + { + unsigned int i; + + xf_array = txf_array; + + for (i=max_xformats; i<(max_xformats + XFORMATS_INCR); i++) + xf_array[i] = 0; + + max_xformats += XFORMATS_INCR; + } + } + + if (xf_array[next_xf] == 0) + { + xf_array[next_xf] = (xf_attr *)malloc(sizeof(xf_attr)); + if (xf_array[next_xf]) + { + xf_array[next_xf]->fnt_idx = fnt_idx; + xf_array[next_xf]->fmt_idx = fmt_idx; + xf_array[next_xf]->gen = gen; + xf_array[next_xf]->align = align; + xf_array[next_xf]->indent = indent; + xf_array[next_xf]->b_style = b_style; + xf_array[next_xf]->b_l_color = b_l_color; + xf_array[next_xf]->b_t_color = b_t_color; + xf_array[next_xf]->cell_color = cell_color; + } + next_xf++; + } +} + +static void decodeBoolErr(U16 value, U16 flag, char *str) +{ + if (str == 0) + return; + + if (flag == 0) + { + if (value == 1) + strcpy(str, "TRUE"); + else + strcpy(str, "FALSE"); + } + else + { + switch(value) + { + case 0x00: + strcpy(str, "#NULL!"); + break; + case 0x07: + strcpy(str, "#DIV/0!"); + break; + case 0x0F: + strcpy(str, "#VALUE!"); + break; + case 0x17: + strcpy(str, "#REF!"); + break; + case 0x1D: + strcpy(str, "#NAME?"); + break; + case 0x24: + strcpy(str, "#NUM!"); + break; + case 0x2A: + strcpy(str, "#N/A"); + break; + default: + strcpy(str, "#ERR"); + break; + } + } +} + +static int IsCellNumeric(cell *c) +{ + int ret_val = 0; + + switch (c->type & 0x00FF) + { + case 0x02: /* Int */ + case 0x03: /* Float */ + /* case 0x06: */ /* Formula */ + /* case 0x08: */ + case 0x7E: /* RK */ + /* case 0xBC: */ + /* case 0x21: */ + case 0xBD: /* MulRK */ + ret_val = 1; + break; + default: + break; + } + return ret_val; +} + +/*! \retval 0 not safe at all. + \retval 1 extended format is OK + \retval 2 Fonts OK */ +static int IsCellSafe(cell *c) +{ + int safe = 0; + + if (c->xfmt < next_xf) + { + if (xf_array[c->xfmt]) + { + safe = 1; + if (xf_array[c->xfmt]->fnt_idx < next_font) + { + if (font_array[xf_array[c->xfmt]->fnt_idx]) + safe = 2; + } + } + } + return safe; +} + +static int IsCellFormula(cell *c) +{ + if ((c->type > 0x0100)||(c->type == 0x0006)) + return 1; + else + return 0; +} + +static void output_cell(cell *c, int xml) +{ + html_attr h; + + if (c == NULL) + printf( xml ? "" : " "); + else if (c->spanned != 0) + return; + else + { /* Determine whether or not its of numeric origin.. */ + int numeric = IsCellNumeric(c); /* 0=Text 1=Numeric */ + html_flag_init(&h); + if (c->xfmt == 0) + { /* Unknown format... */ + printf( xml ? "" : ""); /* This section doesn't use Unicode */ + if (c->ustr.str) + OutputString(&(c->ustr)); + else + printf( xml ? "" : " "); + } + else + { /* This is the BIFF7 & 8 stuff... */ + int safe; + int nullString = 1; + + safe = IsCellSafe(c); + + if (c->ustr.str) + { + if (c->ustr.uni < 2) /* UNI? */ + nullString = null_string(c->ustr.str); + else + nullString = 0; + } + + /* First take care of text color & alignment */ + printf( xml ? "" : "rowspan != 0)||(c->colspan != 0)) + { + if (c->colspan) + printf( xml ? "%d" : " COLSPAN=\"%d\"", c->colspan); + if (c->rowspan) + printf( xml ? "%d" : " ROWSPAN=\"%d\"", c->rowspan); + } + if ((safe > 0)&&(!nullString)) + { + switch(xf_array[c->xfmt]->align & 0x0007) + { /* Override default table alignment when needed */ + case 2: + case 6: /* Center across selection */ + if (strcmp(default_alignment, "center") != 0) + printf( xml ? "" : " ALIGN=\"center\""); + break; + case 0: /* General alignment */ + if (numeric) /* Numbers */ + { + if (strcmp(default_alignment, "right") != 0) + printf( xml ? "" : " ALIGN=\"right\""); + } + else if ((c->type & 0x00FF) == 0x05) + { /* Boolean */ + if (strcmp(default_alignment, "center") != 0) + printf( xml ? "" : " ALIGN=\"center\""); + } + else + { + if (strcmp(default_alignment, "left") != 0) + printf( xml ? "" : " ALIGN=\"left\""); + } + break; + case 3: + if (strcmp(default_alignment, "right") != 0) + printf( xml ? "" : " ALIGN=\"right\""); + break; + case 1: + default: + if (strcmp(default_alignment, "left") != 0) + printf( xml ? "" : " ALIGN=\"left\""); + break; + } + switch((xf_array[c->xfmt]->align & 0x0070)>>4) + { + case 0: + printf( xml ? "" : " VALIGN=\"top\""); + break; + case 1: + printf( xml ? "" : " VALIGN=\"center\""); + break; + case 2: /* General alignment */ + if (safe > 1) + { + if ((font_array[xf_array[c->xfmt]->fnt_idx]->super & 0x0003) == 0x0001) + printf( xml ? "" : " VALIGN=\"top\""); /* Superscript */ + } + break; + default: + if (safe > 1) + { + if ((font_array[xf_array[c->xfmt]->fnt_idx]->super & 0x0003) == 0x0001) + printf( xml ? "" : " VALIGN=\"top\""); /* Superscript */ + } + break; + } + } + /* Next do the bgcolor... BGCOLOR="" */ + if (safe && use_colors) + { + int fgcolor; + /* int bgcolor = (xf_array[c->xfmt]->cell_color & 0x3F80) >> 7; */ + fgcolor = (xf_array[c->xfmt]->cell_color & 0x007F); + /* printf(" XF:%X BG Color:%d, FG Color:%d", c->xfmt, bgcolor, fgcolor); */ + + /* Might be better by blending bg & fg colors? + If valid, fgcolor != black and fgcolor != white */ + if( ! xml ) + { + if (numCustomColors) + { + if (fgcolor < numCustomColors) + { + if (strcmp(default_background_color, (char *)customColors[fgcolor-8]) != 0) + printf(" BGCOLOR=\"%s\"", customColors[fgcolor-8]); + } + } + else + { + if (fgcolor < MAX_COLORS) + { + if (strcmp(default_background_color, colorTab[fgcolor]) != 0) + printf(" BGCOLOR=\"%s\"", colorTab[fgcolor]); + } + } + } + } + + /* Next set the border color... */ + if (safe && use_colors) + { + int lcolor, rcolor, tcolor, bcolor; + lcolor = xf_array[c->xfmt]->b_l_color & 0x007F; + rcolor = (xf_array[c->xfmt]->b_l_color & 0x3F80) >> 7; + tcolor = xf_array[c->xfmt]->b_t_color & 0x007F; + bcolor = (xf_array[c->xfmt]->b_t_color & 0x3F80) >> 7; + if (((lcolor & rcolor & tcolor & bcolor) == lcolor)&&(lcolor < MAX_COLORS)) + { /* if they are all the same...do it...that is if its different from BLACK */ + if (numCustomColors == 0) /* Don't do custom borders */ + { + if ((strcmp(colorTab[lcolor], "000000") != 0)&&(strcmp(colorTab[lcolor], "FFFFFF") != 0)) + { + if( !xml ) + printf(" BORDERCOLOR=\"%s\"", colorTab[lcolor]); + } + } + } + } + + /* Close up the ... */ + printf(xml ? "" : ">"); + + /* Next set font properties */ + if (safe > 1 && !xml ) + { + if (!nullString) + output_start_font_attribute(&h, xf_array[c->xfmt]->fnt_idx); + } + + /* Finally, take care of font modifications */ + if ((safe > 1)&&(!nullString)) + { + if ((font_array[xf_array[c->xfmt]->fnt_idx]->underline&0x0023) > 0) + { + if (c->h_link.str) + { + printf("h_link.uni) + { + if (memchr((char *)c->h_link.str, ':', c->h_link.len) == 0) + { + if (memchr((char *)c->h_link.str, '@', c->h_link.len)) + printf("mailto:"); + } + } + OutputString(&(c->h_link)); + printf("\">"); + h.uflag = 2; + } + else + { + printf(""); + h.uflag = 1; + } + } + output_start_html_attr(&h, xf_array[c->xfmt]->fnt_idx, 0); + } + if (c->ustr.str) + { + if (safe) + output_formatted_data(&(c->ustr), xf_array[c->xfmt]->fmt_idx, numeric, IsCellFormula(c)); + else + OutputString(&(c->ustr)); + } + else + printf( xml ? "" : " "); +/* printf(" T:%02X", c->type & 0x00FF); */ + } + + /* Now close the tags... */ + output_end_html_attr(&h); + if (h.fflag) + printf(""); + } + + if (!aggressive) + printf( xml ? "" : "\n"); +} + +static void output_formatted_data(uni_string *u, U16 idx, int numeric, int formula) +{ + if ((idx < max_xformats)&&(u->str)) + { + if ((formula_warnings)&&(formula)) + { + if( OutputXML ) + printf( "" ); + else + printf("** "); + notAccurate++; + } + if (numeric) + { + int year, month, date; + long num; + F64 dnum; + int hr, minu, sec, msec; + +/* printf("idx:%d ", idx); */ + switch (idx) + { + case 0x00: /* General */ + dnum = atof((char *)u->str); + printf("%.15g", dnum); + break; + case 0x01: /* Number 0 */ + dnum = atof((char *)u->str); + printf("%.0f", dnum); + break; + case 0x02: /* Number 0.00 */ + dnum = atof((char *)u->str); + printf("%.2f", dnum); + break; + case 0x03: /* Number w/comma 0,000 */ + PrintFloatComma("%.0f", 0, (F64)atof((char *)u->str)); + break; + case 0x04: /* Number w/comma 0,000.00 */ + PrintFloatComma("%.2f", 0, (F64)atof((char *)u->str)); + break; + case 0x05: /* Currency, no decimal */ + PrintFloatComma("%.0f", 1, (F64)atof((char *)u->str)); + break; + case 0x06: /* Currency, no decimal Red on Neg */ + PrintFloatComma("%.0f", 1, (F64)atof((char *)u->str)); + break; + case 0x07: /* Currency with decimal */ + PrintFloatComma("%.2f", 1, (F64)atof((char *)u->str)); + break; + case 0x08: /* Currency with decimal Red on Neg */ + PrintFloatComma("%.2f", 1, (F64)atof((char *)u->str)); + break; + case 0x09: /* Percent 0% */ + if (Csv) + printf("\""); + dnum = 100.0*atof((char *)u->str); + printf("%.0f%%", dnum); + if (Csv) + printf("\""); + break; + case 0x0A: /* Percent 0.00% */ + if (Csv) + printf("\""); + dnum = 100.0*atof((char *)u->str); + printf("%.2f%%", dnum); + if (Csv) + printf("\""); + break; + case 0x0B: /* Scientific 0.00+E00 */ + if (Csv) + printf("\""); + dnum = atof((char *)u->str); + printf("%.2E", dnum); + if (Csv) + printf("\""); + break; + case 0x0C: /* Fraction 1 number e.g. 1/2, 1/3 */ + if (Csv) + printf("\""); + dnum = atof((char *)u->str); + print_as_fraction(dnum, 1); + if (Csv) + printf("\""); + break; + case 0x0D: /* Fraction 2 numbers e.g. 1/50, 25/33 */ + if (Csv) + printf("\""); + dnum = atof((char *)u->str); + print_as_fraction(dnum, 2); + if (Csv) + printf("\""); + break; + case 0x0E: /* Date: m-d-y */ + if (Csv) + printf("\""); + num = atol((char *)u->str); + NumToDate(num, &year, &month, &date); + printf("%d-%d-%02d", month, date, year); + if (Csv) + printf("\""); + break; + case 0x0F: /* Date: d-mmm-yy */ + if (Csv) + printf("\""); + num = atol((char *)u->str); + NumToDate(num, &year, &month, &date); + printf("%d-%s-%02d", date, month_abbr[month-1], year); + if (Csv) + printf("\""); + break; + case 0x10: /* Date: d-mmm */ + if (Csv) + printf("\""); + num = atol((char *)u->str); + NumToDate(num, &year, &month, &date); + printf("%d-%s", date, month_abbr[month-1]); + if (Csv) + printf("\""); + break; + case 0x11: /* Date: mmm-yy */ + if (Csv) + printf("\""); + num = atol((char *)u->str); + NumToDate(num, &year, &month, &date); + printf("%s-%02d", month_abbr[month-1], year); + if (Csv) + printf("\""); + break; + case 0x12: /* Time: h:mm AM/PM */ + if (Csv) + printf("\""); + FracToTime(u->str, &hr, &minu, 0, 0); + if (hr == 0) + printf("12:%02d AM", minu); + else if (hr < 12) + printf("%d:%02d AM", hr, minu); + else if (hr == 12) + printf("12:%02d PM", minu); + else + printf("%d:%02d PM", hr-12, minu); + if (Csv) + printf("\""); + break; + case 0x13: /* Time: h:mm:ss AM/PM */ + if (Csv) + printf("\""); + FracToTime(u->str, &hr, &minu, &sec, 0); + if (hr == 0) + printf("12:%02d:%02d AM", minu, sec); + else if (hr < 12) + printf("%d:%02d:%02d AM", hr, minu, sec); + else if (hr == 12) + printf("12:%02d:%02d PM", minu, sec); + else + printf("%d:%02d:%02d PM", hr-12, minu, sec); + if (Csv) + printf("\""); + break; + case 0x14: /* Time: h:mm */ + if (Csv) + printf("\""); + FracToTime(u->str, &hr, &minu, 0, 0); + printf("%d:%02d", hr, minu); + if (Csv) + printf("\""); + break; + case 0x15: /* Time: h:mm:ss */ + if (Csv) + printf("\""); + FracToTime(u->str, &hr, &minu, &sec, 0); + if ((hr != 0)||(minu != 0)||(sec != 0)) + printf("%d:%02d:%02d", hr, minu, sec); + else + { + if (Ascii) + putchar(' '); + else + printf(OutputXML ? "" : " "); + } + if (Csv) + printf("\""); + break; + case 0x25: /* Number with comma, no decimal */ + if (Csv) + printf("\""); + PrintFloatComma("%.0f", 0, (F64)atof((char *)u->str)); + if (Csv) + printf("\""); + break; + case 0x26: /* Number with comma, no decimal, red on negative */ + if (Csv) + printf("\""); + PrintFloatComma("%.0f", 0, (F64)atof((char *)u->str)); + if (Csv) + printf("\""); + break; + case 0x27: /* Number with comma & decimal */ + if (Csv) + printf("\""); + PrintFloatComma("%.2f", 0, (F64)atof((char *)u->str)); + if (Csv) + printf("\""); + break; + case 0x28: /* Number with comma & decimal, red on negative */ + if (Csv) + printf("\""); + PrintFloatComma("%.2f", 0, (F64)atof((char *)u->str)); + if (Csv) + printf("\""); + break; + case 0x29: /* Number with comma, no decimal */ + if (Csv) + printf("\""); + PrintFloatComma("%.2f", 0, (F64)atof((char *)u->str)); + if (Csv) + printf("\""); + break; + case 0x2a: /* Currency, no decimal */ + if (Csv) + printf("\""); + PrintFloatComma("%.0f", 1, (F64)atof((char *)u->str)); + if (Csv) + printf("\""); + break; + case 0x2B: /* Number w/comma & decimal 0,000.00 */ + if (Csv) + printf("\""); + PrintFloatComma("%.2f", 0, (F64)atof((char *)u->str)); + if (Csv) + printf("\""); + break; + case 0x2C: /* Accounting Currency $0,000.00 */ + { + F64 acc_val = atof((char *)u->str); + if (Csv) + printf("\""); + if (acc_val < 0.0) + PrintFloatComma(" (%.2f)", 1, fabs(acc_val)); + else + PrintFloatComma(" %.2f", 1, acc_val); + if (Csv) + printf("\""); + break; + } + case 0x2D: /* Time: mm:ss */ + if (Csv) + printf("\""); + FracToTime(u->str, &hr, &minu, &sec, 0); + printf("%02d:%02d", minu, sec); + if (Csv) + printf("\""); + break; + case 0x2E: /* Time: [h]:mm:ss */ + if (Csv) + printf("\""); + FracToTime(u->str, &hr, &minu, &sec, 0); + if (hr) + printf("%d:%02d:%02d", hr, minu, sec); + else + printf("%02d:%02d", minu, sec); + if (Csv) + printf("\""); + break; + case 0x2F: /* Time: mm:ss.0 */ + if (Csv) + printf("\""); + FracToTime(u->str, &hr, &minu, &sec, &msec); + printf("%02d:%02d.%01d", minu, sec, msec); + if (Csv) + printf("\""); + break; + case 0x31: /* Text - if we are here...its a number */ + dnum = atof((char *)u->str); + printf("%g", dnum); + break; + default: /* Unsupported...but, if we are here, its a number */ + { + char *ptr = strchr((char *)u->str, '.'); + if( OutputXML ) + printf( "" ); + dnum = atof((char *)u->str); + if (ptr) + { + if (Csv) + printf("\"%.15g\"", dnum ); + else if (OutputXML) + printf("%.15g", dnum ); + else + printf("%.15g *", dnum ); + } + else + { + if (Csv) + printf("\"%.0g\"", dnum ); + else if (OutputXML) + printf("%.0g", dnum ); + else + printf("%.0g *", dnum ); + } + +/* printf(" F:%02X", idx); */ + NoFormat++ ; + } + break; + } + } + else /* Text data */ + OutputString(u); + } + else /* Error handling just dump it. */ + OutputString(u); +} + +static void NumToDate(long num, int *year, int *month, int *day) +{ + int t, i, y = 0; + + num = num%36525L; /* Trim century */ + while (num > (((y%4) == 0) ? 366 : 365)) + num -= ((y++%4) == 0) ? 366 : 365; + + *year = y; + t = num; + if (DatesR1904) + *year += 4; /* Adjust for McIntosh... */ + if ((*year%4) == 0) + { /* Leap Year */ + for (i=0; i<12; i++) + { + if (t <= ldays[i]) + break; + t -= ldays[i]; + } + } + else + { + for (i=0; i<12; i++) + { + if (t <= ndays[i]) + break; + t -= ndays[i]; + } + } + /* Some fixups... */ + *month = 1+i; + if (t == 0) + t = 1; + *day = t; + *year = *year % 100; +} + +static void FracToTime(U8 *cnum, int *hr, int *minut, int *sec, int *msec) +{ + int Hr, Min, Sec, Msec; + F64 fnum, tHr, tMin, tSec, tMsec; + + if (msec) + fnum = atof((char *)&cnum[0])+(0.05 / 86400.0); /* Round off to 1/10th seconds */ + else if (sec) + fnum = atof((char *)&cnum[0])+(0.5 / 86400.0); /* Round off to seconds */ + else + fnum = atof((char *)&cnum[0])+(30 / 86400.0); /* Round off to minutes */ + tHr = 24.0 * fnum; + Hr = (int)tHr; + tMin = (tHr - (F64)Hr) * 60.0; + Min = (int)tMin; + tSec = (tMin - (F64)Min) * 60.0; + Sec = (int)tSec; + tMsec = (tSec - (F64)Sec) * 10.0; + Msec = (int)tMsec; + + Hr = Hr%24; /* Fix roll-overs */ + if (hr) + *hr = Hr; + if (minut) + *minut = Min; + if (sec) + *sec = Sec; + if (msec) + *msec = Msec; +} + +static void PrintFloatComma(char *fformat, int is_currency, F64 d) +{ + int len, int_len, dec_len; + char *ptr2, buf[64]; + + sprintf(buf, fformat, fabs(d)); + len = strlen(buf); + ptr2 = strchr(buf, '.'); + if (ptr2) + { + int_len = ptr2 - buf; + dec_len = len - int_len; + if (isdigit(buf[0]) == 0) + { + char *ptr = &buf[0]; + while (isdigit(*ptr) == 0) + { + int_len--; + ptr++; + if (*ptr == 0) + break; + } + } + } + else + { + int_len = len; + dec_len = 0; + } + + if (int_len > 3) + { /* we have to do it the hard way... */ + char rbuf[64], buf2[64]; + int neg, i, j, count=0; + + if (d < 0.0) + neg = 1; + else + neg = 0; + + /* reverse the string. Its easier to work this way. */ + for (i=0, j=len-1; i= 1.0) + { + int n = (int)w; + printf("%d ", n); + r = w - (F64)n; + } + else + r = w; + + /* Get closest fraction - brute force */ + for (j=lim; j>0.0; j--) + { + for (i=lim; i>=0.0; i--) + { + if ( fabs((i/j)-r) <= closest) + { + closest = fabs((i/j)-r); + ci = (int)i; + cj = (int)j; + } + } + } + + /* Done, print it... */ + if (ci != 0) + printf("%d/%d", ci, cj); +} + +static void trim_sheet_edges(unsigned int sheet) +{ + cell *ce; + int not_done = 1; + S32 r; + U16 c; + + if ((sheet >= max_worksheets)||(ws_array[sheet] == 0)|| + (trim_edges == 0)||(ws_array[sheet]->spanned)) + return; + if (ws_array[sheet]->c_array == 0) + return; + if ( (ws_array[sheet]->biggest_row == -1) || + (ws_array[sheet]->biggest_col == -1) ) + return; + + /* First find top edge */ + for (r=ws_array[sheet]->first_row; r<=ws_array[sheet]->biggest_row; r++) + { + for (c=ws_array[sheet]->first_col; c<=ws_array[sheet]->biggest_col; c++) + { /* This stuff happens for each cell... */ + ce = ws_array[sheet]->c_array[(r*ws_array[sheet]->max_cols)+c]; + if (ce) + { + if (ce->ustr.str) + { + if (!null_string(ce->ustr.str)) + { + not_done = 0; + break; + } + } + } + } + if (!not_done) + break; + } + if (not_done) + ws_array[sheet]->first_row = ws_array[sheet]->biggest_row; + else + ws_array[sheet]->first_row = r; + + /* Second Find bottom edge */ + not_done = 1; + for (r=ws_array[sheet]->biggest_row; r>(S32)ws_array[sheet]->first_row; r--) + { + for (c=ws_array[sheet]->first_col; c<=ws_array[sheet]->biggest_col; c++) + { /* This stuff happens for each cell... */ + ce = ws_array[sheet]->c_array[(r*ws_array[sheet]->max_cols)+c]; + if (ce) + { + if (ce->ustr.str) + { + if (!null_string(ce->ustr.str)) + { + not_done = 0; + break; + } + } + } + } + if (!not_done) + break; + } + ws_array[sheet]->biggest_row = r; + + /* Third find left edge */ + not_done = 1; + for (c=ws_array[sheet]->first_col; c<=ws_array[sheet]->biggest_col; c++) + { + for (r=ws_array[sheet]->first_row; r<=ws_array[sheet]->biggest_row; r++) + { /* This stuff happens for each cell... */ + ce = ws_array[sheet]->c_array[(r*ws_array[sheet]->max_cols)+c]; + if (ce) + { + if (ce->ustr.str) + { + if (!null_string(ce->ustr.str)) + { + not_done = 0; + break; + } + } + } + } + if (!not_done) + break; + } + if (not_done) + ws_array[sheet]->first_col = ws_array[sheet]->biggest_col; + else + ws_array[sheet]->first_col = c; + + /* Last, find right edge */ + not_done = 1; + for (c=ws_array[sheet]->biggest_col; c>ws_array[sheet]->first_col; c--) + { + for (r=ws_array[sheet]->first_row; r<=ws_array[sheet]->biggest_row; r++) + { /* This stuff happens for each cell... */ + ce = ws_array[sheet]->c_array[(r*ws_array[sheet]->max_cols)+c]; + if (ce) + { + if (ce->ustr.str) + { + if (!null_string(ce->ustr.str)) + { + not_done = 0; + break; + } + } + } + } + if (!not_done) + break; + } + ws_array[sheet]->biggest_col = c; +} + +/*************** +*! Figures out the best font & alignment for the current table. +* Also sets the default_font and default_alignment. +****************/ +static void update_default_font(unsigned int sheet) +{ + cell *ce; + int r, c, f; + + if ((sheet >= max_worksheets)||(ws_array[sheet] == 0)) + return; + if (ws_array[sheet]->c_array == 0) + return; + + /* Clear the book-keeping info... */ + for (r=0; rstr) + free(f_cnt[r].name->str); + free(f_cnt[r].name); + f_cnt[r].name = 0; + } + } + if (default_font.str) + free(default_font.str); + for (r=0; r<7; r++) + fnt_size_cnt[r] = 0; + + /* Now check each cell to see what its using. */ + for (r=ws_array[sheet]->first_row; r<=ws_array[sheet]->biggest_row; r++) + { + for (c=ws_array[sheet]->first_col; c<=ws_array[sheet]->biggest_col; c++) + { /* This stuff happens for each cell... */ + ce = ws_array[sheet]->c_array[(r*ws_array[sheet]->max_cols)+c]; + if (ce) + { + if ((ce->xfmt < next_xf)&&(ce->ustr.str)) + { + if (strcmp((char *)ce->ustr.str, " ")) + { + if (ce->xfmt < next_xf) + { + if (xf_array[ce->xfmt]) + { + unsigned int fn = xf_array[ce->xfmt]->fnt_idx; + if (fn < next_font) + { + if (font_array[fn]) + { + if (font_array[fn]->name.str) + { + /* Here's where we check & increment count... */ + incr_f_cnt(&(font_array[fn]->name)); + if ((font_array[fn]->size < 8)&&(font_array[fn]->size)) + fnt_size_cnt[font_array[fn]->size-1]++; + } + } + } + } + } + } + } + } + } + } + + f = get_default_font(); + if (f == -1) + { + default_font.str = (U8 *)malloc(6); + if (default_font.str) + { + strcpy((char *)default_font.str, "Arial"); + default_font.uni = 0; + default_font.len = 5; + } + } + else + { + default_font.str = (U8 *)malloc(f_cnt[f].name->len+1); + if (default_font.str) + { + memcpy(default_font.str, f_cnt[f].name->str, f_cnt[f].name->len); + default_font.str[f_cnt[f].name->len] = 0; + default_font.uni = f_cnt[f].name->uni; + default_font.len = f_cnt[f].name->len; + } + } + + /* Find the font size with the most counts... + Just re-using variables, c - max cnt, f = position of max cnt */ + c = 0; + f = 3; + for (r=0; r<7; r++) + { + if (fnt_size_cnt[r] > c) + { + c = fnt_size_cnt[r]; + f = r; + } + } + if (fnt_size_cnt[2] == c) /* favor size 3... */ + default_fontsize = 3; + else + default_fontsize = f+1; + + for (r=0; rstr != 0) + free(f_cnt[r].name->str); + free(f_cnt[r].name); + f_cnt[r].name= 0; + } + } +} + +static void incr_f_cnt(uni_string *name) +{ + int i; + + if ((name == 0)||(name->str == 0)||(name->str[0] == 0)) + return; + + for (i=0; istr = (U8 *)malloc(name->len+1); + if (f_cnt[i].name->str) + { + memcpy(f_cnt[i].name->str, name->str, name->len); + f_cnt[i].name->str[name->len] = 0; + f_cnt[i].name->uni = name->uni; + f_cnt[i].name->len = name->len; + f_cnt[i].cnt = 1; + break; + } + } + } + } +} + +static int get_default_font(void) +{ + int i, m = -1; + + for (i=0; istr) + { + if (f_cnt[i].cnt > m) + m = i; + } + } + } + return m; +} + +static void update_default_alignment(unsigned int sheet, int row) +{ + int i, left = 0, center = 0, right = 0; + cell *c; + + if ((sheet >= max_worksheets)||(ws_array[sheet] == 0)) + return; + if (ws_array[sheet]->c_array == 0) + return; + + for (i=ws_array[sheet]->first_col; i<=ws_array[sheet]->biggest_col; i++) + { /* This stuff happens for each cell... */ + c = ws_array[sheet]->c_array[(row*ws_array[sheet]->max_cols)+i]; + if (c) + { + int numeric = IsCellNumeric(c); + if (c->xfmt == 0) + { /* Unknown format... */ + left++; + } + else + { /* Biff 8 stuff... */ + if ((c->xfmt < next_xf)&&(c->ustr.str)) + { + if (strcmp((char *)c->ustr.str, " ")) + { + if (xf_array[c->xfmt]) + { + switch(xf_array[c->xfmt]->align & 0x0007) + { /* Override default table alignment when needed */ + case 2: + case 6: /* Center across selection */ + center++; + break; + case 0: /* General alignment */ + if (numeric) /* Numbers */ + right++; + else if ((c->type & 0x00FF) == 0x05) /* Boolean */ + center++; + else + left++; + break; + case 3: + right++; + break; + case 1: /* fall through... */ + default: + left++; + break; + } + } + } + } + } + } + } + if ((center == 0)&&(left == 0)&&(right == 0)) + default_alignment = ""; + else if ((center >= left)&&(center >= right)) /* Favor center since its the longest word */ + default_alignment = "center"; + else if ((right >= center)&&(right >= left)) + default_alignment = "right"; /* Favor right since its second longest */ + else + default_alignment = "left"; +} + +static int null_string(U8 *str) +{ /* FIXME: This function may not be unicode safe */ + U8 *ptr; + if ((str == NULL)||(*str == 0)) + return 1; + + ptr = str; + while (*ptr != 0) + { + if (*ptr++ != ' ') + return 0; + } + return 1; +} + +static void OutputString(uni_string *u) +{ + unsigned int i; + + if (u == 0) + return; + + if (u->uni < 2) + { + if (null_string(u->str)) + { + if (Ascii == 0) + printf(OutputXML ? "" : " "); + else if (!Csv) + printf(" "); + } + else + { + if (Ascii) /* If Ascii output requested, simply output the string */ + { /* These are broken up for performance */ + if (Csv) + { + for (i=0; ilen; i++) + { + if (u->str[i] == 0x22) + printf("\"\""); + else + putchar(u->str[i]); + } + } + else + { + for (i=0; ilen; i++) + putchar(u->str[i]); + } + return; + } + if (u->crun_cnt) + { + U16 loc, fnt_idx, crun_cnt=0; + int format_changed = 0; + html_attr h_flags; + + /* read the first format run */ + update_crun_info(&loc, &fnt_idx, crun_cnt, u->fmt_run); + html_flag_init(&h_flags); + for (i=0; ilen; i++) + { + if (i == loc) + { /* Time to change formats */ + if (format_changed) + { /* if old attributs, close */ + output_end_html_attr(&h_flags); + if (h_flags.fflag) + printf(""); + } + else + { /* FIXME: Also need to consider that a font may already be set for + the cell, in which case a closing tag should be set. */ + format_changed = 1; + } + + /* set new attr */ + output_start_font_attribute(&h_flags, fnt_idx); + output_start_html_attr(&h_flags, fnt_idx, 1); + + /* get next fmt_run */ + if (crun_cnt < u->crun_cnt) + { + crun_cnt++; + update_crun_info(&loc, &fnt_idx, crun_cnt, u->fmt_run); + } + } + OutputCharCorrected(u->str[i]); + } + if (format_changed) + { + output_end_html_attr(&h_flags); + if (h_flags.fflag) + printf(""); + } + } + else + { + for (i=0; ilen; i++) + OutputCharCorrected(u->str[i]); + } + } + } + else + { + if (u->len == 0) + { + if (Ascii) + printf(" "); + else + printf(OutputXML ? "" : " "); + } + else + { + if (u->len == 2) + { + if (memcmp(u->str, "& ", 2) == 0) + printf("…"); + else + { + for (i=0; ilen; i+=2) + print_utf8(getShort(&(u->str[i]))); + } + } + else + { + for (i=0; ilen; i+=2) + print_utf8(getShort(&(u->str[i]))); + } + } + } +} + +static void OutputCharCorrected(U8 c) +{ + if (MultiByte && (c & 0x80)) + { + putchar(c); + return; + } + switch (c) + { /* Special char handlers here... */ + case 0x3C: + printf("<"); + break; + case 0x3E: + printf(">"); + break; + case 0x26: + printf("&"); + break; + case 0x22: + printf("""); + break; + /* Also need to cover 128-159 since MS uses this area... */ + case 0x80: /* Euro Symbol */ + printf("€"); + break; + case 0x82: /* baseline single quote */ + printf("‚"); + break; + case 0x83: /* florin */ + printf("ƒ"); + break; + case 0x84: /* baseline double quote */ + printf("„"); + break; + case 0x85: /* ellipsis */ + printf("…"); + break; + case 0x86: /* dagger */ + printf("†"); + break; + case 0x87: /* double dagger */ + printf("‡"); + break; + case 0x88: /* circumflex accent */ + printf("ˆ"); + break; + case 0x89: /* permile */ + printf("‰"); + break; + case 0x8A: /* S Hacek */ + printf("Š"); + break; + case 0x8B: /* left single guillemet */ + printf("‹"); + break; + case 0x8C: /* OE ligature */ + printf("Œ"); + break; + case 0x8E: /* #LATIN CAPITAL LETTER Z WITH CARON */ + printf("Ž"); + break; + case 0x91: /* left single quote ? */ + printf("‘"); + break; + case 0x92: /* right single quote ? */ + printf("’"); + break; + case 0x93: /* left double quote */ + printf("“"); + break; + case 0x94: /* right double quote */ + printf("”"); + break; + case 0x95: /* bullet */ + printf("•"); + break; + case 0x96: /* endash */ + printf("–"); + break; + case 0x97: /* emdash */ + printf("—"); + break; + case 0x98: /* tilde accent */ + printf("˜"); + break; + case 0x99: /* trademark ligature */ + printf("™"); + break; + case 0x9A: /* s Haceks Hacek */ + printf("š"); + break; + case 0x9B: /* right single guillemet */ + printf("›"); + break; + case 0x9C: /* oe ligature */ + printf("œ"); + break; + case 0x9F: /* Y Dieresis */ + printf("Ÿ"); + break; + default: + putchar(c); + break; + } +} + +static void update_crun_info(U16 *loc, U16 *fmt_idx, U16 crun_cnt, U8 *fmt_run) +{ + U16 tloc, tfmt_idx; + U16 offset = (U16)(crun_cnt*4); + + tloc = getShort(&fmt_run[offset]); + tfmt_idx = getShort(&fmt_run[offset+2]); + *loc = tloc; + *fmt_idx = tfmt_idx; +} + +static void put_utf8(U16 c) +{ + putchar((int)0x0080 | (c & 0x003F)); +} + +static void print_utf8(U16 c) +{ + if (c < 0x80) + OutputCharCorrected(c); + else if (c < 0x800) + { + putchar(0xC0 | (c >> 6)); + put_utf8(c); + } + else + { + putchar(0xE0 | (c >> 12)); + put_utf8((U16)(c >> 6)); + put_utf8(c); + } +} + +static void uni_string_clear(uni_string *str) +{ + if (str == 0) + return; + + str->str = 0; + str->uni = 0; + str->len = 0; + str->fmt_run = 0; + str->crun_cnt = 0; +} + +static int uni_string_comp(uni_string *s1, uni_string *s2) +{ + if ((s1 == 0)||(s2 == 0)) + return -1; + if ((s1->str == 0)||(s2->str == 0)) + return -1; + + if ((s1->uni == s2->uni) && (s1->len == s2->len)) + return memcmp(s1->str, s2->str, s1->len); + else + return -1; +} + +static void output_start_html_attr(html_attr *h, unsigned int fnt_idx, int do_underlines) +{ + if (fnt_idx < next_font) + { + if (((font_array[fnt_idx]->underline&0x0023) > 0)&&(do_underlines)) + { + printf(""); + h->uflag = 1; + } + if (font_array[fnt_idx]->bold >= 0x02BC) + { + h->bflag = 1; + printf(""); + } + if (font_array[fnt_idx]->attr & 0x0002) + { + h->iflag = 1; + printf(""); + } + if (font_array[fnt_idx]->attr & 0x0008) + { + h->sflag = 1; + printf(""); + } + if ((font_array[fnt_idx]->super & 0x0003) == 0x0001) + { + h->spflag = 1; + printf(""); + } + else if ((font_array[fnt_idx]->super & 0x0003) == 0x0002) + { + h->sbflag = 1; + printf(""); + } + } +} + +static void output_end_html_attr(html_attr *h) +{ + if (h->sbflag) + { + printf(""); + h->sbflag = 0; + } + else if (h->spflag) + { + printf(""); + h->spflag = 0; + } + if (h->sflag) + { + printf(""); + h->sflag = 0; + } + if (h->iflag) + { + printf(""); + h->iflag = 0; + } + if (h->bflag) + { + printf(""); + h->bflag = 0; + } + if (h->uflag) + { + if (h->uflag == 1) + printf(""); + else + printf(""); + h->uflag = 0; + } +} + +static void html_flag_init(html_attr *h) +{ + h->fflag = 0; + h->bflag = 0; + h->iflag = 0; + h->sflag = 0; + h->uflag = 0; + h->sbflag = 0; + h->spflag = 0; +} + +static void output_start_font_attribute(html_attr *h, U16 fnt_idx) +{ + if (uni_string_comp(&default_font, &(font_array[fnt_idx]->name)) != 0) + { + h->fflag = 1; + printf("name)); + printf("\""); + } + if (font_array[fnt_idx]->c_idx != 0x7FFF) + { + char color[8]; + if (numCustomColors) + { + if ((font_array[fnt_idx]->c_idx < numCustomColors)&&use_colors) + strcpy(color, (char *)customColors[font_array[fnt_idx]->c_idx-8]); + else + strcpy(color, "000000"); + } + else + { + if ((font_array[fnt_idx]->c_idx < MAX_COLORS)&&use_colors) + strcpy(color, colorTab[font_array[fnt_idx]->c_idx]); + else + strcpy(color, "000000"); + } + if (strcmp(color, "000000") != 0) + { + if (h->fflag) + printf(" COLOR=\"%s\"", color); + else + { + h->fflag = 1; + printf("super & 0x0003) + { + if (h->fflag) + printf(" SIZE=2"); /* Sub & Superscript */ + else + { + h->fflag = 1; + printf("fflag) + { + if (font_array[fnt_idx]->size != default_fontsize) + printf(" SIZE=%d", font_array[fnt_idx]->size); + } + else + { + if (font_array[fnt_idx]->size != default_fontsize) + { + h->fflag = 1; + printf("size); + } + } + } + if (h->fflag) + printf(">"); +} + +void OutputPartialTableAscii(void) +{ + int i, j, k; + + SetupExtraction(); + + /* Here's where we dump the Html Page out */ + for (i=first_sheet; i<=last_sheet; i++) /* For each worksheet */ + { + if (ws_array[i] == 0) + continue; + if ((ws_array[i]->biggest_row == -1)||(ws_array[i]->biggest_col == -1)) + continue; + if (ws_array[i]->c_array == 0) + continue; + + /* Now dump the table */ + for (j=ws_array[i]->first_row; j<=ws_array[i]->biggest_row; j++) + { + for (k=ws_array[i]->first_col; k<=ws_array[i]->biggest_col; k++) + { + int safe, numeric=0; + cell *c = ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]; /* This stuff happens for each cell... */ + + if (c) + { + numeric = IsCellNumeric(c); + if (!numeric && Csv) + printf("\""); + safe = IsCellSafe(c); + + if (c->ustr.str) + { + if (safe) + output_formatted_data(&(c->ustr), xf_array[c->xfmt]->fmt_idx, numeric, IsCellFormula(c)); + else + OutputString(&(c->ustr)); + } + else if (!Csv) + printf(" "); /* Empty cell... */ + } + else + { /* Empty cell... */ + if (!Csv) + printf(" "); + else + printf("\""); + } + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]) /* Honor Column spanning ? */ + { + if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->colspan != 0) + k += ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->colspan-1; + } + if (!numeric && Csv) + printf("\""); + + if (Csv && (k < ws_array[i]->biggest_col)) + { /* big cheat here: quoting everything! */ + putchar(','); /* Csv Cell Separator */ + } + else + { + if (( !Csv )&&( k != ws_array[i]->biggest_col )) + putchar('\t'); /* Ascii Cell Separator */ + } + } + if (Csv) + printf("\r\n"); + else + putchar(0x0A); /* Row Separator */ + } + if (!Csv) + printf("\n\n"); /* End of Table 2 LF-CR */ + } +} diff --git a/xlhtml/xlhtml.h b/xlhtml/xlhtml.h new file mode 100644 index 0000000..6f3086c --- /dev/null +++ b/xlhtml/xlhtml.h @@ -0,0 +1,45 @@ + +#if !(defined( __BORLANDC__ ) || defined( __WIN32__ )) +#include "config.h" /* Created by ./configure script */ +#include "support.h" /* Needs to be before internal.h */ +#include "internal.h" /* Needs to be before cole */ +#include "cole.h" +#else +#include "config.h.in" /* Created by ./configure script */ +#include "support.h" /* Needs to be before internal.h */ +#include "internal.h" /* Needs to be before cole */ +#include "cole.h.in" +#include /* for umask */ +#include +#endif +#include /* For atof(), calloc() */ +#include /* For string functions */ +#include /* For fabs() */ +#include /* For isprint() */ +#include + +/* Used by packed string array Opcode: 0xFC */ +#define HARD_MAX_ROWS_97 0x7FFE /*!< Used in add_wb_array to prevent OOM */ +#define HARD_MAX_ROWS_95 0x3FFF /*!< Used in add_wb_array to prevent OOM */ +#define HARD_MAX_COLS 256 /*!< Used in add_wb_array to prevent OOM */ + +U16 HARD_MAX_ROWS = HARD_MAX_ROWS_97; +/********************************** +* +* Don't change anything below here... +* +************************************/ +#if defined( __WIN32__ ) || defined( __BORLANDC__ ) +#define VERSION "0.4.9.1" +#endif +#define PRGNAME "xlhtml" +#define WBUFF_SIZE 8240 /*!< The working buffer. SB 522+10+4(header) bytes minimum = 536 */ +#define MAX_COLORS 65 /*!< This is the size of the built-in color table */ +#define EXCEL95 0x500 /*!< This is the file stamp for biff7 - Excel 5 & 95 */ +#define EXCEL97 0x600 /*!< This is the file stamp for biff8 - Excel 97 & 2000 */ +#if !(defined( __WIN32__ ) || defined( __BORLANDC__ )) +#include +#define GLOBAL_UMASK (S_IXUSR|S_IWGRP|S_IRGRP|S_IXGRP|S_IWOTH|S_IROTH|S_IXOTH) +#else +#define GLOBAL_UMASK (2) +#endif diff --git a/xlhtml/xls-handler b/xlhtml/xls-handler new file mode 100755 index 0000000..cdbad0b --- /dev/null +++ b/xlhtml/xls-handler @@ -0,0 +1,8 @@ +#!/bin/sh + +echo "Content-type: text/html" +echo +echo + +/usr/local/bin/xlhtml $PATH_TRANSLATED + diff --git a/xlhtml/xyz b/xlhtml/xyz new file mode 100644 index 0000000..f03ea69 --- /dev/null +++ b/xlhtml/xyz @@ -0,0 +1,1331 @@ + + + + +Test + + +
+

General


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    
ActualAnswer Formula
11 1
** 22 A1+1
** 33 A2+1
** 44 A3+1
** 55 A4+1
** 11 A5-A4
** 66 A5*A4
** 22 A6/A4
FormulaFormula General!D2
    
   Common Functions
** 1515 SUM
** 66 MAX
** 11 MIN
** 88 COUNT
** 33 AVERAGE
    
TRUE  Boolean
FALSE   
    
   Errors
** #DIV/0!#DIV/0!A1/0Divide by 0
** #NAME?#NAME?AVG(A3:A7)Unknown Function
** #VALUE!#VALUE!A5-A2Bad Value
** #NULL!#NULL!(SUM(A1:A10 C1:C10))Bad Intersection
** #REF!#REF!A3+A13Bad Reference
** #N/A#N/AVLOOKUP(0.1,range,2,TRUE)Not Applicable
** #NUM!#NUM!RATE(0, -200, 8000)Problem with a Number
    
   Special Html Characters
 < Less Than
 > Greater Than
 & Ampersand
 " Quote
  Elipse

+

Formats


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1-1-0012-14-952-28-00  12-30-0012-31-00  Unformatted Dates &
13504736584  3689036891  their Julian number
          
9-24-9925-Sep-994e+04 *Sep-99 4e+04 *4e+04 *30-Sep Dates
          
9:00 AM10:00:00 AM11:0012:00:00 01:001:02:0003:00.5 Time
          
11.21.231.234 -1-1.2-1.23-1.234General
          
1.001.201.231.23 -1.00-1.20-1.23-1.23Number
          
1000000.001000000.201000000.231000000.23 -1000000.00-1000000.20-1000000.23-1000000.23Number - Big Numbers
          
1,000,000.001,000,000.201,000,000.231,000,000.23 -1,000,000.00-1,000,000.20-1,000,000.23-1,000,000.23Number - Big Numbers with comma
          
1 *1.2 *1.23 *1.234 * -1 *-1.2 *-1.23 *-1.234 *Currency
          
1e+04 *1e+04 *1e+04 *1e+04 * -1e+04 *-1e+04 *-1e+04 *-1e+04 *Currency - Big Numbers
          
1.00%1.20%1.23%1.23% -1.00%-1.20%-1.23%-1.23%Percentage 2 decimals - small numbers
          
100.00%120.00%123.00%123.40% -100.00%-120.00%-123.00%-123.40%Percentage 2 decimals - bigger numbers
          
100%120%123%123% -100%-120%-123%-123%Percentage no decimals
          
1.00E+001.20E+001.23E+001.23E+00 -1.00E+00-1.20E+00-1.23E+00-1.23E+00Scientific
          
$ 1.00$ 1.20$ 1.23$ 1.23 $ (1.00)$ (1.20)$ (1.23)$ (1.23)Accounting
          
$ 10,000.00$ 10,000.20$ 10,000.23$ 10,000.23 $ (10,000.00)$ (10,000.20)$ (10,000.23)$ (10,000.23)Accounting - Big Numbers
          
1 1 1/51 2/91 2/9 -1 -1 1/5-1 2/9-1 2/9Fraction
          
1.23456789012345e-21 *  1234567890.12345 * Max Precision Numbers
          
$ 12.34$ 123.40$ 1,234.00$ 12,340.00$ 123,400.00$ 1,234,000.00$ 12,340,000.00$ (123.40)$ (1,234.00)Accounting

+

Text


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BoldItalicsUnderlined Modifier
LeftCenteredRight Justification
ArialTimes New RomanCourier New Fonts 12 Pts
Comic SansBrush ScriptVerdana Fonts 12 Pts
     
     
Font Sizing  
8 Pts    
10 Pts    
12 Pts    
14 Pts    
18 Pts    
24 Pts Superscript  
36 Pts Subscript  
48 Pts    
     
Regular Bold Itallics Underlined    

+

Colors


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Cell 1      
 Cell 2     
  Cell 3    
   Cell 4   
    Cell 5  
   Cell 6   
  Cell 7    
 Cell 8     
Cell 9      
 Cell 10     
  Cell 11    
   Cell 12   
    Cell 13  
Red Blue    Cell 14 
      Cell 15
     Cell 16 
    Cell 17  
   Cell 18   
  Cell 19    
 Cell 20     
Cell 21      
 Cell 22     
  Cell 23    
   Cell 24   
    Cell 25  
     Cell 26 
    Cell 27  
   Cell 28   
  Cell 29    
 Cell 30     
Cell 31      
 Cell 32     
  Cell 33    
   Cell 34   
    Cell 35  
   Cell 36   
  Cell 37    
 Cell 38     
Cell 39      
 Cell 40     
       
       
 Colors From Patterns Picker   
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       

+

Hyperlinks


+ + + + + + + + + + + + + + + + + +
Link to dump.c
www link
Ftp link
mailto link
file protocol

+

Bar Chart


+ + + + + + + + + + + + + + + + + +
1
2
3
4
5

+Spreadsheet's Author: Steve Grubb
+Last Updated 8/5/01  with Excel 97
+
* This cell's format is not supported.
+
** This cell's data may not be accurate.

+
Created with xlhtml 0.4.9.2
+