pax_global_header00006660000000000000000000000064141624161210014510gustar00rootroot0000000000000052 comment=19848c8efd679cd79b8e40d701415e44f481bace cimfomfa-21-361/000077500000000000000000000000001416241612100133645ustar00rootroot00000000000000cimfomfa-21-361/AUTHORS000066400000000000000000000002661416241612100144400ustar00rootroot00000000000000 cimfomfa AUTHORS file cimfomfa was written by Stijn van Dongen. cimfomfa's build environment was created by Joost van Baal. See THANKS for names of other people who contributed. cimfomfa-21-361/COPYING000066400000000000000000000431101416241612100144160ustar00rootroot00000000000000 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. cimfomfa-21-361/ChangeLog000066400000000000000000000007531416241612100151430ustar00rootroot00000000000000 Mon Dec 27 2021 * cimfomfa-21-361 released * This release has no source changes compared to 21-341. Fri Dec 10 2021 * cimfomfa-21-341 released * Fixed bug in let.c; it would think that 'abs(2) == abs(1)' is true. The cause was a combination of two things: failure to maintain float/integer correspondence by abs and other functions, and a wrong ternary cascade that would check float (in)equality even if the integer (in)equality test was already conclusive. cimfomfa-21-361/INSTALL000066400000000000000000000220301416241612100144120ustar00rootroot00000000000000Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. 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, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) 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 you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' 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. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. 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 support 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' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS 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 machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. 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. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--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. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. cimfomfa-21-361/LICENSE000066400000000000000000000013161416241612100143720ustar00rootroot00000000000000 These programs are free software; you can redistribute and/or modify them 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. These programs are distributed in the hope that they 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 cimfomfa-21-361/Makefile.am000066400000000000000000000005651416241612100154260ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in ## $Id: Makefile.am,v 1.1 2004/08/18 16:32:53 flux Exp $ ## stuff in shtest should get distributed but not installed SUBDIRS = . tingea src shed VERSION = @VERSION@ configure.ac: configure.ac.in VERSION shed/setversion EXTRA_DIST = \ LICENSE VERSION README COPYING THANKS INSTALL AUTHORS \ configure.ac cimfomfa-21-361/Makefile.in000066400000000000000000000601421416241612100154340ustar00rootroot00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README THANKS TODO compile \ depcomp install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . tingea src shed EXTRA_DIST = \ LICENSE VERSION README COPYING THANKS INSTALL AUTHORS \ configure.ac all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_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 case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --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) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile configure.ac: configure.ac.in VERSION shed/setversion # 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: cimfomfa-21-361/NEWS000066400000000000000000000000001416241612100140510ustar00rootroot00000000000000cimfomfa-21-361/README000066400000000000000000000021001416241612100142350ustar00rootroot00000000000000 This library supports both MCL, a cluster algorithm for graphs, and zoem, a macro/DSL language. It supplies abstractions for memory management, I/O, associative arrays, strings, heaps, and a few other things. The string functionality has had heavy testing as part of zoem, the hash functionality has had heavy testing both under mcl and zoem. The array and (grid) allocation parts are useful. The IO library is used quite a bit by mcl and does what it needs to do. Yet I consider it at a dead end currently. Some more notes: Both understandably and regrettably I chose long ago to make the string type C-string-compatible, hence nul bytes may not be part of a string (even though they are counted). At some point I hope to rectify this, perhaps unrealistically. There are no unit tests. There should be unit tests. Some testing programs are part of the library, found in src/trumpet. There is partial support for buffering and parsing/lookahead in the IO code, but with some caveats, patchy functionality and lacking a coherent design. IO is hard in all its different modalities. cimfomfa-21-361/THANKS000066400000000000000000000005371416241612100143040ustar00rootroot00000000000000 Thanks to: Joost van Baal author of the mcl, zoem, and cimfomfa build environments for autotooling and packaging mcl and zoem and setting up and maintaining the CVS trees back in the day, followed by help and guidance over all subsequent years, as well as introducing mcl and zoem into Debian, maintaning and keeping an eye on them. cimfomfa-21-361/TODO000066400000000000000000000006441416241612100140600ustar00rootroot00000000000000 - have window mode in hashfile: keep a constant number of entries in the hash, removing the older entries in order. (to stress-test hashes, in conjunction with const) - rewrite peach.c make it use a braindead grammar (basic "\n .." etc assumptions) comments ? mm difficult. / remove util, install it using libzwik. - clean up hashfile, clean up sorting, enable -r, -u. - make --stats option. cimfomfa-21-361/VERSION000066400000000000000000000000071416241612100144310ustar00rootroot0000000000000021-361 cimfomfa-21-361/aclocal.m4000066400000000000000000001270121416241612100152270ustar00rootroot00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file 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. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $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 if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR cimfomfa-21-361/compile000077500000000000000000000163271416241612100147530ustar00rootroot00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: cimfomfa-21-361/config.h.in000066400000000000000000000065151416241612100154160ustar00rootroot00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `floor' function. */ #undef HAVE_FLOOR /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `pow' function. */ #undef HAVE_POW /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef pid_t /* Define as `fork' if `vfork' does not work. */ #undef vfork cimfomfa-21-361/configure000077500000000000000000005626051416241612100153110ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for cimfomfa 21-361. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='cimfomfa' PACKAGE_TARNAME='cimfomfa' PACKAGE_VERSION='21-361' PACKAGE_STRING='cimfomfa 21-361' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/trumpet/cff_hashfile.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS EGREP GREP CPP RANLIB LN_S am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 <<_ACEOF \`configure' configures cimfomfa 21-361 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/cimfomfa] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of cimfomfa 21-361:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) 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. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF cimfomfa configure 21-361 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by cimfomfa $as_me 21-361, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/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` /usr/bin/hostinfo = `(/usr/bin/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` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # 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. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_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_cache_corrupted=false for ac_var in $ac_precious_vars; 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 ac_config_headers="$ac_config_headers config.h" am__api_version='1.16' 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /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 for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file 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" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='cimfomfa' VERSION='21-361' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION # AM_CONFIG_HEADER(config.h) # AC_CONFIG_HEADERS([config.h]) # add a `--enable-maintainer-mode' option to `configure'; `maintainer-only' rules turned off by # default in Makefile.in's { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Checks for programs. for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Checks for libraries. # FIXME: Replace `main' with a function in `-lm': { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 $as_echo_n "checking for main in -lm... " >&6; } if ${ac_cv_lib_m_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_main=yes else ac_cv_lib_m_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 $as_echo "$ac_cv_lib_m_main" >&6; } if test "x$ac_cv_lib_m_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi # Checks for header files. 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do 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. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #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)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h float.h limits.h stdlib.h string.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* 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"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 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 sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi # Checks for library functions. for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac # AC_FUNC_REALLOC for ac_func in dup2 floor memset pow regcomp sqrt strchr strrchr strstr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # AC_CONFIG_FILES([]) ac_config_files="$ac_config_files Makefile tingea/Makefile src/Makefile src/trumpet/Makefile shed/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 overridden 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # 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 ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by cimfomfa $as_me 21-361, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ cimfomfa config.status 21-361 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tingea/Makefile") CONFIG_FILES="$CONFIG_FILES tingea/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/trumpet/Makefile") CONFIG_FILES="$CONFIG_FILES src/trumpet/Makefile" ;; "shed/Makefile") CONFIG_FILES="$CONFIG_FILES shed/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # 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 # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # 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 by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi cimfomfa-21-361/configure.ac000066400000000000000000000031051416241612100156510ustar00rootroot00000000000000# configure.ac - generated from configure.ac.in by setversion. do not edit # configure.ac, but edit the master. # configure.ac - generated from configure.ac.in by setversion. do not edit # configure.ac, but edit the master. # configure.ac - generated from configure.ac.in by setversion. do not edit # configure.ac, but edit the master. # $Id: configure.ac,v 1.4 2005/07/20 11:30:09 flux Exp $ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) AC_INIT([cimfomfa], [21-361]) AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR([src/trumpet/cff_hashfile.c]) AM_INIT_AUTOMAKE PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION # AM_CONFIG_HEADER(config.h) # AC_CONFIG_HEADERS([config.h]) # add a `--enable-maintainer-mode' option to `configure'; `maintainer-only' rules turned off by # default in Makefile.in's AM_MAINTAINER_MODE AC_SUBST(PACKAGE) AC_SUBST(VERSION) # Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIB # Checks for libraries. # FIXME: Replace `main' with a function in `-lm': AC_CHECK_LIB([m], [main]) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h float.h limits.h stdlib.h string.h ]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T # Checks for library functions. AC_FUNC_VPRINTF AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MEMCMP # AC_FUNC_REALLOC AC_CHECK_FUNCS([dup2 floor memset pow regcomp sqrt strchr strrchr strstr]) # AC_CONFIG_FILES([]) AC_OUTPUT([ Makefile tingea/Makefile src/Makefile src/trumpet/Makefile shed/Makefile ]) cimfomfa-21-361/depcomp000077500000000000000000000355451416241612100147550ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2004-05-31.23 # Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # 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. # 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # Dependencies are output in .lo.d with libtool 1.4. # With libtool 1.5 they are output both in $dir.libs/$base.o.d # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the # latter, because the former will be cleaned when $dir.libs is # erased. tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir$base.o.d" tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" else tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: cimfomfa-21-361/install-sh000077500000000000000000000130271416241612100153730ustar00rootroot00000000000000#!/bin/sh # # $Id: install-sh,v 1.1 2004/08/18 16:32:53 flux Exp $ # # 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 cimfomfa-21-361/missing000077500000000000000000000246661416241612100150010ustar00rootroot00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2003-09-02.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # Originally by Fran,cois 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. # 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. 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 --run try to run the given command, and emulate it if it fails 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 help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. 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_ac}` 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*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 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 ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. 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 $msg. 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 ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. 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 ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. 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 prerequisites 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 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: cimfomfa-21-361/shed/000077500000000000000000000000001416241612100143075ustar00rootroot00000000000000cimfomfa-21-361/shed/Makefile.am000066400000000000000000000001521416241612100163410ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = . EXTRA_DIST = bootstrap setversion cimfomfa-21-361/shed/Makefile.in000066400000000000000000000423111416241612100163550ustar00rootroot00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = shed ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . EXTRA_DIST = bootstrap setversion all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu shed/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu shed/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic cscopelist-am ctags ctags-am \ distclean distclean-generic distclean-tags distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: cimfomfa-21-361/shed/bootstrap000077500000000000000000000013361416241612100162550ustar00rootroot00000000000000#!/bin/sh -e # # bootstrap - script to bootstrap the distribution rolling engine # # to build a tarball, ready for distribution, from fresh checked out # cvs sources, do # # automake --add-missing && ./bootstrap && ./configure && make distcheck # # this will yield a tarball. Once this has been # run, one can, after e.g. editing sources, run just # # make distcheck # # to generate a new tarball. (No need to run ./bootstrap again in this case.) # After downloading, users do # # tar xzf somedist.tar.gz # cd somedist # ./configure && make # make install # set -x if test ! -f VERSION then ./setversion fi aclocal \ && autoheader \ && automake --verbose --gnu --add-missing \ && autoconf cimfomfa-21-361/shed/setversion000077500000000000000000000007241416241612100164410ustar00rootroot00000000000000#!/bin/bash # $Id: setversion,v 1.1 2004/08/18 16:32:53 flux Exp $ # called in Makefile.am and in bootstrap set -euo pipefail if [[ -z "$*" ]]; then echo need version - suggest $(date '+%y-%j') false fi VERSION=$1 set -x echo $VERSION > VERSION cat > configure.ac <> configure.ac cimfomfa-21-361/src/000077500000000000000000000000001416241612100141535ustar00rootroot00000000000000cimfomfa-21-361/src/Makefile.am000066400000000000000000000002111416241612100162010ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in ## $Id: Makefile.am,v 1.1 2004/08/18 16:32:53 flux Exp $ SUBDIRS = . trumpet cimfomfa-21-361/src/Makefile.in000066400000000000000000000422541416241612100162270ustar00rootroot00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . trumpet all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic cscopelist-am ctags ctags-am \ distclean distclean-generic distclean-tags distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: cimfomfa-21-361/src/trumpet/000077500000000000000000000000001416241612100156535ustar00rootroot00000000000000cimfomfa-21-361/src/trumpet/Makefile.am000066400000000000000000000020601416241612100177050ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in ## $Id: Makefile.am,v 1.13 2007-02-27 11:49:42 flux Exp $ AM_CPPFLAGS = -I$(top_srcdir) -I.. ## make sure these do _not_ get build or installed by default bin_PROGRAMS = noinst_PROGRAMS= cff_match cff_pagesize cff_reap cff_read cff_tst cff_ttwhy cff_link cff_sow cff_optoid cff_tring cff_rand cff_bitpat cff_edit cff_unit_ceilfloor cff_hashfile cff_let cff_ttwhy_SOURCES = cff_ttwhy.c cff_unit_ceilfloorSOURCES = cff_unit_ceilfloor.c cff_tst_SOURCES = cff_tst.c cff_hashfile_SOURCES = cff_hashfile.c cff_reap_SOURCES = cff_reap.c cff_optoid_SOURCES = cff_optoid.c cff_bitpat_SOURCES = cff_bitpat.c cff_let_SOURCES = cff_let.c cff_read_SOURCES = cff_read.c cff_sow_SOURCES = cff_sow.c cff_tring_SOURCES = cff_tring.c cff_rand_SOURCES = cff_rand.c cff_link_SOURCES = cff_link.c cff_match_SOURCES = cff_match.c cff_edit_SOURCES = cff_edit.c cff_pagesize_SOURCES = cff_pagesize.c cff_let_LDFLAGS = -lm cff_hashfile_LDFLAGS = -lm LDADD = ../../tingea/libtingea.a cimfomfa-21-361/src/trumpet/Makefile.in000066400000000000000000000663631416241612100177360ustar00rootroot00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = noinst_PROGRAMS = cff_match$(EXEEXT) cff_pagesize$(EXEEXT) \ cff_reap$(EXEEXT) cff_read$(EXEEXT) cff_tst$(EXEEXT) \ cff_ttwhy$(EXEEXT) cff_link$(EXEEXT) cff_sow$(EXEEXT) \ cff_optoid$(EXEEXT) cff_tring$(EXEEXT) cff_rand$(EXEEXT) \ cff_bitpat$(EXEEXT) cff_edit$(EXEEXT) \ cff_unit_ceilfloor$(EXEEXT) cff_hashfile$(EXEEXT) \ cff_let$(EXEEXT) subdir = src/trumpet ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_cff_bitpat_OBJECTS = cff_bitpat.$(OBJEXT) cff_bitpat_OBJECTS = $(am_cff_bitpat_OBJECTS) cff_bitpat_LDADD = $(LDADD) cff_bitpat_DEPENDENCIES = ../../tingea/libtingea.a am_cff_edit_OBJECTS = cff_edit.$(OBJEXT) cff_edit_OBJECTS = $(am_cff_edit_OBJECTS) cff_edit_LDADD = $(LDADD) cff_edit_DEPENDENCIES = ../../tingea/libtingea.a am_cff_hashfile_OBJECTS = cff_hashfile.$(OBJEXT) cff_hashfile_OBJECTS = $(am_cff_hashfile_OBJECTS) cff_hashfile_LDADD = $(LDADD) cff_hashfile_DEPENDENCIES = ../../tingea/libtingea.a cff_hashfile_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(cff_hashfile_LDFLAGS) $(LDFLAGS) -o $@ am_cff_let_OBJECTS = cff_let.$(OBJEXT) cff_let_OBJECTS = $(am_cff_let_OBJECTS) cff_let_LDADD = $(LDADD) cff_let_DEPENDENCIES = ../../tingea/libtingea.a cff_let_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(cff_let_LDFLAGS) \ $(LDFLAGS) -o $@ am_cff_link_OBJECTS = cff_link.$(OBJEXT) cff_link_OBJECTS = $(am_cff_link_OBJECTS) cff_link_LDADD = $(LDADD) cff_link_DEPENDENCIES = ../../tingea/libtingea.a am_cff_match_OBJECTS = cff_match.$(OBJEXT) cff_match_OBJECTS = $(am_cff_match_OBJECTS) cff_match_LDADD = $(LDADD) cff_match_DEPENDENCIES = ../../tingea/libtingea.a am_cff_optoid_OBJECTS = cff_optoid.$(OBJEXT) cff_optoid_OBJECTS = $(am_cff_optoid_OBJECTS) cff_optoid_LDADD = $(LDADD) cff_optoid_DEPENDENCIES = ../../tingea/libtingea.a am_cff_pagesize_OBJECTS = cff_pagesize.$(OBJEXT) cff_pagesize_OBJECTS = $(am_cff_pagesize_OBJECTS) cff_pagesize_LDADD = $(LDADD) cff_pagesize_DEPENDENCIES = ../../tingea/libtingea.a am_cff_rand_OBJECTS = cff_rand.$(OBJEXT) cff_rand_OBJECTS = $(am_cff_rand_OBJECTS) cff_rand_LDADD = $(LDADD) cff_rand_DEPENDENCIES = ../../tingea/libtingea.a am_cff_read_OBJECTS = cff_read.$(OBJEXT) cff_read_OBJECTS = $(am_cff_read_OBJECTS) cff_read_LDADD = $(LDADD) cff_read_DEPENDENCIES = ../../tingea/libtingea.a am_cff_reap_OBJECTS = cff_reap.$(OBJEXT) cff_reap_OBJECTS = $(am_cff_reap_OBJECTS) cff_reap_LDADD = $(LDADD) cff_reap_DEPENDENCIES = ../../tingea/libtingea.a am_cff_sow_OBJECTS = cff_sow.$(OBJEXT) cff_sow_OBJECTS = $(am_cff_sow_OBJECTS) cff_sow_LDADD = $(LDADD) cff_sow_DEPENDENCIES = ../../tingea/libtingea.a am_cff_tring_OBJECTS = cff_tring.$(OBJEXT) cff_tring_OBJECTS = $(am_cff_tring_OBJECTS) cff_tring_LDADD = $(LDADD) cff_tring_DEPENDENCIES = ../../tingea/libtingea.a am_cff_tst_OBJECTS = cff_tst.$(OBJEXT) cff_tst_OBJECTS = $(am_cff_tst_OBJECTS) cff_tst_LDADD = $(LDADD) cff_tst_DEPENDENCIES = ../../tingea/libtingea.a am_cff_ttwhy_OBJECTS = cff_ttwhy.$(OBJEXT) cff_ttwhy_OBJECTS = $(am_cff_ttwhy_OBJECTS) cff_ttwhy_LDADD = $(LDADD) cff_ttwhy_DEPENDENCIES = ../../tingea/libtingea.a cff_unit_ceilfloor_SOURCES = cff_unit_ceilfloor.c cff_unit_ceilfloor_OBJECTS = cff_unit_ceilfloor.$(OBJEXT) cff_unit_ceilfloor_LDADD = $(LDADD) cff_unit_ceilfloor_DEPENDENCIES = ../../tingea/libtingea.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cff_bitpat.Po \ ./$(DEPDIR)/cff_edit.Po ./$(DEPDIR)/cff_hashfile.Po \ ./$(DEPDIR)/cff_let.Po ./$(DEPDIR)/cff_link.Po \ ./$(DEPDIR)/cff_match.Po ./$(DEPDIR)/cff_optoid.Po \ ./$(DEPDIR)/cff_pagesize.Po ./$(DEPDIR)/cff_rand.Po \ ./$(DEPDIR)/cff_read.Po ./$(DEPDIR)/cff_reap.Po \ ./$(DEPDIR)/cff_sow.Po ./$(DEPDIR)/cff_tring.Po \ ./$(DEPDIR)/cff_tst.Po ./$(DEPDIR)/cff_ttwhy.Po \ ./$(DEPDIR)/cff_unit_ceilfloor.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cff_bitpat_SOURCES) $(cff_edit_SOURCES) \ $(cff_hashfile_SOURCES) $(cff_let_SOURCES) $(cff_link_SOURCES) \ $(cff_match_SOURCES) $(cff_optoid_SOURCES) \ $(cff_pagesize_SOURCES) $(cff_rand_SOURCES) \ $(cff_read_SOURCES) $(cff_reap_SOURCES) $(cff_sow_SOURCES) \ $(cff_tring_SOURCES) $(cff_tst_SOURCES) $(cff_ttwhy_SOURCES) \ cff_unit_ceilfloor.c DIST_SOURCES = $(cff_bitpat_SOURCES) $(cff_edit_SOURCES) \ $(cff_hashfile_SOURCES) $(cff_let_SOURCES) $(cff_link_SOURCES) \ $(cff_match_SOURCES) $(cff_optoid_SOURCES) \ $(cff_pagesize_SOURCES) $(cff_rand_SOURCES) \ $(cff_read_SOURCES) $(cff_reap_SOURCES) $(cff_sow_SOURCES) \ $(cff_tring_SOURCES) $(cff_tst_SOURCES) $(cff_ttwhy_SOURCES) \ cff_unit_ceilfloor.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir) -I.. cff_ttwhy_SOURCES = cff_ttwhy.c cff_unit_ceilfloorSOURCES = cff_unit_ceilfloor.c cff_tst_SOURCES = cff_tst.c cff_hashfile_SOURCES = cff_hashfile.c cff_reap_SOURCES = cff_reap.c cff_optoid_SOURCES = cff_optoid.c cff_bitpat_SOURCES = cff_bitpat.c cff_let_SOURCES = cff_let.c cff_read_SOURCES = cff_read.c cff_sow_SOURCES = cff_sow.c cff_tring_SOURCES = cff_tring.c cff_rand_SOURCES = cff_rand.c cff_link_SOURCES = cff_link.c cff_match_SOURCES = cff_match.c cff_edit_SOURCES = cff_edit.c cff_pagesize_SOURCES = cff_pagesize.c cff_let_LDFLAGS = -lm cff_hashfile_LDFLAGS = -lm LDADD = ../../tingea/libtingea.a all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/trumpet/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/trumpet/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) cff_bitpat$(EXEEXT): $(cff_bitpat_OBJECTS) $(cff_bitpat_DEPENDENCIES) $(EXTRA_cff_bitpat_DEPENDENCIES) @rm -f cff_bitpat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_bitpat_OBJECTS) $(cff_bitpat_LDADD) $(LIBS) cff_edit$(EXEEXT): $(cff_edit_OBJECTS) $(cff_edit_DEPENDENCIES) $(EXTRA_cff_edit_DEPENDENCIES) @rm -f cff_edit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_edit_OBJECTS) $(cff_edit_LDADD) $(LIBS) cff_hashfile$(EXEEXT): $(cff_hashfile_OBJECTS) $(cff_hashfile_DEPENDENCIES) $(EXTRA_cff_hashfile_DEPENDENCIES) @rm -f cff_hashfile$(EXEEXT) $(AM_V_CCLD)$(cff_hashfile_LINK) $(cff_hashfile_OBJECTS) $(cff_hashfile_LDADD) $(LIBS) cff_let$(EXEEXT): $(cff_let_OBJECTS) $(cff_let_DEPENDENCIES) $(EXTRA_cff_let_DEPENDENCIES) @rm -f cff_let$(EXEEXT) $(AM_V_CCLD)$(cff_let_LINK) $(cff_let_OBJECTS) $(cff_let_LDADD) $(LIBS) cff_link$(EXEEXT): $(cff_link_OBJECTS) $(cff_link_DEPENDENCIES) $(EXTRA_cff_link_DEPENDENCIES) @rm -f cff_link$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_link_OBJECTS) $(cff_link_LDADD) $(LIBS) cff_match$(EXEEXT): $(cff_match_OBJECTS) $(cff_match_DEPENDENCIES) $(EXTRA_cff_match_DEPENDENCIES) @rm -f cff_match$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_match_OBJECTS) $(cff_match_LDADD) $(LIBS) cff_optoid$(EXEEXT): $(cff_optoid_OBJECTS) $(cff_optoid_DEPENDENCIES) $(EXTRA_cff_optoid_DEPENDENCIES) @rm -f cff_optoid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_optoid_OBJECTS) $(cff_optoid_LDADD) $(LIBS) cff_pagesize$(EXEEXT): $(cff_pagesize_OBJECTS) $(cff_pagesize_DEPENDENCIES) $(EXTRA_cff_pagesize_DEPENDENCIES) @rm -f cff_pagesize$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_pagesize_OBJECTS) $(cff_pagesize_LDADD) $(LIBS) cff_rand$(EXEEXT): $(cff_rand_OBJECTS) $(cff_rand_DEPENDENCIES) $(EXTRA_cff_rand_DEPENDENCIES) @rm -f cff_rand$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_rand_OBJECTS) $(cff_rand_LDADD) $(LIBS) cff_read$(EXEEXT): $(cff_read_OBJECTS) $(cff_read_DEPENDENCIES) $(EXTRA_cff_read_DEPENDENCIES) @rm -f cff_read$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_read_OBJECTS) $(cff_read_LDADD) $(LIBS) cff_reap$(EXEEXT): $(cff_reap_OBJECTS) $(cff_reap_DEPENDENCIES) $(EXTRA_cff_reap_DEPENDENCIES) @rm -f cff_reap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_reap_OBJECTS) $(cff_reap_LDADD) $(LIBS) cff_sow$(EXEEXT): $(cff_sow_OBJECTS) $(cff_sow_DEPENDENCIES) $(EXTRA_cff_sow_DEPENDENCIES) @rm -f cff_sow$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_sow_OBJECTS) $(cff_sow_LDADD) $(LIBS) cff_tring$(EXEEXT): $(cff_tring_OBJECTS) $(cff_tring_DEPENDENCIES) $(EXTRA_cff_tring_DEPENDENCIES) @rm -f cff_tring$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_tring_OBJECTS) $(cff_tring_LDADD) $(LIBS) cff_tst$(EXEEXT): $(cff_tst_OBJECTS) $(cff_tst_DEPENDENCIES) $(EXTRA_cff_tst_DEPENDENCIES) @rm -f cff_tst$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_tst_OBJECTS) $(cff_tst_LDADD) $(LIBS) cff_ttwhy$(EXEEXT): $(cff_ttwhy_OBJECTS) $(cff_ttwhy_DEPENDENCIES) $(EXTRA_cff_ttwhy_DEPENDENCIES) @rm -f cff_ttwhy$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_ttwhy_OBJECTS) $(cff_ttwhy_LDADD) $(LIBS) cff_unit_ceilfloor$(EXEEXT): $(cff_unit_ceilfloor_OBJECTS) $(cff_unit_ceilfloor_DEPENDENCIES) $(EXTRA_cff_unit_ceilfloor_DEPENDENCIES) @rm -f cff_unit_ceilfloor$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cff_unit_ceilfloor_OBJECTS) $(cff_unit_ceilfloor_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_bitpat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_edit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_hashfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_let.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_link.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_match.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_optoid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_pagesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_rand.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_read.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_reap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_sow.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_tring.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_tst.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_ttwhy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cff_unit_ceilfloor.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/cff_bitpat.Po -rm -f ./$(DEPDIR)/cff_edit.Po -rm -f ./$(DEPDIR)/cff_hashfile.Po -rm -f ./$(DEPDIR)/cff_let.Po -rm -f ./$(DEPDIR)/cff_link.Po -rm -f ./$(DEPDIR)/cff_match.Po -rm -f ./$(DEPDIR)/cff_optoid.Po -rm -f ./$(DEPDIR)/cff_pagesize.Po -rm -f ./$(DEPDIR)/cff_rand.Po -rm -f ./$(DEPDIR)/cff_read.Po -rm -f ./$(DEPDIR)/cff_reap.Po -rm -f ./$(DEPDIR)/cff_sow.Po -rm -f ./$(DEPDIR)/cff_tring.Po -rm -f ./$(DEPDIR)/cff_tst.Po -rm -f ./$(DEPDIR)/cff_ttwhy.Po -rm -f ./$(DEPDIR)/cff_unit_ceilfloor.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/cff_bitpat.Po -rm -f ./$(DEPDIR)/cff_edit.Po -rm -f ./$(DEPDIR)/cff_hashfile.Po -rm -f ./$(DEPDIR)/cff_let.Po -rm -f ./$(DEPDIR)/cff_link.Po -rm -f ./$(DEPDIR)/cff_match.Po -rm -f ./$(DEPDIR)/cff_optoid.Po -rm -f ./$(DEPDIR)/cff_pagesize.Po -rm -f ./$(DEPDIR)/cff_rand.Po -rm -f ./$(DEPDIR)/cff_read.Po -rm -f ./$(DEPDIR)/cff_reap.Po -rm -f ./$(DEPDIR)/cff_sow.Po -rm -f ./$(DEPDIR)/cff_tring.Po -rm -f ./$(DEPDIR)/cff_tst.Po -rm -f ./$(DEPDIR)/cff_ttwhy.Po -rm -f ./$(DEPDIR)/cff_unit_ceilfloor.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: cimfomfa-21-361/src/trumpet/README000066400000000000000000000007411416241612100165350ustar00rootroot00000000000000 hashfile hashes lines of files and has lots of options to compare different hash functions. See hashfile -h let evaluates arithmetic expressions involving arithmetic operators ** * + - / // % - (unary) bitwise operators | & ^ ~ (unary) boolean operators || && == != ! (unary) the ternary "a ? b : c" expression, and the standard C math functions. match tries to find literal pattern in a file stream. Use '-' for stdin. cimfomfa-21-361/src/trumpet/cff_bitpat.c000066400000000000000000000020311416241612100201140ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2007 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include #include #include #include #include "tingea/ting.h" #include "tingea/ding.h" int main ( int argc , char* argv[] ) { int i ; int a = 81679993 ; mcxTing* t = mcxTingEmpty(NULL, 32) ; mcxMemPrint(t, &a, sizeof(a), MCX_MEMPRINT_REVERSE) ; fprintf(stdout, "%s\n", t->str) ; for (i=0;i<15;i++) { signed short sh = i ; mcxMemPrint(t, &sh, sizeof sh, MCX_MEMPRINT_REVERSE) ; fprintf(stdout, "%s\n", t->str) ; } for (i=0;i<15;i++) { double f = i ; mcxMemPrint(t, &f, sizeof f, MCX_MEMPRINT_REVERSE) ; fprintf(stdout, "%s\n", t->str) ; } return 0 ; } cimfomfa-21-361/src/trumpet/cff_edit.c000066400000000000000000000046431416241612100175710ustar00rootroot00000000000000/* Copyright (C) 2007 Leopold Parts & Stijn van Dongen & Leopold Parts * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include #include #include #include "tingea/types.h" #include "tingea/alloc.h" #include "tingea/hash.h" #include "tingea/array.h" #include "tingea/ding.h" #include "tingea/ting.h" #include "tingea/types.h" #include "tingea/minmax.h" #include "tingea/err.h" #include "tingea/io.h" typedef struct { mcxTing** lines ; dim n_lines ; dim n_lines_max ; } mcxLines ; static mcxstatus mcxIOreadLines ( mcxLines* ln , mcxIO* xf , mcxOnFail ON_FAIL , mcxbits rlmode ) { mcxTing* line = mcxTingEmpty(NULL, 0) ; dim n_lines_alloc = 16 ; mcxstatus status = STATUS_OK ; ln->n_lines = 0 ; ln->lines = NULL ; ln->n_lines_max = 0 ; if (mcxIOtestOpen(xf, ON_FAIL)) return STATUS_FAIL ; if (!(ln->lines = mcxAlloc(n_lines_alloc * sizeof(mcxTing), ON_FAIL))) return STATUS_FAIL ; while(STATUS_OK == mcxIOreadLine(xf, line, rlmode)) { status = STATUS_FAIL ; if ( n_lines_alloc <= ln->n_lines && mcxResize ( &ln->lines , sizeof(mcxTing) , &n_lines_alloc , ln->n_lines * 2 , ON_FAIL ) ) break ; ln->lines[ln->n_lines++] = line ; line = mcxTingEmpty(NULL, 0) ; status = STATUS_OK ; } mcxTingFree(&line) ; ln->n_lines_max = n_lines_alloc ; return status ; } int main ( int argc , char* argv[] ) { mcxIO* xf = mcxIOnew(argc > 1 ? argv[1] : "-", "r") ; dim lo = argc > 2 ? atoi(argv[2]) : 0 ; dim hi = argc > 3 ? atoi(argv[3]) : 0 ; dim i ; mcxLines ln ; mcxIOreadLines(&ln, xf, EXIT_ON_FAIL, MCX_READLINE_CHOMP) ; if (!hi) hi = ln.n_lines ; for (i=lo;istr, ln.lines[j]->str, &lcs) ; fprintf(stdout, "%s\t%s\t%d\t%d\n", ln.lines[i]->str, ln.lines[j]->str, (int) ed, (int) lcs) ; } } return 0 ; } cimfomfa-21-361/src/trumpet/cff_hashfile.c000066400000000000000000000227701416241612100204300ustar00rootroot00000000000000/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include #include #include #include "tingea/types.h" #include "tingea/hash.h" #include "tingea/ting.h" #include "tingea/types.h" #include "tingea/io.h" #include "tingea/opt.h" #include "tingea/alloc.h" #define FPTELL stderr const char* usagelines[] = { "Usage: hashfile [options]* [search-strings]*" , " Options:" , " -b <#buckets>, -lb <2log-of-#buckets>" , " Number of buckets initially created." , " -hf " , " Hash function to use:" , " o Daniel Philips (default)" , " o Bob Jenkins" , " o Chris Torek" , " o Berkely Databse" , " o GNU Emacs" , " o Dan Bernstein" , " o UNIX ELF" , " o Some random and less random attempts of mine" , " -load , -lload <2log-of-load>" , " Hash doubles when *average* bucket size exceeds load." , " --build Exit after building hash." , " --const Disable hash growing (how un-Dutch)." , " --walk Walk entire hash after creation." , " --show Walk entire hash after creation, print all buckets." , " -egg Look for an egg dressed in string." , NULL } ; int main ( int argc , char* argv[] ) { int a ; int ct = 0 ; int found = 0 ; int hashoptions = 0 ; int n_buckets = 1024 ; float load = 1.0 ; mcxbool consthash = FALSE ; mcxbool buildonly = FALSE ; mcxbool walkhash = FALSE ; mcxbool searchegg = FALSE ; mcxbool sortit = FALSE ; mcxbool show = FALSE ; mcxTing** key_buf = NULL ; int window = 0 ; const char* pattern = "egg" ; mcxTing* eggs = mcxTingEmpty(NULL, 30) ; mcxmode rlmode = MCX_READLINE_CHOMP ; u32 (*strhash)(const void* str) = mcxTingCThash ; mcxTing *line = mcxTingEmpty(NULL, 160) ; mcxKV *kv ; mcxIO *xf ; mcxHash* hash ; mcxHashSettings settings ; const char* me = "hashfile" ; u8 n_bits = 0 ; dim n_lines = 0 ; if (argc < 2 || !strcmp(argv[1], "-h")) goto help ; xf = mcxIOnew(argv[1], "r") ; mcxIOopen(xf, EXIT_ON_FAIL) ; a = 2 ; while (a < argc) { if (!strcmp(argv[a], "-b")) { if (a++ + 1 not supported\n", argv[a] ) , exit(1) ; } else goto arg_missing ; } else if (!strcmp(argv[a], "-h")) { help: ; mcxUsage(stdout, me, usagelines) , exit(0) ; } else if (0) { arg_missing: ; fprintf ( stdout , "[hashfile] Flag %s needs argument; see help (-h)\n" , argv[argc-1] ) ; exit(1) ; } else break ; a++ ; } hash = mcxHashNew(n_buckets, strhash, mcxTingCmp) ; if (consthash) hashoptions |= MCX_HASH_OPT_CONSTANT ; mcxHashSetOpts(hash, load, hashoptions) ; mcxHashGetSettings(hash, &settings) ; n_buckets = settings.n_buckets ; fprintf(FPTELL, "\n---> building hash ..\n") ; if (window) key_buf = mcxAlloc(window * sizeof(mcxTing*), EXIT_ON_FAIL) ; while(STATUS_OK == mcxIOreadLine(xf, line, rlmode)) { mcxTing* key = mcxTingNew(line->str) ; mcxKV* kv = mcxHashSearch(key, hash, MCX_DATUM_INSERT) ; char* ptrct ; if (!kv) fprintf(FPTELL, ">>> >>> void kv for key <%s>!\n", key->str) ; else if (!kv->key) fprintf(FPTELL, ">>> >>> void object for key <%s>!\n", key->str) , exit(1) ; else if (kv->key != key) mcxTingFree(&key) ; else if (strcmp(((mcxTing*)kv->key)->str, key->str)) fprintf ( FPTELL , ">>> >>> diff key_i(%s) key_o(%s)\n" , ((mcxTing*)kv->key)->str , key->str ) ; if (key && window) { if (n_lines >= window) { mcxTing* key2 = key_buf[n_lines % window] ; mcxKV* kv = mcxHashSearch(key2, hash, MCX_DATUM_DELETE) ; if (!kv) fprintf ( FPTELL , ">>> >>> lost key_o(%s)\n" , key2->str ) ; mcxTingFree(&key2) ; } key_buf[n_lines % window] = key ; } n_lines++ ; ptrct = kv->val ; ptrct++ ; kv->val = ptrct ; ct++ ; } fprintf (FPTELL, "done building hash (%lu insertions, %lu lines).\n", (unsigned long) ct, (unsigned long) xf->lc) ; mcxHashGetSettings(hash, &settings) ; fprintf ( FPTELL , "hash stats %lu entries, %lu buckets initial, %lu buckets final\n" , (unsigned long) settings.n_entries , (unsigned long) n_buckets , (unsigned long) settings.n_buckets ) ; { dim t = settings.n_buckets -1 ; while (t) n_bits++ , t >>= 1 ; } fprintf ( FPTELL , "hash settings: [load %.3f] [mask %ld] [bits %d]\n" , settings.load , (long) (settings.n_buckets -1) , (int) n_bits ) ; if (buildonly) exit(0) ; if (walkhash) { mcxHashWalk* walk = mcxHashWalkInit(hash) ; dim bucketidx = -1, i_bucket = 0 ; fprintf(FPTELL, "---> walking hash ..\n") ; ct = 0 ; found = 0 ; while((kv = mcxHashWalkStep(walk, &i_bucket))) { ct++ ; if (mcxHashSearch(kv->key, hash, MCX_DATUM_FIND)) found++ ; if (searchegg && strstr(((mcxTing*)kv->key)->str, pattern)) fprintf(FPTELL, "() %s\n", ((mcxTing*)kv->key)->str) ; else if (show) { if (i_bucket != bucketidx) { bucketidx = i_bucket ; fprintf(FPTELL, "-> %lu\n", (unsigned long) i_bucket) ; } fprintf(FPTELL, "[%s]\n", ((mcxTing*)kv->key)->str) ; } ; } fprintf(FPTELL, "done walking hash (%d walked, %d found).\n", ct, found) ; mcxHashWalkFree(&walk) ; } while (a < argc) { mcxTingWrite(eggs, argv[a]) ; kv = mcxHashSearch(eggs, hash, MCX_DATUM_FIND) ; if (kv) fprintf(FPTELL, "---> present: <%s>\n", ((mcxTing*)kv->key)->str) ; else fprintf(FPTELL, "---> absent: <%s>\n", eggs->str) ; a++ ; } if (sortit) { dim n_entries = 0, i ; void** obs = mcxHashKVs(hash, &n_entries, mcxPKeyTingCmp, 0) ; for (i=0;ikey ; int lct = ((char*) kv->val - (char*) 0) ; while (--lct >= 0) fputs(tg->str, stdout) , fputc('\n', stdout) ; } } mcxHashStats(FPTELL, hash) ; fprintf(FPTELL, "---> deleting hash ..\n") ; mcxHashFree(&hash, mcxTingRelease, NULL) ; mcxFree(key_buf) ; mcxIOfree(&xf) ; mcxTingFree(&eggs) ; mcxTingFree(&line) ; fprintf(FPTELL, "done deleting hash.\n") ; fprintf(FPTELL, "\n") ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_let.c000066400000000000000000000027431416241612100174270ustar00rootroot00000000000000/* Copyright (C) 2002, 2003, 2004, 2005 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include #include #include #include "tingea/ting.h" #include "tingea/ding.h" #include "tingea/alloc.h" #include "tingea/minmax.h" #include "tingea/err.h" #include "tingea/types.h" #include "tingea/ding.h" #include "tingea/let.h" int main ( int argc , char* argv[] ) { long ival ; double fval ; int flags ; int debug = argc > 2 ; telRaam *raam ; if (argc <= 1) exit(1) ; if (argc > 3) /* terrible, fixme */ trmDebug() ; raam = trmInit(argv[argc-1]) ; if (trmParse(raam)) { mcxErr("main", "parse error") ; trmExit(raam) ; exit(1) ; } if (debug) trmDump(raam, "after parse") ; flags = trmEval(raam, &ival, &fval) ; if (debug) trmDump(raam, "after eval") ; if (flags < 0) printf ("evaluation error occurred\n") ; else if (trmIsNan(flags)) printf ("arithmetic exception\n") ; else if (trmIsNum(flags)) printf ("%ld\n", ival) ; else printf ("%.15g\n", fval) ; if (trmExit(raam)) mcxErr("main", "unexpected free error") ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_link.c000066400000000000000000000020231416241612100175670ustar00rootroot00000000000000/* Copyright (C) 2004, 2005 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include #include #include "tingea/list.h" int main ( int argc , char* argv[] ) { mcxLink* src = mcxListSource(2, MCX_GRIM_ARITHMETIC) ; mcxLink* a = mcxLinkSpawn(src, "a") ; mcxLink* b = mcxLinkAfter(a, "b") ; mcxLink* d = mcxLinkAfter(b, "d") ; mcxLink* c = mcxLinkAfter(b, "c") ; mcxLink* e = mcxLinkAfter(d, "e") ; mcxLink* x = mcxLinkBefore(a, "_") ; mcxLink* t = c ; int i = 0; ; mcxLinkClose(e, x) ; while (t && i < 20) { if (t->val) fprintf(stdout, "link has value <%s>\n", (char*) t->val) ; t = t->prev ; i++ ; } mcxListFree(&src, NULL) ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_match.c000066400000000000000000000020031416241612100177240ustar00rootroot00000000000000/* Copyright (C) 2003, 2004, 2005, 2006, 2007 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include #include #include #include "tingea/types.h" #include "tingea/hash.h" #include "tingea/ting.h" #include "tingea/types.h" #include "tingea/err.h" #include "tingea/io.h" int main ( int argc , char* argv[] ) { mcxIO* xf ; char* pat ; mcxstatus stat ; if (argc < 3) mcxDie(1, "match", "Usage: match ") ; xf = mcxIOnew(argv[2], "r") ; pat = argv[1] ; mcxIOopen(xf, EXIT_ON_FAIL) ; stat = mcxIOfind(xf, pat, RETURN_ON_FAIL) ; fprintf(stdout, "%s! at pos %ld\n", stat ? "Zilch" : "Eureka", (long) xf->bc) ; mcxIOfree(&xf) ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_optoid.c000066400000000000000000000064641416241612100201450ustar00rootroot00000000000000/* Copyright (C) 2005 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ /* Description: * template file for tingea option processing. */ #include #include #include "tingea/ting.h" #include "tingea/opt.h" #include "tingea/io.h" #include "tingea/err.h" enum { MY_OPT_EGG , MY_OPT_OUTPUT , MY_OPT_VERSION = MY_OPT_OUTPUT + 2 , MY_OPT_HELP , MY_OPT_APROPOS , MY_OPT_007 } ; static const char* me = "optoid"; const char* syntax = "optoid [-a ]"; mcxOptAnchor options[] = { { "--apropos" , MCX_OPT_DEFAULT | MCX_OPT_INFO , MY_OPT_APROPOS , NULL , "print this help" } , { "-h" , MCX_OPT_DEFAULT | MCX_OPT_INFO , MY_OPT_HELP , NULL , "print this help" } , { "-a" , MCX_OPT_HASARG , MY_OPT_EGG , "" , "new answer" } , { "-o" , MCX_OPT_HASARG , MY_OPT_OUTPUT , "" , "output file name" } , { "-v" , MCX_OPT_HASARG , MY_OPT_VERSION , NULL , "print version and exit" } , { "--007" , MCX_OPT_DEFAULT | MCX_OPT_HIDDEN , MY_OPT_007 , NULL , "\tMi\tDshow *all* options" } , { NULL , 0 , 0 , NULL , NULL } } ; int main ( int argc , char* argv[] ) { mcxIO* xfout = mcxIOnew("-", "w") ; mcxstatus status = STATUS_FAIL ; int i, j ; mcxstatus parseStatus = STATUS_OK ; mcxOption* opts, *opt ; int n_arg_read = 0 ; int n_arg_trailing = 0 ; const char* statement = "mind and language are a double helix" ; mcxOptAnchorSortById(options, sizeof(options)/sizeof(mcxOptAnchor) -1) ; if ( !( opts = mcxOptExhaust (options, (char**) argv, argc, 1, &n_arg_read, &parseStatus) ) ) exit(0) /* opts = mcxOptParse(options, (char**) argv, argc, 1, 0, &parseStatus) */ ; for (opt=opts;opt->anch;opt++) { mcxOptAnchor* anch = opt->anch ; switch(anch->id) { case MY_OPT_HELP : case MY_OPT_APROPOS : mcxOptApropos(stdout, me, syntax, 20, MCX_OPT_DISPLAY_SKIP, options) ; return 0 ; case MY_OPT_007 : mcxOptApropos ( stdout, me, syntax, 20 , MCX_OPT_DISPLAY_SKIP | MCX_OPT_DISPLAY_HIDDEN , options ) ; return 0 ; case MY_OPT_EGG : statement = opt->val ; break ; case MY_OPT_OUTPUT : mcxIOrenew(xfout, opt->val, "w") ; break ; case MY_OPT_VERSION : fprintf(stdout, "0\n") ; break ; } } n_arg_trailing = argc - n_arg_read - 1 ; if (mcxIOopen(xfout, RETURN_ON_FAIL)) { mcxErr(me, "cannot open file %s", xfout->fn->str) ; mcxIOfree(&xfout) ; return 1 ; } fprintf(xfout->fp, "first of all: %s.\n", statement) ; for (i=n_arg_read+1,j=2;ifp, "%12d: %s.\n", j, argv[i]) ; mcxIOclose(xfout) ; mcxIOfree(&xfout) ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_pagesize.c000066400000000000000000000003351416241612100204450ustar00rootroot00000000000000 #include #include #include #include "tingea/getpagesize.h" int main ( int argc , char* argv[] ) { size_t ps = getpagesize() ; fprintf(stdout, "%zd\n", ps) ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_rand.c000066400000000000000000000030451416241612100175630ustar00rootroot00000000000000/* Copyright (C) 2005, 2006, 2007 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #define REVERT 1 #include "tingea/ting.h" #include "tingea/io.h" #include "tingea/ding.h" #include "tingea/heap.h" #include "tingea/rand.h" #include "tingea/err.h" #include "tingea/tok.h" #include "tingea/types.h" #include #include #include #include ulong N = 1 << 20; static double mcxNormalSample2 ( void ) { return mcxNormalSample(3.0, 1.0) ; } int main ( int argc , char* argv[] ) { double *x ; dim i ; double avg = 0.0, stddev = 0.0, stddev_kahan = 0.0, sum = 0.0 ; double carry = 0.0 ; double (*gaus)(void) = mcxNormalBoxMuller ; double radius = 3.0 ; double sdev = 1.0 ; double mean = 0.0 ; if (argc == 1) { fprintf(stdout, "arguments: N radius sdev mean\n") ; exit(0) ; } if (argc > 1) N = atol(argv[1]) ; if (argc > 2) radius = atof(argv[2]) ; if (argc > 3) sdev = atof(argv[3]) ; if (argc > 4) mean = atof(argv[4]) ; x = malloc (sizeof x[0] * N) ; srandom(mcxSeed(14)) ; for (i=0;i #include #include #include #include "tingea/io.h" #include "tingea/err.h" static void report_xf ( mcxIO* xf ) { mcxTell ( "xf counters" , "xbc <%ld> xlc <%ld> xlo <%ld> xlo_ <%ld>" , (long) xf->bc , (long) mcxIOlc(xf) , (long) xf->lo , (long) xf->lo_ ) ; } int main ( int argc , char* argv[] ) { mcxIO* xf = mcxIOnew(argc > 1 ? argv[1] : "-", "r") ; int mode = argc > 2 ? atoi(argv[2]) : 0 ; int xmode = argc > 3 ? atoi(argv[3]) : 0 ; int c ; mcxTing* line = mcxTingEmpty(NULL, 160) ; int n_read ; char buf[4097] ; mcxIOopen(xf, EXIT_ON_FAIL) #define TRUMP_READLINE_SHOW (MCX_READLINE_DOT << 1) ; mcxbool show = xmode & TRUMP_READLINE_SHOW ? TRUE : FALSE ; BIT_OFF(xmode, TRUMP_READLINE_SHOW) ;fprintf(stderr, "xmode %d\n", xmode) ; if (!mode) fprintf ( stderr, "Usage: read [] []\n" "mode 1 fgetc\n" "mode 2 mcxIOstep\n" "mode 3 mcxIOreadLine\n" "mode 4 mcxIOreadFile\n" "mode 5 read\n" "mode 6 read + strchr(\\n)\n" "mode 7 read + strcspn(\\r\\n)\n" "mode 8 output character counts\n" " xmodes\n" " CHOMP %d\n" " SKIP %d\n" " PAR %d\n" " BSC %d\n" " DOT %d\n" " show %d\n" , MCX_READLINE_CHOMP , MCX_READLINE_SKIP_EMPTY , MCX_READLINE_PAR , MCX_READLINE_BSC , MCX_READLINE_DOT , TRUMP_READLINE_SHOW ) , exit(0) ; if (mode == 1) while ((c = fgetc(xf->fp)) != EOF) ; ; if (mode == 2) { while ((c = mcxIOstep(xf)) != EOF) if (0) fprintf(stderr, "[%c-%ld]", c, mcxIOlc(xf)) ; report_xf(xf) ; } if (mode == 3) { long lc = 0 ; mcxstatus status ; while ( STATUS_OK == (status = mcxIOreadLine(xf, line, xmode)) ) { if (line->len) lc++ ; if (show) mcxTell(NULL, "[%s]", line->str) ; } mcxTell ( NULL , "last line <%s>\n" "line count <%ld>" , line->str , lc ) ; report_xf(xf) ; } if (mode == 4) mcxIOreadFile(xf, line) , mcxTell(NULL, "string size <%ld>", (long) line->len) , report_xf(xf) ; if (mode == 5) while (read(fileno(xf->fp), buf, 4096) > 0) ; ; if (mode == 6) while ((n_read = read(fileno(xf->fp), buf, 4096) > 0)) { const char* s ; buf[n_read] = '\0' ; if ((s = strchr(buf, '\n'))) buf[s-buf] = 'a' ; } if (mode == 7) while ((n_read = read(fileno(xf->fp), buf, 4097) > 0)) { int n ; buf[n_read] = '\0' ; n = strcspn(buf, "\r\n") ; buf[n] = '\n' ; } if (mode == 8) { unsigned long tally[256] = { 0 } ; int i ; while ((c = fgetc(xf->fp)) != EOF) tally[c]++ ; for (i=0;i<256;i++) fprintf(stdout, "%d\t%c\t%lu\n", i, i > 31 && i < 127 ? i : '-', tally[i]) ; } return 0 ; } /* last line */ cimfomfa-21-361/src/trumpet/cff_reap.c000066400000000000000000000557501416241612100176000ustar00rootroot00000000000000 #include #include #include #include "tingea/types.h" #include "tingea/hash.h" #include "tingea/ting.h" #include "tingea/types.h" #include "tingea/io.h" #include "tingea/opt.h" #include "tingea/err.h" #include "tingea/alloc.h" #define FPTELL stderr /* TODO: diagnostic output: reduced != ignored, * because reduce takes into account max_genome, whereas ignored does not. */ const char* usagelines[] = { "Usage: reap " , NULL } ; static const char* me = "reap"; const char* syntax = "reap -fasta-sl -ssaha [options]"; unsigned basemap[256] = { 0 }; static void basemap_init ( void ) { dim i ; for (i=0;i<256;i++) basemap[i] = 5 ; basemap['A'] = basemap['a'] = 0 ; basemap['C'] = basemap['c'] = 1 ; basemap['G'] = basemap['g'] = 2 ; basemap['T'] = basemap['t'] = 3 ; basemap['U'] = basemap['u'] = 3 /* everything < 4 is coding */ ; basemap['N'] = basemap['n'] = 4 /* masked */ ; basemap['X'] = basemap['x'] = 4 /* masked */ ; basemap['\n'] = 8 /* bit 8 set */ ; basemap['\r'] = 9 /* bit 8 set */ ; } typedef struct { dim depth ; dim length ; } readattr ; typedef struct { unsigned min_alnlen ; float min_identity ; float min_alnratio ; unsigned max_gaplen ; unsigned max_start ; int do_filter ; int do_divide ; unsigned max_genome ; const char* bugme ; } readpar ; /* if we ever keep everything in memory, then we * could economize by taking members out from chrhit below. */ typedef struct { unsigned index ; unsigned start ; unsigned end ; unsigned score /* currently redundant after first filtering */ ; float identity /* currently redundant after first filtering */ ; unsigned depth /* copied from seqattr, so currently redundant */ ; unsigned length /* copied from seqattr, so currently redundant */ ; unsigned n_places /* number of places where it maps */ ; char revstrand ; } chrhit ; typedef struct { unsigned pos /* zero means unused */ ; float count_fwd ; float count_rev ; } hcell ; static int cmp_track_position(const void* k1, const void* k2) { const hcell* h1 = k1, *h2 = k2 ; if (!h1->pos) return h2->pos ? 1 : (h1 > h2) ; if (!h2->pos) return -1 ; return h1->pos < h2->pos ? -1 : 1 ; } typedef struct { hcell* cells /* size hmask + 1 */ ; unsigned hmask /* at least 1<<14 */ ; dim n_used ; } harray ; #define hashwell(position, mask) (position & mask) #define HASH_JUMP 34567 /* should be coprime with mask */ #define HSEARCH(lvalue, cells, themask, thepos) \ { unsigned hhh = hashwell(thepos, themask) \ ; dim jj = 0 \ ; while (cells[hhh].pos != 0 && cells[hhh].pos != thepos) \ { hhh += HASH_JUMP \ ; hhh &= themask \ ; if (jj++ > themask) \ mcxDie(1, "hash", "error") \ ; } \ lvalue = cells + hhh \ ; if (!cells[hhh].pos) \ cells[hhh].pos = thepos \ ; } static dim count_max = 0; #define HINC(ha, thepos, revstrand, depth) \ { hcell* ce \ ; HSEARCH(ce, ha->cells, ha->hmask, thepos) \ ; if (!ce->count_fwd && !ce->count_rev) \ ha->n_used++ \ ; if (revstrand) \ ce->count_rev += depth \ ; else \ ce->count_fwd += depth \ ; } #define WIDTH 3 static void harray_new(harray* h) { h->hmask = (1<cells = mcxAlloc(sizeof h->cells[0] * (h->hmask+1), EXIT_ON_FAIL) ; h->n_used = 0 ; memset(h->cells, 0, sizeof h->cells[0] * (h->hmask+1)) ; } static void harray_double(harray* ha, dim n_new, const char* name) { unsigned newmask = 2 * ha->hmask + 1 ; hcell* newcells ; dim j ; while (newmask < 2 * (ha->n_used + n_new)) newmask = 2 * newmask + 1 ; newcells = mcxAlloc(sizeof newcells[0] * (newmask+1), EXIT_ON_FAIL) /* fixme 4G limit */ ; memset(newcells, 0, sizeof newcells[0] * (newmask+1)) ; if (ha->hmask + 1 >= 1 << 31) mcxDie(1, me, "sequence %s too big", name) ; for (j=0;jhmask+1;j++) { dim p = ha->cells[j].pos ; if (p > 0) { hcell* c ; HSEARCH(c, newcells, newmask, p) ; c[0] = ha->cells[j] ; } } free(ha->cells) ; ha->cells = newcells ; ha->hmask = newmask ; } typedef struct { mcxTing* name ; harray incident ; dim n_mapped ; dim n_ignored ; } chrtrack ; /* not a brilliant name, no */ typedef struct { chrtrack* tracks ; dim n_track ; chrhit* hits ; dim n_hit ; } hitfilter ; static int cmp_tracks_name(const void* n1, const void* n2) { const chrtrack* t1 = n1, *t2 = n2 ; const mcxTing* s1 = t1->name, *s2 = t2->name ; if (s1->len != s2->len) return s1->len < s2->len ? -1 : 1 ; return strcmp(s1->str, s2->str) ; } static dim reduce_single_query(chrhit* hits, dim n_hit, chrtrack* track, int debug) { dim best_length = 0 ; float best_identity = 0.0 ; chrhit* dst = hits ; dim j ; for (j=0;jlength > best_length) best_length = src->length ; if (src->identity > best_identity ) best_identity = src->identity ; } if (debug) fprintf(stderr, "------> %d %f\n", (int) best_length, (float) best_identity); for (j=0;jlength == best_length) || (src->length+1 == best_length && src->identity >= best_identity) ) { if (dst != src) dst[0] = src[0] ; dst++ ; ok = "pass" ; } else track[src->index].n_ignored++ ;if (debug) fprintf(stderr, "-> test %d %f (%s)\n", src->length, (float) src->identity, ok); ; } return (dst - hits) ; } static void accumulate_tracks(hitfilter* flt, int divide) { chrhit* hits = flt->hits ; dim n_hit = flt->n_hit ; chrtrack* tracks = flt->tracks ; dim j ; mcxTell("track", "begin accumulating reads") ; for (j=0;jindex].incident ; dim n_new = hit->end - hit->start + 1 ; float delta = hit->depth ; dim i ; if (divide) delta /= hit->n_places ; if (delta < 0.01001) delta = 0.01001 ; if ((ha->n_used + n_new) * 2 > ha->hmask) harray_double(ha, n_new, tracks->name->str) ; for (i=hit->start; i<=hit->end; i++) HINC(ha, i, hit->revstrand, delta) ; tracks[hit->index].n_mapped++ ; } } enum { MY_OPT_FASTASL , MY_OPT_SSAHA , MY_OPT_OUTPUT , MY_OPT_DIVIDE , MY_OPT_HELP , MY_OPT_APROPOS , MY_OPT_MINIDENTITY , MY_OPT_MINALNRATIO , MY_OPT_MINALNLEN , MY_OPT_MAXGAPLEN , MY_OPT_MAXSTART , MY_OPT_MAXGENOME , MY_OPT_NOFILTER , MY_OPT_BUGME } ; mcxOptAnchor options[] = { { "--apropos" , MCX_OPT_DEFAULT | MCX_OPT_INFO , MY_OPT_APROPOS , NULL , "print this help" } , { "-h" , MCX_OPT_DEFAULT | MCX_OPT_INFO , MY_OPT_HELP , NULL , "print this help" } , { "--filter-off" , MCX_OPT_DEFAULT , MY_OPT_NOFILTER , NULL , "turn off all filtering modes" } , { "--divide-depth" , MCX_OPT_DEFAULT , MY_OPT_DIVIDE , NULL , "divide read depth over hits" } , { "-max-genome" , MCX_OPT_HASARG , MY_OPT_MAXGENOME , "" , "maximum allowed hits to genome (0 denotes 0~0)" } , { "-max-start" , MCX_OPT_HASARG , MY_OPT_MAXSTART , "" , "maximum allowed start position" } , { "-max-gap-len" , MCX_OPT_HASARG , MY_OPT_MAXGAPLEN , "" , "maximum total gap length" } , { "-min-aln-ratio" , MCX_OPT_HASARG , MY_OPT_MINALNRATIO , "" , "minimum ratio of aligned sequence" } , { "-min-identity" , MCX_OPT_HASARG , MY_OPT_MINIDENTITY , "" , "minimum identity" } , { "-min-aln-len" , MCX_OPT_HASARG , MY_OPT_MINALNLEN , "" , "minimum alignment length" } , { "-fasta-sl" , MCX_OPT_HASARG , MY_OPT_FASTASL , "" , "fasta file for reads, single line for a sequence, depth_ annotation" } , { "-trace" , MCX_OPT_HASARG , MY_OPT_BUGME , "" , "emit diagnostics for query-id" } , { "-o" , MCX_OPT_HASARG , MY_OPT_OUTPUT , "" , "output file" } , { "-ssaha" , MCX_OPT_HASARG , MY_OPT_SSAHA , "" , "ssaha result file" } , { NULL , 0 , 0 , NULL , NULL } } ; static void read_fasta(mcxIO* xffasta, mcxHash* seqattr) { int expect_id = 1 ; readattr* attr= NULL ; mcxTing *line = mcxTingEmpty(NULL, 160) ; dim n_read = 0 ; while(STATUS_OK == mcxIOreadLine(xffasta, line, MCX_READLINE_CHOMP)) { mcxTing* key = NULL ; mcxKV* kv = NULL ; if (expect_id) { dim n_char_id ; ulong depth ; const char* wrong = NULL ; do /* fixme funcify */ { if ((uchar) line->str[0] != '>') { wrong = "expect identifier"; break; } ; if (!(n_char_id = strcspn(line->str+1, " \t\r\n"))) { wrong = "expect valid identifier"; break; } ; if (1 != sscanf(line->str+1+n_char_id, " depth_%lu", &depth)) { wrong = "no depth"; break; } ; } while(0) ; if (wrong) mcxDie(1, me, "%s at line %lu", wrong, (ulong) xffasta->lc) ; key = mcxTingNNew(line->str+1, n_char_id) ; kv = mcxHashSearch(key, seqattr, MCX_DATUM_INSERT) ; if (kv->key != key) mcxDie(1, me, "sequence <%s> already present", key->str) ; if (!(kv->val = attr = malloc(sizeof attr[0]))) mcxDie(1, me, "unable to malloc") ; attr->depth = depth ; expect_id = 0 ; n_read++ ; } else { dim length = line->len ; while (length && basemap[(uchar) line->str[length-1]] >= 4) length-- ; attr->length = length ; expect_id = 1 ; } } mcxTell("fasta read", "parsed %lu identifier/sequence pairs", (ulong) n_read) ; } static void read_ssaha(mcxIO* xfssaha, mcxHash* seqattr, readpar par, hitfilter* flt) { mcxTing *line = mcxTingEmpty(NULL, 160) ; mcxTing *idquery = mcxTingEmpty(NULL, 160) ; mcxTing *idtrack = mcxTingEmpty(NULL, 160) ; dim n_skip_reduce = 0, n_skip_gap = 0, n_skip_start = 0, n_skip_length = 0, n_skip_identity = 0, n_skip_ratio = 0 ; dim n_skip_union = 0 ; dim n_taken = 0 ; mcxHash *chrmap = mcxHashNew(1<<12, mcxTingCThash, mcxTingCmp) ; const char* query_previous = NULL ; dim n_hit = 0 ; dim ofs_hits = 0 ; dim n_hit_alloc = 8 ; chrhit* hits = mcxAlloc(n_hit_alloc * sizeof hits[0], EXIT_ON_FAIL) ; dim n_track = 0, track_id = 0 ; dim n_track_alloc = 1<<16 ; chrtrack* tracks = mcxAlloc(n_track_alloc * sizeof tracks[0], EXIT_ON_FAIL) ; while(STATUS_OK == mcxIOreadLine(xfssaha, line, MCX_READLINE_CHOMP)) { ulong score ; ulong qstart, qend, rstart, rend ; char str[2] ; int revstrand ; ulong alnlen ; float identity ; mcxKV* kvtrack, *kvquery ; readattr* qattr ; mcxTingEnsure(idquery, line->len) ; mcxTingEnsure(idtrack, line->len) ; if ( 10 != sscanf ( line->str , "%*s %lu %s %s %lu %lu %lu %lu %[CF+-] %lu %f" , &score , idquery->str, idtrack->str , &qstart, &qend , &rstart, &rend , (char*) &str /* dangersign fixme string cast */ , &alnlen , &identity ) ) mcxDie(1, me, "no match at line %lu", (ulong) xfssaha->lc) ;if(0)fprintf(stderr, "query %s track %s rstart %d\n", idquery->str, idtrack->str, (int) rstart) ; idquery->len = strlen(idquery->str) ; idtrack->len = strlen(idtrack->str) ; revstrand = str[0] == 'F' ? 0 : 1 ; kvquery = mcxHashSearch(idquery, seqattr, MCX_DATUM_FIND) ; if (!kvquery) mcxDie(1, me, "cannot find query <%s>", idquery->str) ; qattr = kvquery->val ; if (rstart > rend) { ulong t = rend; rend = rstart; rstart = t; } ; if (qstart > qend) { ulong t = qend; qend = qstart; qstart = t; } ; if (par.do_filter) { const char* skip = NULL ; do { if (alnlen < par.min_alnlen) { n_skip_length++ ; skip = "minimum alignment length threshold" ; } if (identity < par.min_identity) { n_skip_identity++ ; skip = "identity threshold" ; } if (1.0 * alnlen * 1.0 / qattr->length < par.min_alnratio) { n_skip_ratio++ ; skip = "aligned fraction" ; } if (alnlen != rend - rstart + 1) { n_skip_gap++ ; skip = "gap in alignment" ; } if (qstart > par.max_start) { n_skip_start++ ; skip = "start threshold" ; } } while (0) ; if (skip) { if (par.bugme && !strcmp(par.bugme, idquery->str)) mcxTell(me, "skipping query %s: %s", par.bugme, skip) ; continue ; } } kvtrack = mcxHashSearch(idtrack, chrmap, MCX_DATUM_INSERT) ; if (!n_hit) query_previous = ((mcxTing*) kvquery->key)->str ; if (kvtrack->key == idtrack) /* newly inserted */ { kvtrack->val = ULONG_TO_VOID n_track ; idtrack = mcxTingEmpty(NULL, idtrack->mxl) ; track_id = n_track ; if (n_track >= n_track_alloc) n_track_alloc *= 1.4 , tracks = mcxRealloc(tracks, n_track_alloc * sizeof hits[0], EXIT_ON_FAIL) ; tracks[n_track].name = kvtrack->key /* dangersign: shallow copy */ ; harray_new(&tracks[n_track].incident) ; tracks[n_track].n_mapped = 0 ; tracks[n_track].n_ignored = 0 ; n_track++ ; } else /* already exists */ track_id = VOID_TO_ULONG kvtrack->val ; if (strcmp(query_previous, ((mcxTing*) (kvquery->key))->str)) /* kvquery->key->str is persistent */ { dim j ; int debug = par.bugme && !strcmp(query_previous, par.bugme) /* fixme: check offset arithmetic */ ; n_taken = reduce_single_query(hits + ofs_hits, n_hit - ofs_hits, tracks, debug) ;if (debug) fprintf(stderr, "for seq_13707 have %d from %d\n", (int) n_taken, (int) (n_hit -ofs_hits)) ; if (par.max_genome && n_taken > par.max_genome) n_taken = 0 ; query_previous = ((mcxTing*) (kvquery->key))->str ; for (j=0;jkey))->str); { if (n_hit >= n_hit_alloc) n_hit_alloc *= 1.4 , hits = mcxRealloc(hits, n_hit_alloc * sizeof hits[0], EXIT_ON_FAIL) ; hits[n_hit].index = track_id ;if(0)fprintf(stderr, "write to track %s\n", tracks[track_id].name->str) ; hits[n_hit].start = rstart ; hits[n_hit].end = rend ; hits[n_hit].revstrand= revstrand ; hits[n_hit].depth = qattr->depth ; hits[n_hit].length= alnlen ; hits[n_hit].score = score ; hits[n_hit].identity = identity ; n_hit++ ; } } { dim j /* fixme duplication ugly. */ ; n_taken = reduce_single_query ( hits + ofs_hits , n_hit - ofs_hits , tracks , par.bugme && !strcmp(query_previous, par.bugme) ) ; if (par.max_genome && n_taken > par.max_genome) n_taken = 0 ; for (j=0;jlc , (ulong) n_hit , (ulong) n_skip_reduce , (ulong) n_skip_union ) ; mcxTell ( "ssaha read" , "skipped length=%lu ident=%lu ratio=%lu gap=%lu, start=%lu" , (ulong) n_skip_length , (ulong) n_skip_identity , (ulong) n_skip_ratio , (ulong) n_skip_gap , (ulong) n_skip_start ) ; mcxTell("ssaha read", "found %lu tracks", (ulong) n_track) ; flt->n_track= n_track ; flt->tracks = tracks ; flt->hits = hits ; flt->n_hit = n_hit ; } static void destroy_and_write_tracks(hitfilter* flt, mcxIO* xfout) { dim i, bases_used = 0, reads_ignore = 0, reads_mapped = 0 ; for (i=0;in_track;i++) { dim u = flt->tracks[i].incident.n_used ; dim m = flt->tracks[i].n_mapped ; dim ig= flt->tracks[i].n_ignored ; bases_used += u ; reads_mapped+= m ; reads_ignore+= ig ; } mcxTell ( "track" , "writing (%d bases mapped, %d reads mapped, %d reads ignored)" , (int) bases_used , (int) reads_mapped , (int) reads_ignore ) /* WARNING: SORTING THE TRACKS IS A DESTRUCTIVE OPERATION: HASH * is no longer usable as a hash. */ ; for (i=0;in_track;i++) { dim track_size = 0, j = 0 ; hcell* hc = flt->tracks[i].incident.cells ; const char* curname = flt->tracks[i].name->str ; qsort ( flt->tracks[i].incident.cells , flt->tracks[i].incident.hmask+1 , sizeof(hcell) , cmp_track_position ) ; while (hc->pos > 0) { fprintf ( xfout->fp , "%s:%lu\t%lu\t%lu\n" , curname , (ulong) hc->pos , (ulong) (hc->count_fwd + 0.99) , (ulong) (hc->count_rev + 0.99) ) ; track_size++ ; hc++ ; } if (track_size != flt->tracks[i].incident.n_used) mcxDie(1, me, "inconsistent mapped base count after sorting, track <%s>", flt->tracks[i].name->str) ; } } int main ( int argc , char* argv[] ) { u32 (*strhash)(const void* str) = mcxTingCThash ; mcxmode rlmode = MCX_READLINE_CHOMP ; mcxKV *kv ; mcxIO *xffasta = NULL ; mcxIO *xfssaha = NULL ; mcxIO *xfout = mcxIOnew("-", "w") ; mcxHash *seqattr = mcxHashNew(1<<16, strhash, mcxTingCmp) ; mcxstatus parseStatus = STATUS_OK ; mcxOption* opts, *opt ; int n_arg_read = 0 ; int n_arg_trailing = 0 ; int a ; readpar par = { 0 } ; hitfilter flt = { NULL, 0, NULL, 0 } ; par.min_alnlen = 15 ; par.min_identity = 90.0 ; par.min_alnratio = 0.6 ; par.max_gaplen = 0 ; par.max_start = 2 ; par.do_filter = 1 ; par.do_divide = 0 ; par.max_genome = 100 ; par.bugme = NULL ; basemap_init() ; mcxOptAnchorSortById(options, sizeof(options)/sizeof(mcxOptAnchor) -1) ; opts = mcxOptParse(options, (char**) argv, argc, 1, 0, &parseStatus) ; if (parseStatus != STATUS_OK) mcxDie(1, me, "initialization failed") ; for (opt=opts;opt->anch;opt++) { mcxOptAnchor* anch = opt->anch ; switch(anch->id) { case MY_OPT_HELP : case MY_OPT_APROPOS : mcxOptApropos(stdout, me, syntax, 20, MCX_OPT_DISPLAY_SKIP, options) ; return 0 ; case MY_OPT_MINALNRATIO : par.min_alnratio = atof(opt->val) ; break ; case MY_OPT_MINIDENTITY : par.min_identity = atof(opt->val) ; break ; case MY_OPT_MINALNLEN : par.min_alnlen = atoi(opt->val) ; break ; case MY_OPT_MAXGAPLEN : par.max_gaplen = atoi(opt->val) ; break ; case MY_OPT_MAXGENOME : par.max_genome = atoi(opt->val) ; break ; case MY_OPT_MAXSTART : par.max_start = atoi(opt->val) ; break ; case MY_OPT_DIVIDE : par.do_divide = 1 ; break ; case MY_OPT_BUGME : par.bugme = opt->val ; break ; case MY_OPT_NOFILTER : par.do_filter = 0 ; break ; case MY_OPT_SSAHA : xfssaha = mcxIOnew(opt->val, "r") ; break ; case MY_OPT_FASTASL : xffasta = mcxIOnew(opt->val, "r") ; break ; case MY_OPT_OUTPUT : mcxIOrenew(xfout, opt->val, "w") ; break ; } } ; if (!xffasta || !xfssaha) mcxDie(1, me, "-fasta-sl and -ssaha options are both required") ; mcxIOopen(xffasta, EXIT_ON_FAIL) ; mcxIOopen(xfssaha, EXIT_ON_FAIL) ; mcxIOopen(xfout, EXIT_ON_FAIL) ; read_fasta(xffasta, seqattr) ; read_ssaha(xfssaha, seqattr, par, &flt) /* fixme todo: reinstate the accounting part of reduce_single_query * it does in the current setup not need to know at how many places a read maps. */ ; accumulate_tracks(&flt, par.do_divide) ; qsort(flt.tracks, flt.n_track, sizeof flt.tracks[0], cmp_tracks_name) ; destroy_and_write_tracks(&flt, xfout) ; return 0 ; } #if 0 { mcxHashWalk* walk = mcxHashWalkInit(seqattr) ; dim ct = 0 ; while((kv = mcxHashWalkStep(walk, NULL))) { mcxTing* key = kv->key ; readattr* par = kv->val ; ct++ ;fprintf(stdout, "[%s] %lu %lu\n", key->str, (ulong) par->depth, (ulong) par->length) ; } mcxHashWalkFree(&walk) ; } #endif cimfomfa-21-361/src/trumpet/cff_sow.c000066400000000000000000000022311416241612100174430ustar00rootroot00000000000000/* Copyright (C) 2005 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include #include #include #include "tingea/rand.h" static void print_bits ( unsigned u ) { char bits[32] ; int i = 0 ; while (u || i < 32) { bits[i++] = u & 1 ? '1' : '0' ; u >>= 1 ; } for (i=31;i>=0;i--) putc(bits[i], stdout) ; } int main ( int argc , char* argv[] ) { double x[1<<20] #if 0 ; srandom(s) ; while (i++ < n) { unsigned s = mcxSeed(i) ; printf("| %12u ", s) ; print_bits(s) ; putc('\n', stdout) ; if (m) { int j = 0 ; srandom(s) ; while (j++> %12ld ", u) ; print_bits(u) ; putc('\n', stdout) ; } } } #endif ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_tring.c000066400000000000000000000073361416241612100177710ustar00rootroot00000000000000/* Copyright (C) 2005 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ /* Description: * template file for tingea option processing. */ #include #include #include "tingea/ting.h" #include "tingea/opt.h" #include "tingea/io.h" #include "tingea/err.h" #include "tingea/tr.h" enum { MY_OPT_SRC , MY_OPT_DST , MY_OPT_DEL , MY_OPT_SQS , MY_OPT_SUB , MY_OPT_DEBUG , MY_OPT_HELP = MY_OPT_SUB + 2 , MY_OPT_APROPOS } ; static const char* me = "tring"; const char* syntax = "tring [-x -y ] [-d ] [-s ] [-a ]"; mcxOptAnchor options[] = { { "--apropos" , MCX_OPT_DEFAULT | MCX_OPT_INFO , MY_OPT_APROPOS , NULL , "print this help" } , { "-h" , MCX_OPT_DEFAULT | MCX_OPT_INFO , MY_OPT_HELP , NULL , "print this help" } , { "-a" , MCX_OPT_HASARG , MY_OPT_SUB , "" , "tring that" } , { "-d" , MCX_OPT_HASARG , MY_OPT_DEL , "" , "delete spec" } , { "-debug" , MCX_OPT_DEFAULT , MY_OPT_DEBUG , NULL , "debug mode" } , { "-s" , MCX_OPT_HASARG , MY_OPT_SQS , "" , "squash spec" } , { "-x" , MCX_OPT_HASARG , MY_OPT_SRC , "" , "source spec" } , { "-y" , MCX_OPT_HASARG , MY_OPT_DST , "" , "dest spec" } , { NULL , 0 , 0 , NULL , NULL } } ; const char* printable = "abcdefghijklmnopqrstuvwxyz" \ "~!@#$%^&*()_+" \ "0123456789-=" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ " \t" \ "[]\\{}|;':\",./<>?" ; int main ( int argc , char* argv[] ) { mcxstatus status = STATUS_FAIL ; mcxTing* subject = mcxTingNew(printable) ; mcxTing* splash = NULL ; mcxTR tr ; int i, j ; int n_arg_trailing = 0 ; const char* src = NULL ; const char* dst = NULL ; const char* del = NULL ; const char* sqs = NULL ; mcxstatus parseStatus = STATUS_OK ; mcxOption* opts, *opt ; mcxOptAnchorSortById(options, sizeof(options)/sizeof(mcxOptAnchor) -1) ; if (!(opts = mcxOptParse(options, (char**) argv, argc, 1, 0, &parseStatus))) exit(0) ; for (opt=opts;opt->anch;opt++) { mcxOptAnchor* anch = opt->anch ; switch(anch->id) { case MY_OPT_HELP : case MY_OPT_APROPOS : mcxOptApropos(stdout, me, syntax, 20, MCX_OPT_DISPLAY_SKIP, options) ; return 0 ; case MY_OPT_DEBUG : mcx_tr_debug = TRUE ; break ; case MY_OPT_SUB : mcxTingWrite(subject, opt->val) ; break ; case MY_OPT_DST : dst = opt->val ; break ; case MY_OPT_DEL : del = opt->val ; break ; case MY_OPT_SQS : sqs = opt->val ; break ; case MY_OPT_SRC : src = opt->val ; break ; } } ; status = mcxTRloadTable(&tr, src, dst, del, sqs, 0) ; if (status) { if (mcx_tr_err) mcxErr(me, "load error: %s", mcx_tr_err) ; return 1 ; } splash = mcxTRsplash(&tr, MCX_TR_SOURCE | MCX_TR_SQUASH | MCX_TR_DELETE) ; fprintf(stdout, "splash [%s]\n", splash->str) ; subject->len = mcxTRtranslate(subject->str, &tr) ; fprintf(stdout, "result [%s]\n", subject->str) ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_tst.c000066400000000000000000000016621416241612100174540ustar00rootroot00000000000000/* Copyright (C) 2005 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include "tingea/ting.h" #include "tingea/io.h" #include "tingea/ding.h" #include "tingea/heap.h" #include "tingea/rand.h" #include "tingea/array.h" #include "tingea/err.h" #include "tingea/tok.h" #include "tingea/types.h" #include #include #include #include #include #include int main ( int argc , char* argv[] ) { mcxTing* t = mcxTingNew(argv[1]) ; const char* str = argv[2] ; unsigned ofs = atoi(argv[3]) ; mcxTingSplice(t, str, ofs, 0, 5) ; fprintf(stdout, "%s\n", t->str) ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_ttwhy.c000066400000000000000000000016721416241612100200220ustar00rootroot00000000000000/* Copyright (C) 2004, 2005 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include "tingea/ting.h" #include "tingea/io.h" #include #include #include char* bar = "bar"; int main ( int argc , char* argv[] ) { int fni = fileno(stdin) ; int fno = fileno(stdout) ; int ttyi= isatty(fni) ; int ttyo= isatty(fno) ; const char* mode = NULL ; fprintf(stderr, "STDIN fileno=%d isatty=%d\n", fni, ttyi) ; fprintf(stderr, "STDOUT fileno=%d isatty=%d\n", fno, ttyo) ; mode = fseek(stdin, 0, SEEK_CUR) ? "unseekable" : "seekable" ; fprintf(stderr, "STDIN %s for length 0\n", mode) ; return 0 ; } cimfomfa-21-361/src/trumpet/cff_unit_ceilfloor.c000066400000000000000000000074301416241612100216560ustar00rootroot00000000000000/* Copyright (C) 2008 Stijn van Dongen * * This file is part of cimfomfa. You can redistribute and/or modify cimfomfa * under the terms of the GNU General Public License; either version 2 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with cimfomfa, in the file COPYING. */ #include "tingea/ting.h" #include "tingea/io.h" #include "tingea/ding.h" #include "tingea/heap.h" #include "tingea/rand.h" #include "tingea/array.h" #include "tingea/err.h" #include "tingea/tok.h" #include "tingea/types.h" #include #include #include #include #include #include static int cmp_long (const void* a, const void* b) { long au = *((long*)a) ; long bu = *((long*)b) ; return au < bu ? -1 : au > bu ? 1 : 0 ; } static const char* me = "unit_ceilfloor"; static long binarySearchCeil2(long a[], long n, long x) { long lo = 0, hi = n; while(lo < hi) { long mid = lo + (hi - lo)/2; if(a[mid] < x) lo = mid + 1; else hi = mid; } return hi; } static long binarySearchCeil(long a[],long n,long ele) { long lower=0; long upper=n-1; long mid; long pos=-1; while(lower<=upper) { mid=(lower+upper)/2; if (a[mid]==ele) { while(mid>=0 && a[mid]==ele) mid--; return mid+1; } else if(a[mid] 0) { fputc('.', stdout) /* fill the array */ ; for (i=0;i= pivot */ ; long* cl = mcxBsearchCeil(&pivot, f, N, sizeof f[0], cmp_long) ; long ttt = binarySearchCeil2(f, N, pivot) ; if (cl && ttt != cl - f) { fprintf(stdout, "mine %d yours %d\n", (int) cl[0], (int) ttt) ; for (i=0;i %d\n", (int) i, (int) f[i]) ; exit(0) ; } if ( (flr && flr[0] > pivot) /* does not satisfy condition */ || (flr && flr < omega && flr[1] <= pivot)/* there is a larger one */ || (!flr && N && f[0] <= pivot) /* none found, but one exists */ ) mcxDie(1, "tst floor", "beu") ; if ( (cl && cl[0] < pivot) /* does not satisfy condition */ || (cl && cl > f && cl[-1] >= pivot) /* there is a smaller one */ || (!cl && N && f[0] >= pivot) /* none found, but one exists */ ) mcxDie(1, "tst ceil", "beu") ; if (flr && cl && flr > cl) /* multiple identical elements */ fprintf(stdout, "[%ld]", (long) (flr-cl)) ; } fputc('\n', stdout) ; } return 0 ; } int main ( int argc , char* argv[] ) { if (argc != 4) mcxDie(1, me, "need arguments") ; return mymain(argc, argv) ; } cimfomfa-21-361/tingea/000077500000000000000000000000001416241612100146335ustar00rootroot00000000000000cimfomfa-21-361/tingea/Makefile.am000066400000000000000000000013651416241612100166740ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in ## $Id: Makefile.am-assimilate,v 1.3 2005-12-07 16:58:40 flux Exp $ AM_CPPFLAGS = -I$(top_srcdir) instdir=$(libdir) inst_LIBRARIES = libtingea.a libtingea_a_SOURCES = alloc.c array.c rand.c equate.c opt.c io.c \ err.c hash.c heap.c let.c list.c gralloc.c tok.c ting.c ding.c \ tr.c types.c library_includedir = $(includedir)/tingea library_include_HEADERS = alloc.h array.h rand.h equate.h hash.h heap.h let.h io.h \ opt.h err.h ting.h ding.h list.h gralloc.h tok.h \ compile.h getpagesize.h types.h inttypes.h minmax.h tr.h cimfomfa-21-361/tingea/Makefile.in000066400000000000000000000547061416241612100167140ustar00rootroot00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = tingea ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(library_include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(instdir)" \ "$(DESTDIR)$(library_includedir)" LIBRARIES = $(inst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libtingea_a_AR = $(AR) $(ARFLAGS) libtingea_a_LIBADD = am_libtingea_a_OBJECTS = alloc.$(OBJEXT) array.$(OBJEXT) \ rand.$(OBJEXT) equate.$(OBJEXT) opt.$(OBJEXT) io.$(OBJEXT) \ err.$(OBJEXT) hash.$(OBJEXT) heap.$(OBJEXT) let.$(OBJEXT) \ list.$(OBJEXT) gralloc.$(OBJEXT) tok.$(OBJEXT) ting.$(OBJEXT) \ ding.$(OBJEXT) tr.$(OBJEXT) types.$(OBJEXT) libtingea_a_OBJECTS = $(am_libtingea_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/alloc.Po ./$(DEPDIR)/array.Po \ ./$(DEPDIR)/ding.Po ./$(DEPDIR)/equate.Po ./$(DEPDIR)/err.Po \ ./$(DEPDIR)/gralloc.Po ./$(DEPDIR)/hash.Po ./$(DEPDIR)/heap.Po \ ./$(DEPDIR)/io.Po ./$(DEPDIR)/let.Po ./$(DEPDIR)/list.Po \ ./$(DEPDIR)/opt.Po ./$(DEPDIR)/rand.Po ./$(DEPDIR)/ting.Po \ ./$(DEPDIR)/tok.Po ./$(DEPDIR)/tr.Po ./$(DEPDIR)/types.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtingea_a_SOURCES) DIST_SOURCES = $(libtingea_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(library_include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir) instdir = $(libdir) inst_LIBRARIES = libtingea.a libtingea_a_SOURCES = alloc.c array.c rand.c equate.c opt.c io.c \ err.c hash.c heap.c let.c list.c gralloc.c tok.c ting.c ding.c \ tr.c types.c library_includedir = $(includedir)/tingea library_include_HEADERS = alloc.h array.h rand.h equate.h hash.h heap.h let.h io.h \ opt.h err.h ting.h ding.h list.h gralloc.h tok.h \ compile.h getpagesize.h types.h inttypes.h minmax.h tr.h all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tingea/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tingea/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-instLIBRARIES: $(inst_LIBRARIES) @$(NORMAL_INSTALL) @list='$(inst_LIBRARIES)'; test -n "$(instdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(instdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(instdir)" || exit 1; \ echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(instdir)'"; \ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(instdir)" || exit $$?; } @$(POST_INSTALL) @list='$(inst_LIBRARIES)'; test -n "$(instdir)" || list=; \ for p in $$list; do \ if test -f $$p; then \ $(am__strip_dir) \ echo " ( cd '$(DESTDIR)$(instdir)' && $(RANLIB) $$f )"; \ ( cd "$(DESTDIR)$(instdir)" && $(RANLIB) $$f ) || exit $$?; \ else :; fi; \ done uninstall-instLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(inst_LIBRARIES)'; test -n "$(instdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(instdir)'; $(am__uninstall_files_from_dir) clean-instLIBRARIES: -test -z "$(inst_LIBRARIES)" || rm -f $(inst_LIBRARIES) libtingea.a: $(libtingea_a_OBJECTS) $(libtingea_a_DEPENDENCIES) $(EXTRA_libtingea_a_DEPENDENCIES) $(AM_V_at)-rm -f libtingea.a $(AM_V_AR)$(libtingea_a_AR) libtingea.a $(libtingea_a_OBJECTS) $(libtingea_a_LIBADD) $(AM_V_at)$(RANLIB) libtingea.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ding.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/equate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/err.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gralloc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/heap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/let.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rand.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ting.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/types.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-library_includeHEADERS: $(library_include_HEADERS) @$(NORMAL_INSTALL) @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(library_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(library_includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(library_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(library_includedir)" || exit $$?; \ done uninstall-library_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(library_includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(instdir)" "$(DESTDIR)$(library_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-instLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/alloc.Po -rm -f ./$(DEPDIR)/array.Po -rm -f ./$(DEPDIR)/ding.Po -rm -f ./$(DEPDIR)/equate.Po -rm -f ./$(DEPDIR)/err.Po -rm -f ./$(DEPDIR)/gralloc.Po -rm -f ./$(DEPDIR)/hash.Po -rm -f ./$(DEPDIR)/heap.Po -rm -f ./$(DEPDIR)/io.Po -rm -f ./$(DEPDIR)/let.Po -rm -f ./$(DEPDIR)/list.Po -rm -f ./$(DEPDIR)/opt.Po -rm -f ./$(DEPDIR)/rand.Po -rm -f ./$(DEPDIR)/ting.Po -rm -f ./$(DEPDIR)/tok.Po -rm -f ./$(DEPDIR)/tr.Po -rm -f ./$(DEPDIR)/types.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-instLIBRARIES install-library_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/alloc.Po -rm -f ./$(DEPDIR)/array.Po -rm -f ./$(DEPDIR)/ding.Po -rm -f ./$(DEPDIR)/equate.Po -rm -f ./$(DEPDIR)/err.Po -rm -f ./$(DEPDIR)/gralloc.Po -rm -f ./$(DEPDIR)/hash.Po -rm -f ./$(DEPDIR)/heap.Po -rm -f ./$(DEPDIR)/io.Po -rm -f ./$(DEPDIR)/let.Po -rm -f ./$(DEPDIR)/list.Po -rm -f ./$(DEPDIR)/opt.Po -rm -f ./$(DEPDIR)/rand.Po -rm -f ./$(DEPDIR)/ting.Po -rm -f ./$(DEPDIR)/tok.Po -rm -f ./$(DEPDIR)/tr.Po -rm -f ./$(DEPDIR)/types.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-instLIBRARIES uninstall-library_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-instLIBRARIES cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-instLIBRARIES install-library_includeHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-instLIBRARIES uninstall-library_includeHEADERS .PRECIOUS: Makefile # 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: cimfomfa-21-361/tingea/alloc.c000066400000000000000000000102301416241612100160650ustar00rootroot00000000000000/* (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ /* include include include include */ /* # if 0 # include "gperftools/tcmalloc.h" # define themalloc tc_malloc # define therealloc tc_realloc # define thefree tc_free # else # endif */ # define themalloc malloc # define therealloc realloc # define thefree free #include #include #include #include "alloc.h" #include "err.h" static dim mcx_alloc_maxchunksize = 1048576; static long mcx_alloc_maxtimes = -1; static mcxbool mcx_alloc_limit = FALSE; void mcxAllocLimits ( long maxchunksize , long maxtimes ) { if (maxchunksize > 0) mcx_alloc_maxchunksize = maxchunksize ; if (maxtimes > 0) mcx_alloc_maxtimes = maxtimes ; mcx_alloc_limit = TRUE; ; } void* mcxRealloc ( void* object , dim new_size , mcxOnFail ON_FAIL ) { void* mblock = NULL ; mcxstatus status = STATUS_OK ; const char* me = "mcxRealloc" ; if (!new_size) { if (object) mcxFree(object) ; } else { if ( mcx_alloc_limit && (!mcx_alloc_maxtimes-- || new_size > mcx_alloc_maxchunksize) ) mblock = NULL ; else mblock = object ? therealloc(object, new_size) : themalloc(new_size) ; } if (new_size && (!mblock)) mcxMemDenied(stderr, me, "byte", new_size) , status = 1 ; if (status) { const char* tin = getenv("TINGEA_MEM_SIGNAL") ; if (tin) { unsigned tintin = atoi(tin) ; raise(tintin ? tintin : SIGSEGV) ; } if (ON_FAIL == SLEEP_ON_FAIL) { mcxTell(me, "pid %ld, entering sleep mode", (long) getpid()) ; while(1) sleep(1000) ; } if (ON_FAIL == EXIT_ON_FAIL || ON_FAIL == ENQUIRE_ON_FAIL) { mcxTell(me, "going down") ; if (ON_FAIL == ENQUIRE_ON_FAIL) mcxTell(me, "ENQUIRE fail mode ignored") ; exit(1) ; } } return mblock ; } void mcxNFree ( void* base , dim n_elem , dim elem_size , void (*obRelease) (void *) ) { if (n_elem && obRelease) { char *ob = base ; while (n_elem-- > 0) obRelease(ob) , ob += elem_size ; } mcxFree(base) ; } void* mcxNAlloc ( dim n_elem , dim elem_size , void* (*obInit) (void *) , mcxOnFail ON_FAIL ) { return mcxNRealloc(NULL, n_elem, 0, elem_size, obInit, ON_FAIL) ; } void* mcxNRealloc ( void* mem , dim n_elem , dim n_elem_prev , dim elem_size , void* (*obInit) (void *) , mcxOnFail ON_FAIL ) { char* ob ; mem = mcxRealloc(mem, n_elem * elem_size, ON_FAIL) ; if (!mem) return NULL ; if (obInit && n_elem > n_elem_prev) { ob = ((char*) mem) + (elem_size * n_elem_prev) ; while (n_elem-- > n_elem_prev) /* careful with unsignedness */ { obInit(ob) ; ob += elem_size ; } } return mem ; } void mcxMemDenied ( FILE* channel , const char* requestee , const char* unittype , dim n ) { mcxErrf ( channel , requestee , "memory shortage: could not alloc [%lu] instances of [%s]" , (ulong) n , unittype ) ; } void mcxFree ( void* object ) { if (object) thefree(object) ; } void* mcxAlloc ( dim size , mcxOnFail ON_FAIL ) { return mcxRealloc(NULL, size, ON_FAIL) ; } cimfomfa-21-361/tingea/alloc.h000066400000000000000000000036531416241612100161050ustar00rootroot00000000000000/* (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_alloc_h #define tingea_alloc_h #include /* ========================================================================= * * * mcxRealloc is notable, for it *frees* memory and returns a NULL pointer * if the newly requested block has size 0. This must be so in order to * allow routines to do their math and housekeeping. If they register the * new block as having 0 bytes, then they need not and must not attempt to * free it thereafter. * * ========================================================================= * */ #include "types.h" void* mcxAlloc ( dim size , mcxOnFail ON_FAIL ) ; void* mcxRealloc ( void* object , dim new_size , mcxOnFail ON_FAIL ) ; void mcxFree ( void* object ) ; void mcxNFree ( void* base , dim n_elem , dim elem_size , void (*obRelease) (void *) ) ; void* mcxNAlloc ( dim n_elem , dim elem_size , void* (*obInit) (void *) , mcxOnFail ON_FAIL ) ; void* mcxNRealloc ( void* mem , dim n_elem , dim n_elem_prev , dim elem_size , void* (*obInit) (void *) , mcxOnFail ON_FAIL ) ; void mcxMemDenied ( FILE* channel , const char* requestee , const char* unittype , dim n ) ; void mcxAllocLimits ( long maxchunksize , long maxtimes ) ; #endif cimfomfa-21-361/tingea/array.c000066400000000000000000000303621416241612100161210ustar00rootroot00000000000000/* (C) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 Stijn van Dongen * (C) Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include #include #include #include #include "array.h" #include "alloc.h" #include "types.h" #include "err.h" #include "minmax.h" mcxstatus mcxSplice ( void* base1pptr , const void* base2ptr , dim size /* size of base1 and base2 members */ , dim *pn_base1 /* # base1 elements currently in use */ , dim *pN_base1 /* # base1 elements for which is malloced */ , ofs O_base1 /* splice relative to this element */ , dim d_base1 /* delete this number of elements */ , dim c_base2 /* number of elements to copy */ ) { char **ppr1 = (char **) base1pptr ; char* dummy ; const char *ptr2 = (const char *) base2ptr ; dim n_base1 = *pn_base1 ; dim N_base1 = *pN_base1 ; dim m_base1 = 0, o_base1 = 0 ; const char *errMsg = "" ; mcxstatus stat = STATUS_FAIL ; do { if (n_base1 > N_base1) { errMsg = "integer arguments not consistent" ; break ; } if (n_base1 + c_base2 < d_base1) { errMsg = "overly deleterious" ; break ; } m_base1 = (n_base1 + c_base2) - d_base1 /* new size */ ; if (O_base1 >= 0) o_base1 = O_base1 ; else { if ((dim) -O_base1 > n_base1 + 1) { errMsg = "offset specification out of bounds" ; break ; } o_base1 = (n_base1 + 1) + O_base1 ; } if (o_base1 > n_base1) { errMsg = "computed splice offset not in bounds" ; break ; } if (*ppr1 == NULL && ptr2 == NULL) { errMsg = "source and destination both void" ; break ; } if (o_base1 + d_base1 > n_base1) { errMsg = "not that many elements to delete" ; break ; } stat = STATUS_OK ; } while (0) ; if (stat != STATUS_OK) { mcxErr("[mcxSplice PBD]", "%s", errMsg) ; mcxErr ( "[mcxSplice PBD]" , "[n1, %lu] [N1, %lu] [o1, %lu] [d1, %lu] [c2, %lu]" , (ulong) n_base1, (ulong) N_base1 , (ulong) O_base1 , (ulong) d_base1, (ulong) c_base2 ) ; return STATUS_FAIL ; } if (m_base1 > N_base1) { if (!(dummy = mcxRealloc(*ppr1, size*m_base1, RETURN_ON_FAIL))) { mcxMemDenied(stderr, "mcxSplice", "void", m_base1) ; return STATUS_FAIL ; } *pN_base1 = N_base1 = m_base1 ; *ppr1 = dummy ; } if (o_base1 < n_base1) memmove ( *ppr1 + size*(o_base1 + c_base2) , *ppr1 + size*(o_base1 + d_base1) , size*(n_base1 - o_base1 - d_base1) ) ; if (c_base2) memcpy ( *ppr1 + size * (o_base1) , ptr2 , size*(c_base2) ) ; *pn_base1 = m_base1 ; return STATUS_OK ; } /* fixme, this implementation looks ugly (nested while). use instead: ; for (offset=1;offsetmempptr = mempptr ; buf->size = size ; buf->n = 0 ; buf->bFinalized = 0 ; buf->factor = 1.41 ; dummy = mcxRealloc ( *usrpptr , n_alloc * size , RETURN_ON_FAIL ) ; if (n_alloc && !dummy) { mcxMemDenied(stderr, "mcxBufInit", "char", n_alloc * size) ; buf->n_alloc = 0 ; return STATUS_FAIL ; } buf->n_alloc = n_alloc ; *usrpptr = dummy ; return STATUS_OK ; } void* mcxBufExtend ( mcxBuf* buf , dim n_request , mcxOnFail ON_FAIL ) { dim oldsize = buf->n ; char **usrpptr = (char **) buf->mempptr ; char* dummy ; if (buf->bFinalized) mcxErr("mcxBufExtend PBD", "extending finalized buffer") ; if (buf->n_alloc < buf->n + n_request) { dim n_new = MCX_MAX ( (dim) (buf->n_alloc * buf->factor + 8) , (dim) (buf->n + n_request) ) ; dummy = mcxRealloc(*usrpptr, n_new * buf->size, ON_FAIL) ; if (n_new && !dummy) { mcxMemDenied(stderr,"mcxBufExtend","char",buf->n*buf->size) ; return NULL ; } buf->n_alloc = n_new ; *usrpptr = dummy ; } buf->n += n_request ; return *usrpptr + (oldsize * buf->size) ; } dim mcxBufFinalize ( mcxBuf* buf ) { char **usrpptr = (char **) buf->mempptr ; char* dummy ; if (buf->bFinalized) mcxErr("mcxBufFinalize PBD", "finalising finalized buffer") ; else buf->bFinalized = 1 ; dummy = mcxRealloc ( *usrpptr , buf->n * buf->size , RETURN_ON_FAIL ) ; if (buf->n && !dummy) { mcxMemDenied(stderr, "mcxBufFinalize", "char", buf->n * buf->size) ; errno = ENOMEM ; return buf->n ; } *usrpptr = dummy ; buf->n_alloc = buf->n ; return buf->n ; } void mcxBufReset ( mcxBuf* buf , void* mempptr ) { if (!buf->bFinalized) mcxErr("mcxBufReset PBD", "buffer not finalized") ; buf->mempptr = mempptr ; buf->n = 0 ; buf->n_alloc = 0 ; buf->bFinalized = 0 ; } /* Return a larger or equal element; the smallest of these. * The result is the minimal element at least as big as pivot. * and a 'ceil' for pivot. */ void* mcxBsearchCeil ( const void *pivot , const void *base , dim nmemb , dim size , int (*cmp)(const void *, const void *) ) { dim lft = -1 /* on purpose; we use wraparound */ ; dim rgt = nmemb ; dim bar = nmemb/2 /* nothing, or nothing that is larger than pivot */ ; if (!nmemb || cmp(pivot, ((char*)base) + (nmemb-1) * size) > 0) return NULL /* invariant: lft points to a * a member that is smaller than pivot or it * points before the first member. */ ; while (lft+1 < rgt) { /* bar is smaller than pivot, move lft inward */ if (cmp(pivot, ((char*) base) + bar*size) > 0) lft = bar /* bar is larger or equal element, move rgt inward */ ; else rgt = bar /* update bar to be the middle of lft and rgt * when lft == -1 this depends on unsigned wraparound. */ ; bar = rgt - (rgt-lft) / 2; ; } return (((char*) base) + bar * size) ; } /* Return a smaller or equal element; the largest of these. * The result is the maximal element not exceeding pivot, * and a 'floor' for pivot. */ void* mcxBsearchFloor ( const void *pivot , const void *base , dim nmemb , dim size , int (*cmp)(const void *, const void *) ) { dim lft = 0 ; dim rgt = nmemb ; dim bar = nmemb / 2 /* nothing, or nothing that is smaller than pivot */ ; if (!nmemb || cmp(pivot, base) < 0) return NULL /* invariant: rgt points to a * a member that is larger than pivot or it * points beyond the last member. */ ; while (lft+1 < rgt) { /* bar is greater than pivot, move right inward */ if (cmp(pivot, ((char*) base) + bar*size) < 0) rgt = bar /* bar is smaller than (or equal to) pivot element, move lft inward */ ; else lft = bar /* update bar to be the middle of lft and rgt */ ; bar = lft + (rgt-lft) / 2; ; } return (((char*) base) + bar * size) ; } /* TODO: compare with std::lower_bound implementation template fwd_it lower_bound(fwd_it first, fwd_it last, const t & val) { typedef typename iterator_traits::difference_type distance; distance len = std::distance(first, last); distance half; fwd_it middle; while (len > 0) { half = len >> 1; middle = first; std::advance(middle, half); if (*middle < val) { first = middle; ++first; len = len - half - 1; } else len = half; } return first; } */ double mcxMedian ( void* base , dim n , dim sz , double (*get)(const void*) , double* iqr ) { double median = 0.0, q1 = 0.0, q2 = 0.0, quant = 0.0 ; if (n > 1) median = (get((char*) base + sz * (n/2)) + get((char*) base+ sz * ((n-1)/2))) / 2.0 ; else if (n == 1) median = get(base) /* p locates the left boundary of quantile, * q locates the right boundary. We need to interpolate * neighbours in case the boundaries don't fall exacly * on integer offsets. In that case pLoffset and rOffset * are different and a weighted mean between them * is computed. */ ; if (n > 1) { dim n3 = 3 * n ; dim pLoffset = n / 4 ; dim pRoffset = pLoffset + 1 ; double pLweight = (4 - (n % 4)) / 4.0 ; double pRweight = 1.0 - pLweight ; dim qRoffset = (n3 - (n3 % 4)) / 4 ; dim qLoffset = qRoffset - 1 ; double qRweight = (n3 % 4) / 4.0 ; double qLweight = 1 - qRweight ; q1 = pLweight * get((char*) base + sz * pLoffset) + pRweight * get((char*) base + sz * pRoffset) ; q2 = qLweight * get((char*) base + sz * qLoffset) + qRweight * get((char*) base + sz * qRoffset) ; quant = q2 - q1 ; if (quant < 0) quant = -quant ; } if (iqr) *iqr = quant ; return median ; } void mcxShuffle ( void* datap , dim nmem , dim mem_size , char* mem_cell /* should have mem_size size */ ) { dim n = nmem ; char* data = datap ; while (n > 0) { unsigned long r = (rand() >> 3) % n /* Fisher-Yates shuffle */ ; if (r != n-1) { memcpy(mem_cell, data + (n-1) * mem_size, mem_size) ; memcpy(data + (n-1) * mem_size, data + r * mem_size, mem_size) ; memcpy(data + r * mem_size, mem_cell, mem_size) ; } n-- ; } } cimfomfa-21-361/tingea/array.h000066400000000000000000000077501416241612100161330ustar00rootroot00000000000000/* (C) Copyright 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_array_h #define tingea_array_h #include "types.h" mcxstatus mcxSplice ( void* base1pp /* _address_ of pointer to elements */ , const void* base2p /* pointer to elements */ , dim size /* size of base1 and base2 members */ , dim *n_base1 /* total length of elements after base1 */ , dim *N_base1 /* number of alloc'ed elements for base1 */ , ofs o_base1 /* splice relative to this ofset */ , dim d_base1 /* delete this number of elements */ , dim c_base2 /* number of elements to copy */ ) ; dim mcxDedup ( void* base , dim nmemb , dim size , int (*cmp)(const void *, const void *) , void (*merge)(void *, const void *) ) ; mcxstatus mcxResize ( void* mempp , dim size , dim* ct , dim newct , mcxOnFail ON_FAIL ) ; /* Return largest element smaller than or equal to key. * return NULL if no element is smaller than key. * Returns rightmost element in case entries sort identically, * (note: mcxBsearchCeil will then return the leftmost element) * * base should be sorted according to cmp */ void* mcxBsearchFloor ( const void *key , const void *base , dim nmemb , dim size , int (*cmp)(const void *, const void *) ) ; /* Return smallest element larger than or equal to key. * return NULL if no element is larger than key. * Returns leftmost element in case entries sort identically, * (note: mcxBsearchFloor will then return the rightmost element) * * base should be sorted according to cmp */ void* mcxBsearchCeil ( const void *key , const void *base , dim nmemb , dim size , int (*cmp)(const void *, const void *) ) ; /* Uses weighted combinations of neighbours when the quartile * range does not fall perfectly on array offsets (i.e. * when the array size is not a multiple of 4. */ double mcxMedian ( void* base , dim n , dim sz , double (*get)(const void*) , double* iqr ) ; /* Fisher Yates shuffle */ void mcxShuffle ( void* datap , dim nmem , dim mem_size , char* mem_cell /* should have mem_size size */ ) ; typedef struct { void* mempptr ; dim size ; dim n ; dim n_alloc ; float factor ; mcxbool bFinalized ; } mcxBuf ; /* * *mempptr should be peekable; NULL or valid memory pointer. */ mcxstatus mcxBufInit ( mcxBuf* buf , void* mempptr , dim size , dim n ) ; /* * Extends the buffer by n_request unitialized chunks and returns a pointer * to this space. It is the caller's responsibility to treat this space * consistently. The counter buf->n is increased by n_request. * * If we cannot extend (realloc), a NULL pointer is returned; * the original space is left intact. * * Returns NULL on (alloc) failure */ void* mcxBufExtend ( mcxBuf* buf , dim n_request , mcxOnFail ON_FAIL ) ; /* * Make superfluous memory reclaimable by system, * prepare for discarding buf (but not *(buf->memptr)!) * * If for some bizarre reason we cannot shrink (realloc), * errno is set to ENOMEM. * the original space is left intact. Its size is in buf->n . */ dim mcxBufFinalize ( mcxBuf* buf ) ; /* * Make buffer refer to a new variable. Size cannot be changed, * so variable should be of same type as before. */ void mcxBufReset ( mcxBuf* buf , void* mempptr ) ; #endif cimfomfa-21-361/tingea/compile.h000066400000000000000000000044641416241612100164440ustar00rootroot00000000000000/* (C) Copyright 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_compile_h #define tingea_compile_h #ifndef TINGEA__TYPED_MINMAX # define TINGEA__TYPED_MINMAX 0 #endif #ifndef __GNUC__ # define MCX_GNUC_OK 0 # define inline /* no inline */ # define cpl__pure /* no pure */ # define cpl__const /* no const */ # define cpl__noreturn /* no noreturn */ # define cpl__malloc /* no malloc */ # define cpl__must_check /* no warn_unused_result */ # define cpl__deprecated /* no deprecated */ # define cpl__used /* no used */ # define cpl__unused /* no unused */ # define cpl__packed /* no packed */ # define likely(x) (x) # define unlikely(x) (x) #else #define MCX_GNUC_OK 1 #if __GNUC__ >= 3 # define inline __inline__ __attribute__ ((always_inline)) # define cpl__pure __attribute__ ((pure)) # define cpl__const __attribute__ ((const)) # define cpl__noreturn __attribute__ ((noreturn)) # define cpl__malloc __attribute__ ((malloc)) # define cpl__must_check __attribute__ ((warn_unused_result)) # define cpl__deprecated __attribute__ ((deprecated)) # define cpl__used __attribute__ ((used)) # define cpl__unused __attribute__ ((unused)) # define cpl__packed __attribute__ ((packed)) # define likely(x) __builtin_expect (!!(x), 1) # define unlikely(x) __builtin_expect (!!(x), 0) #else # define inline /* no inline */ # define cpl__pure /* no pure */ # define cpl__const /* no const */ # define cpl__noreturn /* no noreturn */ # define cpl__malloc /* no malloc */ # define cpl__must_check /* no warn_unused_result */ # define cpl__deprecated /* no deprecated */ # define cpl__used /* no used */ # define cpl__unused /* no unused */ # define cpl__packed /* no packed */ # define likely(x) (x) # define unlikely(x) (x) #endif #endif #endif cimfomfa-21-361/tingea/ding.c000066400000000000000000000226611416241612100157270ustar00rootroot00000000000000/* (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009, 2010, 2011 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include #include #include #include #include #include "ding.h" #include "types.h" #include "alloc.h" #include "minmax.h" char* mcxStrDup ( const char* str ) { return mcxStrNDup(str, strlen(str)) ; } char* mcxStrNDup ( const char* str , dim n ) { char* rts = mcxAlloc(n+1, RETURN_ON_FAIL) ; if (rts) memcpy(rts, str, n) , rts[n] = '\0' ; return rts ; } dim mcxStrCountChar ( const char* p , char c , ofs len ) { const char* z = p ; dim ct = 0 ; z += (len >= 0) ? (dim) len : strlen(p) ; while (p= 0 ? p+offset : p + strlen(p) ; while (--z >= p && !fbool((unsigned char) *z)) ; return (char*) (z >= p ? z : NULL) ; } char* mcxStrRChrAint ( const char* p , int (*fbool)(int c) , ofs offset ) { const char* z = offset >= 0 ? p+offset : p + strlen(p) ; while (--z >= p && fbool((unsigned char) *z)) ; return (char*) (z >= p ? z : NULL) ; } const char* bit8[256] = { "00000000" , "00000001" , "00000010" , "00000011" , "00000100" , "00000101" , "00000110" , "00000111" , "00001000" , "00001001" , "00001010" , "00001011" , "00001100" , "00001101" , "00001110" , "00001111" , "00010000" , "00010001" , "00010010" , "00010011" , "00010100" , "00010101" , "00010110" , "00010111" , "00011000" , "00011001" , "00011010" , "00011011" , "00011100" , "00011101" , "00011110" , "00011111" , "00100000" , "00100001" , "00100010" , "00100011" , "00100100" , "00100101" , "00100110" , "00100111" , "00101000" , "00101001" , "00101010" , "00101011" , "00101100" , "00101101" , "00101110" , "00101111" , "00110000" , "00110001" , "00110010" , "00110011" , "00110100" , "00110101" , "00110110" , "00110111" , "00111000" , "00111001" , "00111010" , "00111011" , "00111100" , "00111101" , "00111110" , "00111111" , "01000000" , "01000001" , "01000010" , "01000011" , "01000100" , "01000101" , "01000110" , "01000111" , "01001000" , "01001001" , "01001010" , "01001011" , "01001100" , "01001101" , "01001110" , "01001111" , "01010000" , "01010001" , "01010010" , "01010011" , "01010100" , "01010101" , "01010110" , "01010111" , "01011000" , "01011001" , "01011010" , "01011011" , "01011100" , "01011101" , "01011110" , "01011111" , "01100000" , "01100001" , "01100010" , "01100011" , "01100100" , "01100101" , "01100110" , "01100111" , "01101000" , "01101001" , "01101010" , "01101011" , "01101100" , "01101101" , "01101110" , "01101111" , "01110000" , "01110001" , "01110010" , "01110011" , "01110100" , "01110101" , "01110110" , "01110111" , "01111000" , "01111001" , "01111010" , "01111011" , "01111100" , "01111101" , "01111110" , "01111111" , "10000000" , "10000001" , "10000010" , "10000011" , "10000100" , "10000101" , "10000110" , "10000111" , "10001000" , "10001001" , "10001010" , "10001011" , "10001100" , "10001101" , "10001110" , "10001111" , "10010000" , "10010001" , "10010010" , "10010011" , "10010100" , "10010101" , "10010110" , "10010111" , "10011000" , "10011001" , "10011010" , "10011011" , "10011100" , "10011101" , "10011110" , "10011111" , "10100000" , "10100001" , "10100010" , "10100011" , "10100100" , "10100101" , "10100110" , "10100111" , "10101000" , "10101001" , "10101010" , "10101011" , "10101100" , "10101101" , "10101110" , "10101111" , "10110000" , "10110001" , "10110010" , "10110011" , "10110100" , "10110101" , "10110110" , "10110111" , "10111000" , "10111001" , "10111010" , "10111011" , "10111100" , "10111101" , "10111110" , "10111111" , "11000000" , "11000001" , "11000010" , "11000011" , "11000100" , "11000101" , "11000110" , "11000111" , "11001000" , "11001001" , "11001010" , "11001011" , "11001100" , "11001101" , "11001110" , "11001111" , "11010000" , "11010001" , "11010010" , "11010011" , "11010100" , "11010101" , "11010110" , "11010111" , "11011000" , "11011001" , "11011010" , "11011011" , "11011100" , "11011101" , "11011110" , "11011111" , "11100000" , "11100001" , "11100010" , "11100011" , "11100100" , "11100101" , "11100110" , "11100111" , "11101000" , "11101001" , "11101010" , "11101011" , "11101100" , "11101101" , "11101110" , "11101111" , "11110000" , "11110001" , "11110010" , "11110011" , "11110100" , "11110101" , "11110110" , "11110111" , "11111000" , "11111001" , "11111010" , "11111011" , "11111100" , "11111101" , "11111110" , "11111111" } ; mcxTing* mcxMemPrint ( mcxTing* ting , void* p , dim n_bytes , mcxbits flags ) { char* m = p ; mcxbool space = !(flags & MCX_MEMPRINT_NOSPACE) ; mcxbool rev = flags & MCX_MEMPRINT_REVERSE ; dim i ; ting = mcxTingEmpty(ting, 32) ; for (i=0;i best) best = TBL(i+1,j+1) ; } *lcs = best ; } free(tbl) ; return min_val ; } int mcxSetenv ( const char* kv ) { mcxTing* tv = mcxTingNew(kv) ; if (!strchr(kv, '=')) mcxTingAppend(tv, "=1") ; return putenv(mcxTinguish(tv)) ; } mcxstatus mcxStrTol ( const char* s , long* value , char** end ) { int errno_sa = errno ; char* e = NULL ; mcxstatus status = STATUS_OK ; errno = 0 ; *value = strtol(s, &e, 10) ; if (errno || e == s) status = STATUS_FAIL ; errno = errno_sa ; if (end) *end = e ; return status ; } mcxstatus mcxStrToul ( const char* s , ulong* value , char** end ) { int errno_sa = errno ; mcxstatus status = STATUS_OK ; char* e = NULL ; errno = 0 ; *value = strtoul(s, &e, 10) ; if (errno || e == s) status = STATUS_FAIL ; errno = errno_sa ; if (end) *end = e ; return status ; } cimfomfa-21-361/tingea/ding.h000066400000000000000000000035101416241612100157240ustar00rootroot00000000000000/* (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009, 2010, 2011 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_ding #define tingea_ding #include #include "types.h" #include "ting.h" char* mcxStrDup ( const char* str ) ; char* mcxStrNDup ( const char* str , dim n ) ; mcxstatus mcxStrTol ( const char* s , long* value , char** end ) ; mcxstatus mcxStrToul ( const char* s , ulong* value , char** end ) ; /* * if len < 0, strlen(p) is used. */ dim mcxStrCountChar ( const char* p , char c , ofs len /* -1 for don't know */ ) ; char* mcxStrChrIs ( const char* src , int (*fbool)(int c) , ofs len /* -1 for don't know */ ) ; char* mcxStrChrAint ( const char* src , int (*fbool)(int c) , ofs len /* -1 for don't know */ ) ; char* mcxStrRChrIs ( const char* src , int (*fbool)(int c) , ofs offset /* -1 for don't know */ ) ; char* mcxStrRChrAint ( const char* src , int (*fbool)(int c) , ofs offset /* -1 for don't know */ ) ; #define MCX_MEMPRINT_REVERSE 1 #define MCX_MEMPRINT_NOSPACE 2 /* Strides in char units, treats/truncates each unit * as/to an 8-bit entity. */ mcxTing* mcxMemPrint ( mcxTing* ting , void* p , dim n_bytes , mcxbits flags ) ; int mcxEditDistance ( const char* s1 , const char* s2 , int* lcs ) ; int mcxSetenv ( const char* kv ) ; #endif cimfomfa-21-361/tingea/equate.c000066400000000000000000000055111416241612100162650ustar00rootroot00000000000000/* (C) Copyright 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include #include "equate.h" int dblCmp ( const void* f1 , const void* f2 ) { return ( *((double*)f1) < *((double*)f2) ? -1 : *((double*)f1) > *((double*)f2) ? 1 : 0 ) ; } int dblRevCmp ( const void* f1 , const void* f2 ) { return ( *((double*)f1) > *((double*)f2) ? 1 : *((double*)f1) < *((double*)f2) ? -1 : 0 ) ; } int fltCmp ( const void* f1 , const void* f2 ) { return ( *((float*)f1) < *((float*)f2) ? -1 : *((float*)f1) > *((float*)f2) ? 1 : 0 ) ; } int fltRevCmp ( const void* f1 , const void* f2 ) { return ( *((float*)f1) > *((float*)f2) ? 1 : *((float*)f1) < *((float*)f2) ? -1 : 0 ) ; } int intCmp ( const void* i1 , const void* i2 ) { return ( *((int*)i1) - *((int*)i2)) ; } int intRevCmp ( const void* i1 , const void* i2 ) { return ( *((int*)i2) - *((int*)i1)) ; } int intnCmp ( const int* i1 , const int* i2 , int n ) { const int* i1max = i1+n ; while (i1 *((int*) i2) ); ; } int intGq ( const void* i1 , const void* i2 ) { return ( *((int*) i1) >= *((int*) i2) ); ; } int fltLt ( const void* f1 , const void* f2 ) { return ( *((float*) f1) < *((float*) f2) ); ; } int fltLq ( const void* f1 , const void* f2 ) { return ( *((float*) f1) <= *((float*) f2) ); ; } int fltGt ( const void* f1 , const void* f2 ) { return ( *((float*) f1) > *((float*) f2) ); ; } int fltGq ( const void* f1 , const void* f2 ) { return ( *((float*) f1) >= *((float*) f2) ); ; } cimfomfa-21-361/tingea/equate.h000066400000000000000000000030231416241612100162660ustar00rootroot00000000000000/* (C) Copyright 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef equate_h #define equate_h int intCmp ( const void* i1 , const void* i2 ) ; int intRevCmp ( const void* i1 , const void* i2 ) ; int intnCmp ( const int* i1 , const int* i2 , int n ) ; int fltCmp ( const void* f1 , const void* f2 ) ; int fltRevCmp ( const void* f1 , const void* f2 ) ; int dblCmp ( const void* f1 , const void* f2 ) ; int dblRevCmp ( const void* f1 , const void* f2 ) ; int intLt ( const void* i1 , const void* i2 ) ; int intLq ( const void* i1 , const void* i2 ) ; int intGt ( const void* i1 , const void* i2 ) ; int intGq ( const void* i1 , const void* i2 ) ; int fltLt ( const void* f1 , const void* f2 ) ; int fltLq ( const void* f1 , const void* f2 ) ; int fltGt ( const void* f1 , const void* f2 ) ; int fltGq ( const void* f1 , const void* f2 ) ; #endif cimfomfa-21-361/tingea/err.c000066400000000000000000000170061416241612100155730ustar00rootroot00000000000000/* (C) Copyright 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include #include #include #include #include #include #include "err.h" #include "types.h" #include "compile.h" /* TODO unify code. */ FILE* mcxLogFILE = NULL; static FILE* mcx_fperr = NULL; static FILE* mcx_fpwarn = NULL; static FILE* mcx_fptell = NULL; mcxbits mcxLogLevel = 0; static void mcx_err_f ( FILE* fp , const char *caller , const char *fmt , va_list *args ) { if (caller) fprintf(fp, "___ [%s] ", caller) ; else fprintf(fp, "___ ") ; vfprintf(fp, fmt, *args) ; fprintf(fp, "\n") ; return ; } void mcxFail ( void ) { while(1) sleep(1000) ; } void mcxDie ( int status , const char* caller , const char* fmt , ... ) { va_list args ; va_start(args, fmt) ; mcx_err_f(stderr, caller, fmt, &args) ; va_end(args) ; mcxExit(status) ; } void mcxExit ( int val ) { exit(val) ; } void mcxErrorFile ( FILE* fp ) { mcx_fperr = fp ; } void mcxTellFile ( FILE* fp ) { mcx_fptell = fp ; } void mcxLogSetFILE ( FILE* fp , mcxbool ENV_LOG ) { mcxLogFILE = fp ; if (ENV_LOG) mcxLogLevelSetByString(getenv("TINGEA_LOG_TAG")) ; } FILE* mcxLogGetFILE ( void ) { return mcxLogFILE ? mcxLogFILE : stderr ; } void mcxWarnFile ( FILE* fp ) { mcx_fpwarn = fp ; } void mcxErrf ( FILE* fp , const char *caller , const char *fmt , ... ) { va_list args ; va_start(args, fmt) ; mcx_err_f(fp, caller, fmt, &args) ; va_end(args) ; } void mcxErr ( const char *caller , const char *fmt , ... ) { FILE* fp = mcx_fperr ? mcx_fperr : stderr ; va_list args ; va_start(args, fmt) ; mcx_err_f(fp, caller, fmt, &args) ; va_end(args) ; } void mcxWarn ( const char *caller , const char *fmt , ... ) { va_list args ; if (caller) fprintf(stderr, "[%s] ", caller) ; va_start(args, fmt) ; vfprintf(stderr, fmt, args) ; fprintf(stderr, "\n") ; va_end(args) ; return ; } static void mcx_write_f ( FILE* fp , const char *caller , const char *fmt , va_list *args , ... ) { if (caller) fprintf(fp, "[%s] ", caller) ; vfprintf(fp, fmt, *args) ; fprintf(fp, "\n") ; return ; } void mcxTellf ( FILE* fp , const char *caller , const char *fmt , ... ) { va_list args ; va_start(args, fmt) ; mcx_write_f(fp, caller, fmt, &args) ; va_end(args) ; } void mcxTell ( const char *caller , const char *fmt , ... ) { FILE* fp = mcx_fptell ? mcx_fptell : stderr ; va_list args ; va_start(args, fmt) ; mcx_write_f(fp, caller, fmt, &args) ; va_end(args) ; } struct mcx_log_class_annotated { int type ; mcxbits class ; mcxbits low ; } ; struct mcx_log_class_annotated mcx_log_class_list[] = { { 'd' , MCX_LOG_DATA , MCX_LOG_DATA0 } , { 'f' , MCX_LOG_FUNC , MCX_LOG_FUNC0 } , { 'g' , MCX_LOG_GAUGE , MCX_LOG_GAUGE } , { 'i' , MCX_LOG_IO , MCX_LOG_IO } , { 'm' , MCX_LOG_MON , MCX_LOG_MON0 } , { 'n' , MCX_LOG_NETWORK , MCX_LOG_NETWORK } , { 'p' , MCX_LOG_IP , MCX_LOG_IP } , { 't' , MCX_LOG_THREAD , MCX_LOG_THREAD } , { 'A' , MCX_LOG_SLOT1 , MCX_LOG_SLOT1 } , { 'B' , MCX_LOG_SLOT2 , MCX_LOG_SLOT2 } , { 'C' , MCX_LOG_SLOT3 , MCX_LOG_SLOT3 } } ; mcxbool mcxLogGet ( mcxbits level_programmer ) { dim i ; mcxbool ok = FALSE ; for (i=0;i= (mcxLogLevel & mcx_log_class_list[i].class)) ) ; if (mcxLogLevel & MCX_LOG_OR) { if (ok) return TRUE ; } else if (!ok) /* AND, implicit or not */ return FALSE ; } return ok ; } void mcxLog2 ( const char* tag , const char* fmt , ... ) { FILE* fp = mcxLogFILE ? mcxLogFILE : stderr ; va_list args ; va_start(args, fmt) ; mcx_write_f(fp, tag, fmt, &args) ; va_end(args) ; } void mcxLog ( mcxbits level_programmer , const char* tag , const char* fmt , ... ) { FILE* fp = mcxLogFILE ? mcxLogFILE : stderr ; va_list args ; mcxbool ok = FALSE ; if (!mcxLogLevel || (mcxLogLevel & MCX_LOG_NULL)) return ; ok = mcxLogGet(level_programmer) ; if (ok) { va_start(args, fmt) ; mcx_write_f(fp, tag, fmt, &args) ; va_end(args) ; } } /* dependency with mcx_level_setnum */ static int mcx_level_parsenum ( int T , int c ) { int r = -1 ; if (c == 'x') r = 0 ; else if (c >= '1' && c <= '9') r = ((int) c) - '0' ; else mcxErr ( "mcxLogLevelSetByString" , "%c axis level [%c] parse error" , (int) T , (int) c ) ; return r ; } /* covers val -1 mcx_level_parsenum case */ static int mcx_level_setnum ( int val , mcxbits CLASS , mcxbits CLASS0 ) { mcxbits new = 0 ; if (val > 0) { new = (1 << (val-1)) * CLASS0 /* below we know that new is simply too high: e.g. new == 6 * but there are only 5 classes. * We then set new to the highest class member */ ; if (!(new & CLASS)) new = CLASS ^ (CLASS >> 1) ^ (CLASS0 >> 1) ; } return new ; } volatile sig_atomic_t mcxLogSigGuard = 0; void mcxLogSig ( int sig ) { mcxLogSigGuard = sig ; } void mcxLogLevelSetByString ( const char* str ) { dim i ; u8 str0 = str ? str[0] : 0 ; if (!str) return ; if (str0 == 'x') mcxLogLevel = 0 ; else if (str0 == '1') mcxLogLevel = MCX_LOG_VERBOSE ; else if (str0 == '8') mcxLogLevel = MCX_LOG_TERSE ; else if (str0 == '9') mcxLogLevel = MCX_LOG_TERSER ; if (strchr(str, 'V')) mcxLogLevel |= MCX_LOG_OR ; if (strchr(str, '#')) mcxLogLevel |= MCX_LOG_NULL ; if (strchr(str, '%')) BIT_OFF(mcxLogLevel, MCX_LOG_NULL) ; for (i=0;i #include #include "types.h" /* Experimental scheme for logging * Contains * Three axes that have scales: * - data 1 2 3 * CELL * LIST * AGGR * - function/code 1 2 3 4 * LINE * FUNCTION * MODULE * APP * - monitoring 1 2 3 4 5 * DEBUG * INFO * WARN * ERR * PANIC * * These scales correspond with * * what (data, what are its parameters) * how (function, what is changing) * pulse (anything) * * Several axes that are radio buttons: * - IO * - Thread * - gauge progress bars * - IP inter (process) * - SLOT1 custom * - SLOT2 custom * - SLOT3 custom * * The programmer associates one or more logging levels with a logging * statement. The user sets logging levels in terms of quietness. * Quietness is quantified as shown in the list below. It may be applied * to a single axis or to several axes simultaneously. * * x is silent * 5 is tersest monitoring level * 4 is tersest function/code level * 3 is tersest data level * 9 is tersest level possible, may exceed actual upper bound * 1 is yappiest level. * * Only those statements for which the quiet level is quieter than the * user-specified level will be printed. If the programmer combines several * axes generally all the corresponding levels are checked and all have to be * OK, unless the user has specified that she is happy if at least one level is * OK. This is done by including a literal 'V' in the MCXLOGTAG string or in * the corresponding command-line option (usually -q). * * MCXLOGTAG is of the following form: * * []<[dfgimstABC][0-9]>+[V] * * The optional is one of [19x] as described above. The rest are * pairs consisting of an indicator * * d data * f function * g gauge/progress * i IO * m monitoring * n network * t thread * A custom axis 1 * B custom axis 1 * C custom axis 1 * * followed by a level. Each indicator specifies an axis; each axis has its * own scale and number of steps on the scale (see above). Finally, a 'V' * occurring anywhere signifies that OR logic is applied to loggin clauses * rather than AND logic. * * The lead tag sets a logging level for all axes simultaneously as follows: * 1 MCX_LOG_ALL * 9 MCX_LOG_TERSER * 8 MCX_LOG_TERSE * x MCX_LOG_NONE */ extern mcxbits mcxLogLevel; /* When called this one optionally checks environment variable * MCXLOGTAG to set the logging levels mcxLogLevelSetByString */ void mcxLogSetFILE ( FILE* fp , mcxbool ENV_LOG ) ; /* When writing to this file embed the print statement in an if statement * that checks whether your priority is ok with mcxLogGet. * This is paramount with GAUGE type logging as a GAUGE = x setting * may indicate that the user is logging to a shared stream. */ FILE* mcxLogGetFILE ( void ) ; extern volatile sig_atomic_t mcxLogSigGuard ; void mcxLogSig ( int sig ) ; /* ******************** data */ #define MCX_LOG_CELL 1 << 0 /* node, point, scalar */ #define MCX_LOG_LIST 1 << 1 /* list, tree, hash */ #define MCX_LOG_AGGR 1 << 2 /* everything else */ #define MCX_LOG_DATA (MCX_LOG_CELL | MCX_LOG_LIST | MCX_LOG_AGGR) #define MCX_LOG_DATA0 MCX_LOG_CELL /* ******************** function */ #define MCX_LOG_LINE 1u << 3 #define MCX_LOG_FUNCTION 1u << 4 #define MCX_LOG_MODULE 1u << 5 #define MCX_LOG_APP 1u << 6 #define MCX_LOG_FUNC (MCX_LOG_LINE | MCX_LOG_FUNCTION | MCX_LOG_MODULE | MCX_LOG_APP) #define MCX_LOG_FUNC0 MCX_LOG_LINE /* ******************** monitoring */ #define MCX_LOG_DEBUG 1u << 7 #define MCX_LOG_INFO 1u << 8 #define MCX_LOG_WARN 1u << 9 #define MCX_LOG_ERR 1u << 10 #define MCX_LOG_PANIC 1u << 11 #define MCX_LOG_MON ( MCX_LOG_DEBUG| MCX_LOG_INFO | MCX_LOG_WARN | MCX_LOG_ERR| MCX_LOG_PANIC ) #define MCX_LOG_MON0 MCX_LOG_DEBUG /* ********************* unimodal axes */ #define MCX_LOG_IO 1u << 12 #define MCX_LOG_IP 1u << 13 #define MCX_LOG_THREAD 1u << 15 #define MCX_LOG_NETWORK 1u << 16 #define MCX_LOG_ASPECTS ( MCX_LOG_IO | MCX_LOG_IP | MCX_LOG_THREAD | MCX_LOG_GAUGE | MCX_LOG_NETWORK ) /* ********************* miscellaneous*/ #define MCX_LOG_GAUGE 1u << 17 /* ********************* control */ #define MCX_LOG_AND 1u << 18 #define MCX_LOG_OR 1u << 19 #define MCX_LOG_NULL 1u << 20 /* turns of logging */ /* ********************* unspecified */ #define MCX_LOG_SLOT1 1u << 22 #define MCX_LOG_SLOT2 1u << 22 #define MCX_LOG_SLOT3 1u << 23 #define MCX_LOG_SLOT ( MCX_LOG_SLOT1 | MCX_LOG_SLOT2 | MCX_LOG_SLOT3 ) /* ********************* all / terse */ #define MCX_LOG_NONE 0 #define MCX_LOG_VERBOSE ( MCX_LOG_CELL | MCX_LOG_LINE | MCX_LOG_DEBUG | MCX_LOG_SLOT | MCX_LOG_ASPECTS ) #define MCX_LOG_TERSER ( MCX_LOG_PANIC | MCX_LOG_AGGR | MCX_LOG_APP ) #define MCX_LOG_TERSE ( MCX_LOG_TERSER | MCX_LOG_ASPECTS ) #define MCX_LOG_UNIVERSE ( MCX_LOG_DATA | MCX_LOG_FUNC | MCX_LOG_MON | MCX_LOG_SLOT | MCX_LOG_ASPECTS ) /* ********************* unused */ #define MCX_LOG_UNUSED 1u << 24 void mcxLogLevelSetByString ( const char* str ) ; void mcxLog ( mcxbits level_programmer , const char* tag , const char* fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))) #endif ; mcxbool mcxLogGet ( mcxbits level_programmer ) ; void mcxLog2 ( const char* tag , const char* fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; void mcxTell ( const char *caller , const char *fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; void mcxTellf ( FILE* fp , const char *caller , const char *fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))) #endif ; void mcxWarn ( const char *caller , const char *fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; void mcxErr ( const char *caller , const char *fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; void mcxErrf ( FILE* fp , const char *caller , const char *fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))) #endif ; void mcxDie ( int status , const char *caller , const char *fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))) #endif ; void mcxTellFile ( FILE* fp ) ; void mcxWarnFile ( FILE* fp ) ; void mcxErrorFile ( FILE* fp ) ; void mcxFail ( void ) ; void mcxExit ( int val ) ; #endif cimfomfa-21-361/tingea/getpagesize.h000066400000000000000000000015401416241612100173130ustar00rootroot00000000000000/* Emulate getpagesize on systems that lack it. */ #ifndef HAVE_GETPAGESIZE #if !defined getpagesize && defined __BEOS__ # include # define getpagesize() B_PAGE_SIZE #endif #ifdef HAVE_UNISTD_H # include #endif #if !defined getpagesize && defined _SC_PAGESIZE # if !(defined VMS && __VMS_VER < 70000000) # define getpagesize() sysconf (_SC_PAGESIZE) # endif #endif #if !defined getpagesize && defined VMS # ifdef __ALPHA # define getpagesize() 8192 # else # define getpagesize() 512 # endif #endif #ifndef getpagesize # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else # ifdef NBPG # ifndef CLSIZE # define CLSIZE 1 # endif # define getpagesize() (NBPG * CLSIZE) # else # ifdef NBPC # define getpagesize() NBPC # endif # endif # endif #endif #endif /* not HAVE_GETPAGESIZE */ cimfomfa-21-361/tingea/gralloc.c000066400000000000000000000077751416241612100164420ustar00rootroot00000000000000/* (c) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include "alloc.h" #include "gralloc.h" /* TODO * calloc stuff. * implement arithmetic capacity strategy. */ #define DEBUG 0 typedef struct memnext { struct memnext* next ; } memnext ; /* future idea; use higher bita as perbytage style coefficients. duh. */ #define n1(grim) ((grim->flags >> 16) & 0xFF) #define n2(grim) ((grim->flags >> 24) & 0xFF) typedef struct grim_buf { char* units /* n_units * (sizeof(memnext) + sz_unit) */ ; dim n_units /* number of units available for this struct */ ; struct grim_buf* prev ; } grim_buf ; struct mcxGrim { grim_buf* buf ; dim sz_unit /* size of one unit */ ; memnext* na /* next available */ ; dim ct /* number in use */ ; mcxbits flags /* allocation strategy, numbers */ ; } ; static grim_buf* grim_buf_new ( dim sz_unit , dim n_units ) { dim i ; grim_buf* buf ; char* units ; dim sz_load = sizeof(memnext) + sz_unit ; if (!(buf = mcxAlloc(sizeof(grim_buf), RETURN_ON_FAIL))) return NULL ; if ( !(buf->units = units = mcxAlloc(n_units * sz_load, RETURN_ON_FAIL) ) ) { mcxFree(buf) ; return NULL ; } buf->prev = NULL ; buf->n_units = n_units #if DEBUG ; fprintf (stderr, "Extending grim with <%lu> units\n", (ulong) n_units); #endif ; for (i=0;inext = (memnext*) (units + (i+1) * sz_load) ; ((memnext*) (buf->units + (n_units-1) * sz_load))->next = NULL ; return buf ; } mcxGrim* mcxGrimNew ( dim sz_unit , dim n_units , mcxbits options ) { mcxGrim* src = mcxAlloc(sizeof(mcxGrim), RETURN_ON_FAIL) ; if (!src) return NULL ; if (!(src->buf = grim_buf_new(sz_unit, n_units))) { mcxFree(src) ; return NULL ; } src->buf->prev = NULL ; src->flags = options ; src->na = (void*) src->buf->units ; src->ct = 0 ; src->sz_unit = sz_unit ; return src ; } dim mcxGrimMemSize ( mcxGrim* src ) { grim_buf *buf = src->buf, *this = buf->prev ; dim n = buf->n_units ; while (this) n += this->n_units , this = this->prev ; return n ; } static mcxbool mcx_grim_extend ( mcxGrim* src ) { grim_buf* prevbuf = src->buf->prev ; dim n_units = prevbuf ? 2 * prevbuf->n_units : src->buf->n_units #if DEBUG ; dim t = mcxGrimMemSize(src) ; fprintf(stderr, "have %lu units\n", (ulong) t) #endif ; grim_buf* newbuf = grim_buf_new(src->sz_unit, n_units) ; if (!newbuf) return FALSE ; newbuf->prev = src->buf->prev ; src->buf->prev = newbuf ; src->na = (void*) newbuf->units /* fixme cast */ ; return TRUE ; } void mcxGrimFree ( mcxGrim** srcp ) { grim_buf *this = (*srcp)->buf ; while (this) { grim_buf* tmp = this->prev ; mcxFree(this->units) ; mcxFree(this) ; this = tmp ; } mcxFree(*srcp) ; *srcp = NULL ; } void mcxGrimLet ( mcxGrim* src , void* mem ) { memnext* na = (void*) ((char*) mem - sizeof(memnext)) ; na->next = src->na ; src->na = na ; src->ct-- ; } void* mcxGrimGet ( mcxGrim* src ) { void* mem ; if (!src->na && !mcx_grim_extend(src)) return NULL ; mem = ((char*) src->na) + sizeof(memnext) ; src->na = src->na->next ; src->ct++ ; return mem ; } dim mcxGrimCount ( mcxGrim* src ) { return src->ct ; } cimfomfa-21-361/tingea/gralloc.h000066400000000000000000000016721416241612100164350ustar00rootroot00000000000000/* (C) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_gralloc_h #define tingea_gralloc_h #include "types.h" /* * gralloc; grid memory allocation; allocation of equally sized chunks */ typedef struct mcxGrim mcxGrim; #define MCX_GRIM_GEOMETRIC 1 #define MCX_GRIM_ARITHMETIC 2 mcxGrim* mcxGrimNew ( dim sz_unit , dim n_units /* initial capacity */ , mcxbits options ) ; void* mcxGrimGet ( mcxGrim* src ) ; void mcxGrimLet ( mcxGrim* src , void* mem ) ; dim mcxGrimCount ( mcxGrim* src ) ; dim mcxGrimMemSize ( mcxGrim* src ) ; void mcxGrimFree ( mcxGrim** src ) ; #endif cimfomfa-21-361/tingea/hash.c000066400000000000000000000630451416241612100157320ustar00rootroot00000000000000/* (C) Copyright 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009, 2010 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ /* TODO (?) * * integer overflow handling. * * better bucket fill statistics. * * nested hashes. * could lump * options cmp hash src_link * into a structure and make hashes share them. */ #include #include #include #include #include #include "hash.h" #include "minmax.h" #include "types.h" #include "inttypes.h" #include "ting.h" #include "err.h" #include "alloc.h" #include "gralloc.h" #include "compile.h" #include "list.h" /* the distribution of bit counts over all 32-bit keys */ int promilles[32] = { 0, 0, 0, 0, 0, 0, 0, 0 , 2, 7, 15, 30, 53, 81,110,131 ,140,131,110, 81, 53, 30, 15, 7 , 2, 0, 0, 0, 0, 0, 0, 0 } ; #ifndef TINGEA_HASH_CACHE # define TINGEA_HASH_CACHE 0 #endif typedef struct hash_link { struct hash_link* next ; mcxKV kv #if TINGEA_HASH_CACHE ; u32 hv #endif ; } hash_link ; typedef struct bucket { hash_link* base ; } mcx_bucket ; /* For further optimization work, options * options * load * cmp * hash * src_link * can be shared between different hashes (e.g. * with multidimensional hashes). Consider * making src_link file static variable. */ struct mcxHash { dim n_buckets /* 2^n_bits */ ; mcx_bucket *buckets ; dim n_entries ; mcxbits options ; int (*cmp) (const void *a, const void *b) ; u32 (*hash) (const void *a) ; mcxGrim* src_link ; float load ; } ; struct mcxHashWalk { mcxHash* hash ; dim i_bucket ; hash_link* link ; } ; static void* mcx_bucket_init ( void* buck ) { ((mcx_bucket*) buck)->base = NULL ; return NULL ; } void bitprint ( u32 key , FILE* fp ) ; int bitcount ( u32 key ) ; mcxHash* mcxHashNew ( dim n_buckets , u32 (*hash)(const void *a) , int (*cmp) (const void *a, const void *b) ) { mcxHash *h ; mcxbool ok = FALSE ; u8 n_bits = 0 ; if (!n_buckets) { mcxErr("mcxHashNew strange", "void alloc request") ; n_buckets = 2 ; } if (!(h = mcxAlloc(sizeof(mcxHash), RETURN_ON_FAIL))) return NULL ; while(n_buckets) { n_buckets >>= 1 ; n_bits++ ; } h->load = 0.5 ; h->n_entries = 0 ; h->n_buckets = n_buckets = (1 << n_bits) ; h->cmp = cmp ; h->hash = hash ; h->options = MCX_HASH_OPT_DEFAULTS ; h->src_link = NULL ; while (1) /* fixme 2nd arg below, have better choice? */ { h->src_link = mcxGrimNew(sizeof(hash_link), h->n_buckets, MCX_GRIM_ARITHMETIC) ; if (!h->src_link) break ; if (! ( h->buckets = mcxNAlloc ( h->n_buckets , sizeof(mcx_bucket) , mcx_bucket_init , RETURN_ON_FAIL ) ) ) break ; ok = TRUE ; break ; } if (!ok) { mcxGrimFree(&(h->src_link)) ; mcxFree(h) ; return NULL ; } return h ; } dim mcxHashMemSize ( mcxHash* hash ) { return mcxGrimMemSize(hash->src_link) + sizeof(mcx_bucket) * hash->n_buckets ; } void mcxHashGetSettings ( mcxHash* hash , mcxHashSettings* settings ) { settings->n_buckets = hash->n_buckets ; settings->load = hash->load ; settings->n_entries = hash->n_entries ; settings->options = hash->options ; } static dim hash_link_size ( hash_link* link ) { dim s = 0 ; while(link) link = link->next , s++ ; return(s) ; } void mcxHashStats ( FILE* fp , mcxHash* h ) { dim buckets = h->n_buckets ; dim buckets_used = 0 ; float ctr = 0.0 ; float cb = 0.0 ; dim max = 0 ; dim entries = 0 ; const char* me = "mcxHashStats" ; int j, k, distr[32] ; mcx_bucket *buck ; for (j=0;j<32;j++) distr[j] = 0 ; for (buck=h->buckets; buckbuckets + h->n_buckets; buck++) { dim d = hash_link_size(buck->base) ; hash_link* this= buck->base ; if (d) { buckets_used++ ; entries += d ; ctr += (float) d * d ; cb += (float) d * d * d ; max = MCX_MAX(max, d) ; } while(this) { u32 u = (h->hash)(this->kv.key) ; int ct = bitcount(u) ; this = this->next ; distr[ct]++ ;if (0) fprintf(stderr, "bucket [%d] key [%s]\n", (int)d, ((mcxTing*) this->kv.key)->str) ; } } ctr = ctr / MCX_MAX(1, entries) ; cb = sqrt(cb / MCX_MAX(1, entries)) ; if (buckets && buckets_used) mcxTellf ( fp , me , "%4.2f bucket usage (%ld available, %ld used, %ld entries)" , (double) ((double) buckets_used) / buckets , (long) buckets , (long) buckets_used , (long) entries ) , mcxTellf ( fp , me , "bucket average: %.2f, center: %.2f, cube: %.2f, max: %ld" , (double) entries / ((double) buckets_used) , (double) ctr , (double) cb , (long) max ) ; mcxTellf(fp, me, "bit distribution (promilles):") ; fprintf ( fp , " %-37s %s\n" , "Current bit distribution" , "Ideally random distribution" ) ; for (k=0;k<4;k++) { for (j=k*8;j<(k+1)*8;j++) fprintf(fp, "%3.0f ", entries ? (1000 * (float)distr[j]) / entries : 0.0) ; fprintf(fp, " "); ; for (j=k*8;j<(k+1)*8;j++) fprintf(fp, "%3d ", promilles[j]) ; fprintf(fp, "\n") ; } mcxTellf(fp, me, "link count: %ld", (long) (mcxGrimCount(h->src_link))) ; mcxTellf(fp, me, "link mem count: %ld", (long) (mcxGrimMemSize(h->src_link))) ; mcxTellf(fp, me, "done") ; } void mcxHashSetOpts ( mcxHash* h , double load , int options ) { if (options >= 0) h->options |= options /* fixme; are there states in which either of these can be corrupting ? */ ; h->load = load ; } void mcxHashFreeScalar ( void* scalar cpl__unused ) { /* this triggers freeing of kv.key or kv.val */ ; } void mcxHashFree ( mcxHash** hpp , void freekey(void* key) , void freeval(void* key) ) { mcxHash* h = *hpp ; mcx_bucket* buck = h ? h->buckets : NULL ; dim d = h ? h->n_buckets : 0 ; if (!h) return ; if (freekey || freeval) { while (d-- > 0) /* careful with unsignedness */ { hash_link* link = (buck++)->base ; while(link) { void* key = link->kv.key ; void* val = link->kv.val ; if (freekey && key) freekey(key) , mcxFree(key) ; if (freeval && val) freeval(val) , mcxFree(val) ; link = link->next ; } } } mcxGrimFree(&h->src_link) ; mcxFree(h->buckets) ; mcxFree(h) ; *hpp = NULL ; } #define MCX_HASH_DOUBLING MCX_HASH_OPT_UNUSED #if TINGEA_HASH_CACHE static hash_link* mcx_bucket_search ( mcxHash* h , void* ob , mcxmode ACTION , u32* hashval ) { u32 thishash = hashval ? *hashval : (h->hash)(ob) ; mcx_bucket *buck = h->buckets + (thishash & (h->n_buckets-1)) ; hash_link* link = buck->base, *prev = NULL, *new ; int delta = 0 ; while ( link && ( link->hv != thishash || h->cmp(ob, link->kv.key) ) ) prev = link , link = link->next ; if (link && ACTION == MCX_DATUM_DELETE) { if (buck->base == link) buck->base = link->next ; else prev->next = link->next ; delta = -1 ; mcxGrimLet(h->src_link, link) /* we return link below though */ ; } else if (!link) { if (ACTION == MCX_DATUM_FIND || ACTION == MCX_DATUM_DELETE) link = NULL ; else if (ACTION == MCX_DATUM_INSERT) { new = mcxGrimGet(h->src_link) /* fixme could be NULL */ ; new->next = NULL ; new->kv.val = NULL ; new->kv.key = ob ; new->hv = thishash ; if (!buck->base) buck->base = new /* in TINGEA_HASH_CACHE case we always append */ ; else new->next = prev->next , prev->next = new ; delta = 1 ; link = new ; } } h->n_entries += delta ; return link ; } #else static hash_link* mcx_bucket_search ( mcxHash* h , void* ob , mcxmode ACTION , u32* hashval ) { u32 thishash = hashval ? *hashval : (h->hash)(ob) ; mcx_bucket *buck = h->buckets + (thishash & (h->n_buckets-1)) ; hash_link* link = buck->base, *prev = NULL, *new ; int c = 1 ; int delta = 0 ; while ( link && (c = h->cmp(ob, link->kv.key)) > 0 ) prev = link , link = link->next ; if (!c && ACTION == MCX_DATUM_DELETE) { if (buck->base == link) buck->base = link->next ; else prev->next = link->next ; delta = -1 ; mcxGrimLet(h->src_link, link) /* we return link below though */ ; } else if (!link || c < 0) { if (ACTION == MCX_DATUM_FIND || ACTION == MCX_DATUM_DELETE) link = NULL ; else if (ACTION == MCX_DATUM_INSERT) { new = mcxGrimGet(h->src_link) /* fixme could be NULL */ ; new->next = NULL ; new->kv.val = NULL ; new->kv.key = ob ; if (!buck->base) buck->base = new ; else if (link == buck->base) new->next = buck->base , buck->base = new ; else new->next = prev->next , prev->next = new ; delta = 1 ; link = new ; } } h->n_entries += delta ; return link ; } #endif static mcxstatus mcx_hash_double ( mcxHash* h ) ; mcxKV* mcxHashSearchx ( void* key , mcxHash* h , mcxmode ACTION , int* delta ) { hash_link *link ; dim n_entries = h->n_entries ; if ( h->load * h->n_buckets < h->n_entries && !(h->options & (MCX_HASH_OPT_CONSTANT | MCX_HASH_DOUBLING)) && mcx_hash_double(h) ) mcxErr("mcxHashSearch", "cannot double hash") ; link = mcx_bucket_search(h, key, ACTION, NULL) ; if (delta) *delta = h->n_entries < n_entries ? -1 : (int) (h->n_entries - n_entries) ; return link ? &link->kv : NULL ; } enum { ARRAY_OF_KEY , ARRAY_OF_KV } ; void mcxHashApply ( mcxHash* hash , void (*cb)(const void* key, void* val, void* data) , void* data ) { mcxHashWalk* walk = mcxHashWalkInit(hash) ; mcxKV* kv ; dim i_bucket ; while ((kv = mcxHashWalkStep(walk, &i_bucket))) cb(kv->key, kv->val, data) ; mcxHashWalkFree(&walk) ; } static void** hash_array ( mcxHash* hash , dim* n_entries , int (*cmp)(const void*, const void*) , mcxbits opts cpl__unused , mcxenum mode ) { void** obs = mcxAlloc(sizeof(void*) * hash->n_entries, RETURN_ON_FAIL) ; dim d = 0 ; mcxKV* kv ; const char* me = mode == ARRAY_OF_KEY ? "mcxHashKeys" : "mcxHashKVs" ; mcxHashWalk* walk = mcxHashWalkInit(hash) ; if (!walk || !obs) return NULL ; while ((kv = mcxHashWalkStep(walk, NULL))) /* fixme extract */ { if (d >= hash->n_entries) { mcxErr ( me , "PANIC inconsistent state (n_entries %ld)" , (long) hash->n_entries ) ; break ; } obs[d] = mode == ARRAY_OF_KEY ? kv->key : kv ; d++ ; } if (d != hash->n_entries) mcxErr(me, "PANIC inconsistent state (n_entries %lu)", (ulong) hash->n_entries) ; if (cmp) qsort(obs, d, sizeof(void*), cmp) ; mcxHashWalkFree(&walk) ; *n_entries = d ; return obs ; } void** mcxHashKeys ( mcxHash* hash , dim* n_entries , int (*cmp)(const void*, const void*) , mcxbits opts /* unused yet */ ) { return hash_array(hash, n_entries, cmp, opts, ARRAY_OF_KEY) ; } void** mcxHashKVs ( mcxHash* hash , dim* n_entries , int (*cmp)(const void*, const void*) , mcxbits opts /* unused yet */ ) { return hash_array(hash, n_entries, cmp, opts, ARRAY_OF_KV) ; } mcxKV* mcxHashWalkStep ( mcxHashWalk *walk , dim *i_bucket ) { hash_link* step = walk->link ; while (!step && ++walk->i_bucket < walk->hash->n_buckets) step = (walk->hash->buckets+walk->i_bucket)->base ; if (step) { walk->link = step->next ; if (i_bucket) *i_bucket = walk->i_bucket ; return &step->kv ; } return NULL ; } mcxHashWalk* mcxHashWalkInit ( mcxHash *h ) { mcxHashWalk* walk = mcxAlloc(sizeof *walk, RETURN_ON_FAIL) ; if (!walk) return NULL ; walk->hash = h ; if (!h || !h->buckets) { mcxFree(walk) ; return NULL ; } walk->i_bucket = 0 ; walk->link = (h->buckets+0)->base ; return walk ; } void mcxHashWalkFree ( mcxHashWalk **walkpp ) { mcxFree(*walkpp) ; *walkpp = NULL ; } mcxHash* mcxHashMerge ( mcxHash* h1 , mcxHash* h2 , mcxHash* hd /* hash destination */ , void* merge(void* val1, void* val2) ) { mcxHash* ha[2] /* hash array */ ; mcxHash* h ; int i ; if (!h1 || !h2) mcxDie(1, "mcxHashMerge FATAL", "clone functionality not yet supported") /* * fixme/note I am comparing fie pointers here, is that ok? */ ; if (h1->hash != h2->hash || h1->cmp != h2->cmp) mcxErr("mcxHashMerge WARNING", "non matching hash or cmp fie") ; if (merge) mcxErr("mcxHashMerge WARNING", "merge functionality not yet supported") ; hd = hd ? hd : mcxHashNew ( h1->n_entries + h2->n_entries , h1->hash , h1->cmp ) ; if (!hd) return NULL ; ha[0] = h1 ; ha[1] = h2 ; for (i=0;i<2;i++) { h = ha[i] ; if (h != hd) { mcx_bucket* buck ; for (buck = h->buckets; buckbuckets + h->n_buckets; buck++) { hash_link* this = buck->base ; while(this) { mcxKV* kv = mcxHashSearch(this->kv.key, hd, MCX_DATUM_INSERT) ; if (!kv) return NULL /* note/fixme: cannot free hd, don't have key/val free functions */ ; if (!kv->val) kv->val = this->kv.val ; this = this->next ; } } } } return hd ; } static mcxstatus mcx_hash_double ( mcxHash* h ) { mcx_bucket* ole_bucket = h->buckets ; mcx_bucket* ole_buckets = h->buckets ; dim d = h->n_buckets ; dim n_fail = 0 ; if (h->options & MCX_HASH_DOUBLING) /* called before */ { mcxErr("mcx_hash_double PANIC", "double trouble") ; return STATUS_FAIL ; } h->options |= MCX_HASH_DOUBLING ; if (! ( h->buckets = mcxNAlloc ( 2 * h->n_buckets , sizeof(mcx_bucket) , mcx_bucket_init , RETURN_ON_FAIL ) ) ) { h->options ^= MCX_HASH_DOUBLING ; h->buckets = ole_buckets ; return STATUS_FAIL ; } h->n_buckets *= 2 ; h->n_entries = 0 ; while(d-- > 0) /* careful with unsignedness */ { hash_link* this = ole_bucket->base ; while(this) { hash_link* next = this->next, *clone ; void* val = this->kv.val ; void* key = this->kv.key ; mcxGrimLet(h->src_link, this) /* will be used immediately */ #if TINGEA_HASH_CACHE ; clone = mcx_bucket_search(h, key, MCX_DATUM_INSERT, &this->hv) #else ; clone = mcx_bucket_search(h, key, MCX_DATUM_INSERT, NULL) #endif ; if (clone) clone->kv.val = val ; else n_fail++ ; this = next ; } ole_bucket++ ; } if (n_fail) mcxErr ( "mcx_hash_double PANIC" , "<%ld> reinsertion failures in hash with <%ld> entries" , (long) n_fail , (long) h->n_entries ) ; mcxFree(ole_buckets) ; h->options ^= MCX_HASH_DOUBLING ; return STATUS_OK ; } #define BJmix(a,b,c) \ { \ a -= b; a -= c; a ^= (c>>13); \ b -= c; b -= a; b ^= (a<< 8); \ c -= a; c -= b; c ^= (b>>13); \ a -= b; a -= c; a ^= (c>>12); \ b -= c; b -= a; b ^= (a<<16); \ c -= a; c -= b; c ^= (b>> 5); \ a -= b; a -= c; a ^= (c>> 3); \ b -= c; b -= a; b ^= (a<<10); \ c -= a; c -= b; c ^= (b>>15); \ } /* * Thomas Wang says Robert Jenkins says this is a good integer hash function: *unsigned int inthash(unsigned int key) *{ * key += (key << 12); * key ^= (key >> 22); * key += (key << 4); * key ^= (key >> 9); * key += (key << 10); * key ^= (key >> 2); * key += (key << 7); * key ^= (key >> 12); * return key; *} */ /* created by Bob Jenkins */ u32 mcxBJhash ( register const void* key , register u32 len ) { register u32 a, b, c, l ; const char* k = key ; l = len ; a = b = 0x9e3779b9u ; c = 0xabcdef01u ; while (l >= 12) { a += k[0] + (k[1]<<8) + (k[2]<<16) + (k[3]<<24) ; b += k[4] + (k[5]<<8) + (k[6]<<16) + (k[7]<<24) ; c += k[8] + (k[9]<<8) + (k[10]<<16)+ (k[11]<<24) ; BJmix(a,b,c) ; k += 12 ; l -= 12 ; } c += len ; switch(l) /* all the case statements fall through */ { case 11: c+= k[10]<<24 ; // fall through case 10: c+= k[9]<<16 ; // fall through case 9 : c+= k[8]<<8 ; // fall through /* the first byte of c is reserved for the length */ case 8 : b+= k[7]<<24 ; // fall through case 7 : b+= k[6]<<16 ; // fall through case 6 : b+= k[5]<<8 ; // fall through case 5 : b+= k[4] ; // fall through case 4 : a+= k[3]<<24 ; // fall through case 3 : a+= k[2]<<16 ; // fall through case 2 : a+= k[1]<<8 ; // fall through case 1 : a+= k[0] ; /* case 0: nothing left to add */ ; } BJmix(a,b,c) ; return c ; } /* created by Chris Torek */ u32 mcxCThash ( const void *key , u32 len ) #define ctHASH4a h = (h << 5) - h + *k++; #define ctHASH4b h = (h << 5) + h + *k++; #define ctHASH4 ctHASH4b { u32 h = 0 ; const unsigned char *k = key ; if (len > 0) { unsigned loop = (len + 8 - 1) >> 3 /* loop >= 1 */ ; switch (len & (8 - 1)) { case 0: do { /* All fall through */ ctHASH4 // fall through case 7: ctHASH4 // fall through case 6: ctHASH4 // fall through case 5: ctHASH4 // fall through case 4: ctHASH4 // fall through case 3: ctHASH4 // fall through case 2: ctHASH4 // fall through case 1: ctHASH4 } while (--loop) /* unsignedcmpok */ ; } } ; return h ; } /* All 3 hash fies below play on a similar theme. Interesting: as long as only * << >> and ^ are used, a hash function does a partial homogeneous fill of all * 2^k different strings of length k built out of two distinct characters -- * not all buckets need be used. E.g. for k=15, such a hash function might fill * 2^13 buckets with 4 entries each, or it might fill 2^10 buckets with 32 * entries each. This was observed, not proven. */ u32 mcxSvDhash ( const void *key , u32 len ) { u32 h = 0x7cabd53e /* 0x7cabd53e */ ; const char* k = key ; h = 0x0180244a ; while (len--) { u32 g = *k ; u32 gc = 0xff ^ g ; u32 hc = 0xffffffffu ; hc ^= h ; h = ( (h << 2) + h + (h >> 3)) ^ ( (g << 25) + (gc << 18) + (g << 11) + (g << 5) + g ) ; k++ ; } ; return h ; } /* created by me */ u32 mcxSvD2hash ( const void *key , u32 len ) { u32 h = 0x7cabd53e /* 0x7cabd53e */ ; const char* k = key ; while (len--) { u32 g = *k ; u32 gc = 0xff ^ g ; h = ( (h << 3) ^ h ^ (h >> 5) ) ^ ( (g << 25) ^ (gc << 18) ^ (g << 11) ^ (gc << 5) ^ g ) ; k++ ; } ; return h ; } /* created by me */ u32 mcxSvD1hash ( const void *key , u32 len ) { u32 h = 0xeca96537u ; const char* k = key ; while (len--) { u32 g = *k ; h = ( (h << 3) ^ h ^ (h >> 5) ) ^ ( (g << 21) ^ (g << 12) ^ (g << 5) ^ g ) ; k++ ; } ; return h ; } /* created by Daniel Phillips */ u32 mcxDPhash ( const void *key , u32 len ) { u32 h0 = 0x12a3fe2du , h1 = 0x37abe8f9u ; const char* k = key ; while (len--) { u32 h = h1 + (h0 ^ (*k++ * 71523)) ; h1 = h0 ; h0 = h ; } return h0 ; } /* "GNU Emacs" hash (from m4) */ u32 mcxGEhash ( const void* key , u32 len ) { const char* k = key ; u32 hash = 0 ; int t ; while (len--) { if ((t = *k++) >= 0140) t -= 40 ; hash = ((hash << 3) + (hash >> 28) + t) ; } return hash ; } /* Fowler Noll Vo hash */ u32 mcxFNVhash ( const void *buf , u32 len ) { u32 hval = 0x811c9dc5 ; const char *bp = buf ; while (len--) { #if 0 /* other branch supposedly optimizes gcc */ hval *= 0x01000193 #else hval += (hval<<1) + (hval<<4) + (hval<<7) + (hval<<8) + (hval<<24) #endif ; hval ^= *bp++; ; } return hval ; } /* Berkely Database hash */ u32 mcxBDBhash ( const void *key , u32 len ) { const char* k = key ; u32 hash = 0 ; while (len--) { hash = *k++ + (hash << 6) + (hash << 16) - hash ; } return hash ; } /* One at a time hash, Bob Jenkins/Colin Plumb */ u32 mcxOAThash ( const void *key , u32 len ) { const char* k = key ; u32 hash = 0 ; while (len--) { hash += *k++ ; hash += (hash << 10) ; hash ^= (hash >> 6) ; } hash += (hash << 3); ; hash ^= (hash >> 11); ; hash += (hash << 15); ; return hash ; } /* by Dan Bernstein */ u32 mcxDJBhash ( const void *key , u32 len ) { const char* k = key ; u32 hash = 5381 ; while (len--) { hash = *k++ + (hash << 5) + hash ; } return hash ; } /* UNIX ELF hash */ u32 mcxELFhash ( const void *key , u32 len ) { const char* k = key ; u32 hash = 0 ; u32 g ; while (len--) { hash = *k++ + (hash << 4) ; if ((g = (hash & 0xF0000000u))) hash ^= g >> 24 ; hash &= ~g ; } return hash ; } u32 mcxStrHash ( const void* s ) { dim l = strlen(s) ; return(mcxDPhash(s, l)) ; } int mcxStrCmp ( const void* a , const void* b ) { return strcmp(a, b) ; } void bitprint ( u32 key , FILE* fp ) { do { fputc(key & 1 ? '1' : '0', fp) ; } while ((key = key >> 1)) ; } int bitcount ( u32 key ) { int ct = 0 ; do { if (key & 1) ct++ ; } while ((key = key >> 1)) ; return ct ; } #if 0 /* The old legacy hash */ static __u32 dx_hack_hash (const char *name, int len) { __u32 hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9; while (len--) { __u32 hash = hash1 + (hash0 ^ (*name++ * 7152373)); if (hash & 0x80000000) hash -= 0x7fffffff; hash1 = hash0; hash0 = hash; } return (hash0 << 1); } #endif cimfomfa-21-361/tingea/hash.h000066400000000000000000000251671416241612100157420ustar00rootroot00000000000000/* (C) Copyright 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_hash_h #define tingea_hash_h #include /* TODO: * - make sort routines for keys and values by key or value criteria. * - make interface for storing integers, preferably without objectifying them. * - shrink hashes dynamically. * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** Implementation notes (a few). * * * This hash interface is very powerful. It gives you more than enough * rope to hang yourself and then some. It can be used as is, or wrappers * can be made around it that restrict a caller's ability to err. * * The danger lies in the fact that this interface only does retrieval * and storage of pointers (both for keys and values), and does not clone * anything. Anything happening with the objects pointed to during the * lifetime of the hash is the responsibility of the caller. * * What the interface cannot do currently is hash integers by value (rather * than by reference). This functionality will probably be added someday. * Features: * o Searching, inserting, and deletion are all done by * mcxHashSearch. It returns a pointer to mcxKV. In all modes, the * caller can use the returned mcxKV* structure to obtain * the 'val' and 'key' members. * * o Hashes grow automatically once the average load per bucket * exceeds a settable threshold and if the hash was not declared * constant. * * o Caller supplies both the hash function and the compare function. * This interface provides several hash functions operating on a * (void* base, int len) combo, where base is cast to char by the * hash function. These functions can be used in creating custom hash * functions for your custom objects. * * o You can (of course) have multiple hashes. This is not really * a feature - however, since the idiotic does not offer * this I thought I'd mention it. * * o Witness mcxHashWalkInit, mcxHashWalkStep. * * o There is mcxHashMerge. * * o mcxHashKeys, mcxHashKVs. * * Enjoy. * Notes * There is a utility hashfile.c (distributed in a separate package) * that can be used to stress-test this module. It allows customization * of several aspects, including the hash function that should be used. */ #include "types.h" #include "list.h" /* The hash struct is hidden. Use mcxHashGetSettings if you need * to peek into the interior. Or read hash.c */ typedef struct mcxHash mcxHash; typedef struct { void* key ; void* val ; } mcxKV ; mcxHash* mcxHashNew ( dim n_buckets , u32 (*hash) (const void *a) , int (*cmp) (const void *a, const void *b) ) ; #define MCX_HASH_OPT_DEFAULTS 0 #define MCX_HASH_OPT_CONSTANT 1 #define MCX_HASH_OPT_UNUSED 2 void mcxHashSetOpts ( mcxHash* hash , double load , int option /* negative values will be ignored (feature) */ ) ; dim mcxHashMemSize ( mcxHash* hash ) ; typedef struct mcxHashSettings { dim n_buckets ; dim n_entries ; float load ; mcxbits options ; } mcxHashSettings ; void mcxHashGetSettings ( mcxHash* hash , mcxHashSettings* settings ) ; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** mcxHashSearch * * action returns * * MCX_DATUM_DELETE -> deleted mcxKV* or NULL if not present * MCX_DATUM_INSERT -> new or present mcxKV* * MCX_DATUM_FIND -> mcxKV* if present NULL otherwise. * * usage: * * Values have to be inserted by the caller into the returned KV struct. * Make sure that keys point to objects that are constant * (with respect to the cmp function) during the lifetime of the hash. * YOU have to ensure the integrity of both keys and values. * This enables you to do whatever suits you, such as appending to * values. * * When inserting, check whether kv->key != key (where kv is returned value) * if this is the case, an identically comparing key is already present. * You may want to destroy one of the two keys and decide what to do * with the value. * * When deleting, the key-value pair is removed from the hash *AND RETURNED * TO CALLER* - you have to decide yourself what to do with it. You have to * fetch the val and key members of the returned mcxKV object immediately: * Subsequent inserts in the hash may reuse it. If the key was not present, * a value of NULL is returned. * * When finding, life is simple. NULL if absent, matching kv otherwise. * * note: * * memory management of keys and values is totally up to caller. * If usage is clean, you can use mcxHashFree for disposal of hash. */ #define mcxHashSearch(key, hash, ACTION) mcxHashSearchx(key, hash, ACTION, NULL) mcxKV* mcxHashSearchx ( void* key , mcxHash* hash , mcxmode ACTION , int* delta ) ; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** mcxHashMerge * * this one COPIES OBJECT POINTERS and DOES NOT CLONE. * so after the merge, hash1 and hash2 keys and values should not be freed. * In case there are equivalent keys in hash1 and hash2, this may * cause trouble when the caller wants to do cleaning afterwards. * This interface is still under development. * * hashd may be equal to hash1 or hash2, and it may also be NULL. */ mcxHash* mcxHashMerge ( mcxHash* hash1 , mcxHash* hash2 , mcxHash* hashd , void* merge(void* val1, void* val2) ) ; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** mcxHashFree * * This only works if all keys are of the same type and/or all values * are of the same type, and if your objects were created as expected by * the free routines (presumably malloced heap memory) - be careful with * constant objects like constant strings. * * freekey and freeval may not free their argument. This is because * tingea does not allow routines that leave arguments in an * inconsistent state, and free routines in tingea generally accept * an argument of the form ** pptr. * In the case of mcxHashFree this means that the interface may * feel slighly more cumbersome. * A way out would have been to make the callbacks of signature * * void freemem(void** mempp) * * The caller could access *mempp, cast it to the expected type, * and later set *mempp to NULL. However, this would require * new free routines for lots of types. With the current interface * existing Release routines can be used: * * The type of free routine expected by mcxHashFree is generally * called Release or Release_v, e.g. mcxTingRelease. * Release routines release all memory of a composite object except the * memory which holds the outer struct. * * If one of key or val is *not* a composite type or is a composite type * that does not contain malloced memory, use mcxHashFreeScalar. * * Both freekey and freeval may be NULL. When NULL, the corresponding * KV member is not loooked at. This is useful e.g. when hashing objects * owned by someone else. */ void mcxHashFree ( mcxHash** hashpp , void freekey(void* keypp) /* (yourtype1** keypp) */ , void freeval(void* valpp) /* (yourtype2** valpp) */ ) ; void mcxHashFreeScalar ( void* scalar ) ; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * It copies the pointers stored in the hash */ void** mcxHashKeys ( mcxHash* hash , dim* n_entries , int (*cmp)(const void*, const void*) /* works on keys */ , mcxbits opts /* unused yet */ ) ; /* Future options: SORT, SORT_DESC */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * It copies the pointers stored in the hash */ void** mcxHashKVs ( mcxHash* hash , dim* n_entries , int (*cmp)(const void*, const void*) , mcxbits opts /* unused yet */ ) ; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Prints some information to stdout. */ void mcxHashStats ( FILE* fp , mcxHash* hash ) ; typedef struct mcxHashWalk mcxHashWalk; mcxHashWalk* mcxHashWalkInit ( mcxHash *hash ) ; mcxKV* mcxHashWalkStep ( mcxHashWalk* walk , dim *i_bucket ) ; void mcxHashWalkFree ( mcxHashWalk **walkpp ) ; void mcxHashApply ( mcxHash* hash , void (*cb)(const void* key, void* val, void* data) , void* data ) ; /* UNIX ELF hash */ /* POOR! */ u32 mcxELFhash ( const void *key , u32 len ) ; /* created by Bob Jenkins */ u32 mcxBJhash ( const void* key , u32 len ) ; /* One at a time hash, Bob Jenkins/Colin Plumb */ u32 mcxOAThash ( const void *key , u32 len ) ; /* created by Daniel Phillips */ u32 mcxDPhash ( const void* key , u32 len ) ; /* "Berkely Database" hash (from Ozan Yigit's page) */ /* POOR! */ u32 mcxBDBhash ( const void *key , u32 len ) ; /* Dan Bernstein hash (from Ozan Yigit's page) */ u32 mcxDJBhash ( const void *key , u32 len ) ; /* created by Chris Torek */ u32 mcxCThash ( const void* key , u32 len ) ; /* "GNU Emacs" hash (from m4) */ /* not among the best */ u32 mcxGEhash ( const void* key , u32 len ) ; /* Fowler Noll Vo hash */ u32 mcxFNVhash ( const void *buf , u32 len ) ; /* All experimental with weak points. */ u32 mcxSvDhash ( const void *key , u32 len ) ; u32 mcxSvD2hash ( const void *key , u32 len ) ; u32 mcxSvD1hash ( const void *key , u32 len ) ; /* uses mcxDPhash */ u32 mcxStrHash ( const void* s ) ; int mcxStrCmp ( const void* a , const void* b ) ; #endif cimfomfa-21-361/tingea/heap.c000066400000000000000000000061171416241612100157210ustar00rootroot00000000000000/* (C) Copyright 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include #include #include "alloc.h" #include "heap.h" #include "types.h" #include "err.h" mcxHeap* mcxHeapInit ( void* h ) { mcxHeap* heap = h ; if (!heap && !(heap = mcxAlloc(sizeof(mcxHeap), RETURN_ON_FAIL))) return NULL ; heap->base = NULL ; heap->heapSize = 0 ; heap->elemSize = 0 ; heap->cmp = NULL ; heap->n_inserted = 0 ; return heap ; } mcxHeap* mcxHeapNew ( mcxHeap* h , dim heapSize , dim elemSize , int (*cmp) (const void* lft, const void* rgt) ) { mcxHeap* heap = mcxHeapInit(h) ; mcxstatus status = STATUS_FAIL ; char* base ; do { if (!heap) break ; if (!(heap->base = mcxAlloc (heapSize*elemSize, RETURN_ON_FAIL))) break ; status = STATUS_OK ; } while (0) ; if (status) { mcxHeapFree(&heap) ; return NULL ; } heap->heapSize = heapSize ; heap->elemSize = elemSize ; heap->cmp = cmp ; heap->n_inserted = 0 ; base = (char*) heap->base ; return heap ; } void mcxHeapClean ( mcxHeap* heap ) { heap->n_inserted = 0 ; } void mcxHeapRelease ( void* heapv ) { mcxHeap* heap = (mcxHeap*) heapv ; if (heap->base) mcxFree(heap->base) ; heap->base = NULL ; heap->heapSize = 0 ; } void mcxHeapFree ( mcxHeap** heap ) { if (*heap) { if ((*heap)->base) mcxFree((*heap)->base) ; mcxFree(*heap) ; *heap = NULL ; } } void mcxHeapInsert ( mcxHeap* heap , void* elem ) { char* heapRoot = heap->base ; char* elemch = elem ; dim elsz = heap->elemSize ; dim hpsz = heap->heapSize ; int (*cmp)(const void *, const void*) = heap->cmp ; if (heap->n_inserted < hpsz) { dim i = heap->n_inserted ; while (i != 0 && (cmp)(heapRoot+elsz*((i-1)/2), elemch) < 0) { memcpy(heapRoot + i*elsz, heapRoot + elsz*((i-1)/2), elsz) ; i = (i-1)/2 ; } memcpy(heapRoot + i*elsz, elemch, elsz) ; heap->n_inserted++ ; } else if ((cmp)(elemch, heapRoot) < 0) { dim root = 0 ; dim d ; while ((d = 2*root+1) < hpsz) { if ( (d+1 #include #if UINT_MAX >= 4294967295 # define MCX_UINT32 unsigned int # define MCX_INT32 int #else # define MCX_UINT32 unsigned long # define MCX_INT32 long #endif typedef MCX_UINT32 u32 ; /* at least 32 bits */ typedef MCX_INT32 i32 ; /* at least 32 bits */ typedef unsigned char u8 ; /* at least 8 bits */ #define NO_BITS_SET 0 #ifndef ulong # define ulong unsigned long #endif #ifndef uchar # define uchar unsigned char #endif /* dim is garantueed to be an unsigned type. * ofs is garantueed to be the corresponding signed type. */ #if 0 # define dim size_t # define ofs ssize_t #else typedef size_t dim; typedef ssize_t ofs; #endif #ifdef SIZE_MAX # define DIM_MAX SIZE_MAX #else # define DIM_MAX ((size_t)-1) #endif #ifdef SSIZE_MAX # define OFS_MAX SSIZE_MAX #else # define OFS_MAX LONG_MAX /* lame, reasonable stopgap */ #endif #ifdef SSIZE_MIN # define OFS_MIN SSIZE_MIN #else # define OFS_MIN LONG_MIN /* lame, reasonable stopgap */ #endif /* annotate 'unsigned due to prototype' * and related messages */ #define different_sign #define different_width #endif cimfomfa-21-361/tingea/io.c000066400000000000000000000605051416241612100154140ustar00rootroot00000000000000/* (C) Copyright 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #define DEBUG 0 /* NOTE * Very few routines should be allowed to touch buffer. * create/free routines, and step and stepBack. * currently many routines ignore the buffer (but warn * when doing so). * mcxIOtryCookie is currently only one filling buffer. * Conceivably, mcxIOfind could be next. * * TODO * buffering: document, who can initiate it? * buffering: document, which routines are incompatible? * general: remove dependency on ungetc. * make mcxIOreadLine/ mcxIOstep zlib-aware. * mcxIOfind can be made much faster. * - inline fillpatbuf * - get rid of modulus computations - subtract patlen if necessary. * - use buffered input. */ #include #include #include #include #include #include #include #include #include "io.h" #include "types.h" #include "ting.h" #include "ding.h" #include "err.h" #include "alloc.h" #include "compile.h" #include "getpagesize.h" #define inbuffer(xf) (xf->buffer_consumed < xf->buffer->len) static void buffer_empty ( mcxIO* xf ) { mcxTingEmpty(xf->buffer, getpagesize()) /* sets xf->buffer->len to 0 */ ; xf->buffer_consumed = 0 ; } static void buffer_spout ( mcxIO* xf , const char* me ) { mcxErr ( "mcxIO" , "warning: reader %s in file <%s> discards buffered input <%.*s>" , me , xf->fn->str , (int) (xf->buffer->len - xf->buffer_consumed) , xf->buffer->str+xf->buffer_consumed ) ; buffer_empty(xf) ; } static int begets_stdio ( const char* name , const char* mode ) { if ( ( strchr(mode, 'r') && !strcmp(name, "-") ) || ( (strchr(mode, 'w') || strchr(mode, 'a')) && (!strcmp(name, "-") || !strcmp(name, "stderr")) ) ) return 1 ; return 0 ; } static int mcxIOwarnOpenfp ( mcxIO* xf , const char* who ) { if (xf->fp && !xf->stdio) { mcxIOerr(xf, who, "has open file pointer") ; return 1 ; } return 0 ; } mcxstatus mcxIOclose ( mcxIO* xf ) { fflush(xf->fp) ;if (!strcmp(xf->fn->str, "-") && !strcmp(xf->mode, "w") && !xf->stdio) mcxDie(1, "tst", "should not happen") ; if (xf->fp && !xf->stdio) { fclose(xf->fp) ; xf->fp = NULL ; } else if (xf->fp && xf->stdio) { int fe = ferror(xf->fp) /* fixme why not in branch above? */ ; if (fe) mcxErr("mcxIOclose", "error [%d] for [%s] stdio", fe, xf->mode) , perror("mcxIOclose") ; if (xf->ateof || feof(xf->fp)) clearerr(xf->fp) ; } /* fixme contract with usr_reset */ return mcxIOreset(xf) ; } /* note: does not touch all members, notably * usr * fn * mode * fp */ mcxstatus mcxIOreset ( mcxIO* xf ) { xf->lc = 0 ; xf->lo = 0 ; xf->lo_ = 0 ; xf->bc = 0 ; xf->ateof = 0 /* regardless of read/write */ ; buffer_empty(xf) /* xf->fp not touched; promote user care */ ; if (xf->usr && xf->usr_reset) return xf->usr_reset(xf->usr) ; return STATUS_OK ; } void mcxIOerr ( mcxIO* xf , const char *complainer , const char *complaint ) { if (!xf) return ; mcxErr ( complainer , "%s stream <%s> %s" , xf->mode , xf->fn->str , complaint ) ; } mcxIO* mcxIOnew ( const char* str , const char* mode ) { if (!str || !mode) { mcxErr("mcxIOnew PBD", "void string or mode argument") ; return NULL ; } return mcxIOrenew(NULL, str, mode) ; } /* fixme: the code below is mildly muddy. * The ->stdio decision (for new streams) might best be made * at open time? */ mcxIO* mcxIOrenew ( mcxIO* xf , const char* name , const char* mode ) { mcxbool twas_stdio = xf && xf->stdio /* it was one of STD{IN,OUT,ERR} */ ; if ( mode && !strstr(mode, "w") && !strstr(mode, "r") && !strstr(mode, "a") ) { mcxErr ("mcxIOrenew PBD", "unsupported open mode <%s>", mode) ; return NULL ; } if ( getenv("TINGEA_PLUS_APPEND") && ( name && (uchar) name[0] == '+' ) && ( mode && strchr(mode, 'w') ) ) { name++ /* user can specify -o +foo to append to foo */ ; mode = "a" ; } if (!xf) /* case 1) create a new one */ { if (!name || !mode) { mcxErr("mcxIOrenew PBD", "too few arguments") ; return NULL ; } if (!(xf = (mcxIO*) mcxAlloc(sizeof(mcxIO), RETURN_ON_FAIL))) return NULL ; if (!(xf->fn = mcxTingEmpty(NULL, 20))) return NULL ; if (!(xf->buffer = mcxTingEmpty(NULL, getpagesize()))) return NULL ; xf->fp = NULL ; xf->mode = NULL ; xf->usr = NULL ; xf->usr_reset = NULL ; xf->buffer_consumed = 0 ; } else if (xf->stdio) /* case 2) have one, don't close */ NOTHING ; else if (mcxIOwarnOpenfp(xf, "mcxIOrenew")) mcxIOclose(xf) /* case 3) have one, warn and close if open */ ; mcxIOreset(xf) ; if (name && !mcxTingWrite(xf->fn, name)) return NULL ; if (mode) { if (xf->mode) mcxFree(xf->mode) ; xf->mode = mcxStrDup(mode) ; } xf->stdio = begets_stdio(xf->fn->str, xf->mode) /* name changed, no longer stdio */ ; if (twas_stdio && !xf->stdio) xf->fp = NULL ; if (xf->stdio && mode && strchr(mode, 'a')) /* recently added */ { if (xf->mode) mcxFree(xf->mode) ; xf->mode = mcxStrDup("w") ; } return xf ; } mcxstatus mcxIOopen ( mcxIO* xf , mcxOnFail ON_FAIL ) { const char* fname = xf->fn->str ; if (!xf) { mcxErr("mcxIOnew PBD", "received void object") ; if (ON_FAIL == RETURN_ON_FAIL) return STATUS_FAIL ; exit(1) ; } if (mcxIOwarnOpenfp(xf, "mcxIOopen PBD")) return STATUS_OK ; if (!strcmp(fname, "-")) { if (strchr(xf->mode, 'r')) xf->fp = stdin ; else if (strchr(xf->mode, 'w') || strchr(xf->mode, 'a')) xf->fp = stdout ; } else if ( !strcmp(fname, "stderr") && (strchr(xf->mode, 'w') || strchr(xf->mode, 'a')) ) xf->fp = stderr ; else if ((xf->fp = fopen(fname, xf->mode)) == NULL) { if (ON_FAIL == RETURN_ON_FAIL) return STATUS_FAIL ; mcxIOerr(xf, "mcxIOopen", "cannae be opened") ; mcxExit(1) ; } return STATUS_OK ; } mcxstatus mcxIOtestOpen ( mcxIO* xf , mcxOnFail ON_FAIL ) { if (!xf->fp && mcxIOopen(xf, ON_FAIL) != STATUS_OK) { mcxErr ("mcxIO", "cannot open file <%s> in mode %s", xf->fn->str, xf->mode) ; return STATUS_FAIL ; } return STATUS_OK ; } void mcxIOrelease ( mcxIO* xf ) { if (xf) { mcxIOclose(xf) ; if (xf->fn) mcxTingFree(&(xf->fn)) ; if (xf->mode) mcxFree(xf->mode) ; } } mcxstatus mcxIOappendName ( mcxIO* xf , const char* suffix ) { if (xf->fp && !xf->stdio) mcxErr ( "mcxIOappendName PBD" , "stream open while request for name change from <%s> to <%s>" , xf->fn->str , suffix ) ; else if (!mcxTingAppend(xf->fn, suffix)) return STATUS_FAIL ; xf->stdio = begets_stdio(xf->fn->str, "-") ; return STATUS_OK ; } #if 0 mcxstatus mcxIOnewName ( mcxIO* xf , const char* newname ) { if (!mcxTingEmpty(xf->fn, 0)) return STATUS_FAIL ; return mcxIOappendName(xf, newname) ; } #else mcxstatus mcxIOnewName ( mcxIO* xf , const char* newname ) { return mcxIOrenew(xf, newname, NULL) ? STATUS_OK : STATUS_FAIL ; } #endif int mcxIOstepback ( int c , mcxIO* xf ) { if (c == EOF) return EOF ; else { if (inbuffer(xf) && xf->buffer_consumed > 0) c = xf->buffer->str[--xf->buffer_consumed] /* insert a new branch for zlib aware reading here; splice into buffer */ ; else if (ungetc(c, xf->fp) == EOF) { mcxErr ( "mcxIOstepback" , "failed to push back <%d> on stream <%s>\n" , c , xf->fn->str ) ; return EOF ; } xf->bc-- ; if (c == '\n') xf->lc-- , xf->lo = xf->lo_ , xf->lo_ = 0 ; else xf->lo-- ; } return c ; } int mcxIOstep ( mcxIO* xf ) { int c #if 0 ;if (xf->buffer) fprintf(stderr, "buffer [%s]\n", xf->buffer->str) ;else fprintf(stderr, "nobuffer\n") #endif ; if (xf->ateof) c = EOF ; else if (inbuffer(xf)) { c = xf->buffer->str[xf->buffer_consumed++] ; if (!inbuffer(xf)) buffer_empty(xf) ; } else c = fgetc(xf->fp) ; switch(c) { case '\n' : xf->lc++ ; xf->bc++ ; xf->lo_ = xf->lo ; xf->lo = 0 ; break ; case EOF : xf->ateof = 1 ; break ; default : xf->bc++ ; xf->lo++ ; break ; } return c ; } /* fixme todo * * look at bc; substract it from sz (we might have read a part already). * * support growing files. and look at other items in the grep source code. */ mcxstatus mcxIOreadFile ( mcxIO *xf , mcxTing *filetxt ) { struct stat mystat ; size_t sz = 4096 ; ssize_t r ; const char* me = "mcxIOreadFile" ; mcxTingEmpty(filetxt, 0) ; if (inbuffer(xf)) buffer_spout(xf, me) ; if (!xf->stdio) { if (stat(xf->fn->str, &mystat)) mcxIOerr(xf, me, "cannae stat file") ; else sz = mystat.st_size ; } if (!xf->fp && mcxIOopen(xf, RETURN_ON_FAIL)) { mcxIOerr(xf, me, "cannae open file") ; return STATUS_FAIL ; } if (xf->ateof) return STATUS_OK /* fixme; ting count overflow */ ; if (!(filetxt = mcxTingEmpty(filetxt, sz))) return STATUS_NOMEM ; while ((r = mcxIOappendChunk(xf, filetxt, sz, 0)) > 0 && !xf->ateof) ; if (r <0) return STATUS_FAIL /* fixme; look closer at error */ ; return STATUS_OK ; } static dim mcxIO__rl_fillbuf__ ( mcxIO* xf , char* buf , dim size , int* last ) { int a = 0 ; dim ct = 0 ; while(ctateof = 1 ; return z #undef MCX_IORL_BSZ ; } dim mcxIOdiscardLine ( mcxIO *xf ) { int a ; dim ct = 0 ; if (!xf->fp) { mcxIOerr(xf, "mcxIOdiscardLine", "is not open") ; return 0 /* fixme; set errno? */ ; } while(((a = mcxIOstep(xf)) != '\n') && a != EOF) ct++ ; if (inbuffer(xf)) /* fixme/design check buffer for line */ buffer_spout(xf, "mcxIOdiscardLine") ; return ct ; } ofs mcxIOappendChunk ( mcxIO *xf , mcxTing *dst , dim sz , mcxbits flags cpl__unused ) { unsigned long psz = getpagesize() ; dim k = sz / psz /* fixme: size checks? */ ; dim rem = sz % psz ; ofs r = 1 /* pretend in case k == 0 */ /* mcxbool account = flags & MCX_CHUNK_ACCOUNT ? TRUE : FALSE */ ; dim offset = dst->len ; char* p ; if (!dst || !xf->fp || !mcxTingEnsure(dst, dst->len + sz)) return -1 /* fixme set some (new) errno */ ; if (k) while (k-- > 0 && (r = read(fileno(xf->fp), dst->str+dst->len, psz)) > 0) dst->len += r /* careful with unsignedness */ /* ^ Note: fileno is POSIX, not c99 */ ; if ( r > 0 && rem > 0 && (r = read(fileno(xf->fp), dst->str+dst->len, rem)) > 0 ) dst->len += r ; dst->str[dst->len] = '\0' ; xf->bc += dst->len - offset ; for (p = dst->str+offset; pstr+dst->len; p++) { if (*p == '\n') { xf->lc++ ; xf->lo_ = xf->lo ; xf->lo = 0 ; } else xf->lo++ ; } /* fixme; what if k == 0, rem == 0 ? */ if (!r) /* fixme; other possibilities? */ xf->ateof = 1 ; return dst->len ; } mcxstatus mcxIOreadLine ( mcxIO *xf , mcxTing *dst , mcxbits flags ) { int a ; dim ll ; mcxbool chomp = flags & MCX_READLINE_CHOMP ? TRUE : FALSE ; mcxbool skip = flags & MCX_READLINE_SKIP_EMPTY ? TRUE : FALSE ; mcxbool par = flags & MCX_READLINE_PAR ? TRUE : FALSE ; mcxbool dot = flags & MCX_READLINE_DOT ? TRUE : FALSE ; mcxbool bsc = flags & MCX_READLINE_BSC ? TRUE : FALSE ; mcxbool repeat = dot || par || bsc ? TRUE : FALSE ; mcxbool continuation = FALSE ; mcxTing* line ; mcxstatus stat = STATUS_OK ; if (!xf->fp && mcxIOopen(xf, RETURN_ON_FAIL)) { mcxIOerr(xf, "mcxIOreadLine", "is not open") ; return STATUS_FAIL ; } if (xf->ateof) return STATUS_DONE ; if (!dst || !mcxTingEmpty(dst, 1)) return STATUS_NOMEM ; if (skip || par) { while((a = mcxIOstep(xf)) == '\n') NOTHING ; if (xf->ateof) return STATUS_DONE ; else mcxIOstepback(a, xf) ; } if (!(line = repeat ? mcxTingEmpty(NULL, 1) : dst)) return STATUS_NOMEM ; while (1) { ofs d = mcxIO__rl_rl__(xf, line) ; if (IO_MEM_ERROR == d) { stat = STATUS_NOMEM /* fixme grainify error/status */ ; break ; } ll = line->len ; if (!repeat) break ; else /* must append line to dst */ { if ( dot && !continuation && line->str[0] == '.' && ( ll == 2 || (ll == 3 && line->str[1] == '\r') ) /* fixme still not fully covering */ ) break /* do not attach the single-dot-line */ ; if (par && !continuation && ll == 1) break /* do not attach the second newline */ ; if (!mcxTingNAppend(dst, line->str, line->len)) { stat = STATUS_NOMEM ; break ; } continuation = bsc && (ll > 1 && *(line->str+ll-2) == '\\') ; if (continuation) mcxTingShrink(dst, -2) ; if (!par && !dot && (bsc && !continuation)) break ; if (xf->ateof) break ; } } if (repeat) mcxTingFree(&line) ; if (stat) return stat /* fixme; should we not check chomp first ? */ /* fixme _: \n\r ? */ ; if (chomp && dst->len && *(dst->str+dst->len-1) == '\n') mcxTingShrink(dst, -1) ; if (xf->ateof && !dst->len) return STATUS_DONE ; return STATUS_OK ; } void mcxIOlistParmodes ( void ) { fprintf ( stdout , "%5d vanilla mode, fetch next line\n" , MCX_READLINE_DEFAULT ) ; fprintf(stdout, "%5d chomp trailing newline\n", MCX_READLINE_CHOMP) ; fprintf(stdout, "%5d skip empty lines\n", MCX_READLINE_SKIP_EMPTY) ; fprintf(stdout, "%5d paragraph mode\n", MCX_READLINE_PAR) ; fprintf(stdout, "%5d backslash escapes newline\n", MCX_READLINE_BSC) ; fprintf ( stdout , "%5d section mode, ended by singly dot on a single line\n" , MCX_READLINE_DOT ) ; } void mcxIOpos ( mcxIO* xf , FILE* channel ) { const char* ateof = xf->ateof ? "at EOF in " : "" ; fprintf ( channel , "[mcxIO] %sstream <%s>, line <%ld>, character <%ld>\n" , ateof , xf->fn->str , (long) xf->lc , (long) xf->lo ) ; } void mcxIOfree_v ( void* xfpp ) { mcxIOfree((mcxIO**) xfpp) ; } void mcxIOfree ( mcxIO** xfpp ) { if (*xfpp) { mcxIO* xf = *xfpp ; mcxIOrelease(xf) ; mcxTingFree(&(xf->buffer)) ; if (xf->usr && xf->usr_free) xf->usr_free(xf->usr) ; mcxFree(xf) ; *xfpp = NULL ; } } mcxstatus mcxIOexpectReal ( mcxIO* xf , double* dblp , mcxOnFail ON_FAIL ) { int n_read = 0 ; int n_conv = 0 ; if (inbuffer(xf)) buffer_spout(xf, "mcxIOexpectReal") ; mcxIOskipSpace(xf) /* keeps accounting correct */ ; n_conv = fscanf(xf->fp, " %lf%n", dblp, &n_read) ; xf->bc += n_read /* fixme do fscanf error handling */ ; xf->lo += n_read ; if (1 != n_conv) { if (ON_FAIL == EXIT_ON_FAIL) { mcxIOpos(xf, stderr) ; mcxErr("parseReal", "parse error: expected to find real") ; mcxExit(1) ; } return STATUS_FAIL ; } return STATUS_OK ; } mcxstatus mcxIOexpectNum ( mcxIO* xf , long* lngp , mcxOnFail ON_FAIL ) { int n_read = 0 ; int n_conv = 0 ; mcxstatus status = STATUS_OK ; if (inbuffer(xf)) buffer_spout(xf, "mcxIOexpectNum") ; mcxIOskipSpace(xf) /* keeps accounting correct */ ; errno = 0 ; n_conv = fscanf(xf->fp, "%ld%n", lngp, &n_read) ; xf->bc += n_read /* fixme do fscanf error handling */ ; xf->lo += n_read ; if (1 != n_conv) mcxErr("mcxIOexpectNum", "parse error: expected to find integer") , status = STATUS_FAIL ; else if (errno == ERANGE) mcxErr("mcxIOexpectNum", "range error: not in allowable range") , status = STATUS_FAIL ; if (status) { mcxIOpos(xf, stderr) ; if (ON_FAIL == EXIT_ON_FAIL) mcxExit(1) ; } return status ; } int mcxIOskipSpace ( mcxIO* xf ) { int c ; while ((c = mcxIOstep(xf)) != EOF && isspace(c)) ; return mcxIOstepback(c, xf) ; } mcxbool mcxIOtryCookie ( mcxIO* xf , const uchar abcd[4] ) { uchar efgh[5] ; int n_read = fread(efgh, sizeof efgh[0], 4, xf->fp) ; int error = ferror(xf->fp) ; dim i = 0 ; if (n_read == 4) for (i=0; i<4 && abcd[i] == efgh[i]; i++) NOTHING #if 0 ;fprintf(stderr, "IN %d %d %d %d %d %d\n", i, n_read, (int) efgh[0], (int) efgh[1], (int) efgh[2], (int) efgh[3]) ;fprintf(stderr, "IN %d %d %d %d %d %d\n", i, n_read, (int) abcd[0], (int) abcd[1], (int) abcd[2], (int) abcd[3]) #endif ; if (i == 4) { xf->bc += 4 ; return TRUE ; } if (!fseek(xf->fp, -n_read, SEEK_CUR)) xf->bc += (4-n_read) ; else { mcxTingNAppend(xf->buffer, (char*) efgh, n_read) ; /* xf->bc += n_read mcxIOstep does subsequent accounting */ ; if (!error) clearerr(xf->fp) ; } return FALSE ; } mcxbool mcxIOwriteCookie ( mcxIO* xf , const uchar abcd[4] ) { dim n_written = fwrite(abcd, sizeof abcd[0], 4, xf->fp) ; if (n_written != 4) { mcxErr("mcxIOwriteCookie", "failed to write <%.4s>", abcd) ; return FALSE ; } return TRUE ; } /* fixme: newlines in str thrash correct lc/lo counting */ int mcxIOexpect ( mcxIO *xf , const char *str , mcxOnFail ON_FAIL ) { const char* s = str ; int c = 0 ; int d = 0 ; int n_trailing /* * no functional behaviour yet attached to this state change * fixme: semantics for STDIN agree between stdlib and us? */ ; while ( c = (uchar) s[0] , ( c && ( d = mcxIOstep(xf) , c == d ) ) ) s++ ; n_trailing = strlen(s) /* truncintok */ ; if (c && ON_FAIL == EXIT_ON_FAIL) { mcxErr("mcxIOexpect", "parse error: expected to see <%s>", str) ; mcxIOpos(xf, stderr) ; mcxExit(1) ; } return n_trailing ; } typedef struct { int tbl[256] ; int* circle /* circular buffer */ ; int circle_last /* circle bumper */ ; const char* pat ; int patlen ; } mcxIOpat ; static void mcxio_newpat ( mcxIOpat* md , const char* pattern ) { int i ; int *tbl = md->tbl ; const char* pat ; int patlen = strlen(pattern) /* truncintok */ ; md->circle = mcxAlloc(patlen * sizeof(int), EXIT_ON_FAIL) ; md->pat = pattern ; md->patlen = patlen ; pat = md->pat /* initialize */ ; for (i = 0; i < 256; i ++) tbl[i] = patlen ; for (i = 0; i < patlen-1; i++) tbl[(uchar) pat[i]] = patlen -i -1 #if DEBUG ; for (i=0; icircle_last = patlen -1 ; } static void mcxIOcleanpat ( mcxIOpat* md ) { mcxFree(md->circle) ; } static int fillpatbuf ( mcxIO* xfin , int shift , mcxIOpat* md ) { int c = 0 ; int z = 0 ; int patlen = md->patlen ; while (z < shift && (c = mcxIOstep(xfin)) != EOF) { int q = (md->circle_last+z+1) % patlen ; md->circle[q] = c ; z++ ; } md->circle_last = (md->circle_last+shift) % patlen ; return c ; } mcxstatus mcxIOfind ( mcxIO* xfin , const char* pat , mcxOnFail ON_FAIL ) { int j, k ; int shift, patlen ; int* tbl ; int* circle ; mcxIOpat md ; int found = 0 ; mcxio_newpat(&md, pat) ; patlen = md.patlen ; tbl = md.tbl ; circle = md.circle ; shift = patlen /* * hum. This means that empty pattern matches on empty string .. * Need to fix fillpatbuf if this should be reversed. */ ; if (!patlen) found = 1 ; else do { if (EOF == fillpatbuf(xfin, shift, &md)) break ; for ( j=md.circle_last+patlen, k=patlen-1 ; j>md.circle_last && circle[j%patlen] == (uchar) pat[k] ; j--, k-- ) NOTHING #if DEBUG fprintf (stderr ,"comparing circlebuf pos %d char [%c] with pattern pos %d char [%c]\n" ,(int) (j%patlen) ,(int) ((uchar) circle[j%patlen]) ,(int) k ,(int) pat[k] ) #endif ; if (j == md.circle_last) { found++ ; break ; } shift = tbl[circle[md.circle_last % patlen]] #if DEBUG ; fprintf ( stderr , "___ last[%d] index[%d] pivot[%c] shift[%d]\n" , (int) md.circle_last , (int) md.circle_last % patlen , (int) circle[md.circle_last % patlen] , (int) shift ) #endif ; } while (1) ; mcxIOcleanpat(&md) ; if (!found && ON_FAIL == RETURN_ON_FAIL) return STATUS_FAIL ; else if (!found) exit(EXIT_FAILURE) ; return STATUS_OK ; } dim mcxIOdiscard ( mcxIO* xf , dim amount ) { dim bsz = xf->buffer->mxl ; char* buf = xf->buffer->str ; dim n_read = 0 ; dim n_chunk = amount / bsz ; dim rem = amount - bsz * n_chunk ; dim i, n ; if (inbuffer(xf)) buffer_spout(xf, "mcxIOdiscard") ; for (i=0;ifp) ; n_read += n ; xf->bc += n ; if (n != bsz) break ; } if (i < n_chunk) return n_read ; if (rem) n = fread(buf, 1, rem, xf->fp) , n_read += n , xf->bc += n ; return n_read ; } cimfomfa-21-361/tingea/io.h000066400000000000000000000211661416241612100154210ustar00rootroot00000000000000/* (C) Copyright 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ /* STATUS: * usable: yes * tested: yes, stress-tested in zoem and mcl * ad hoc: somewhat * quirks: probably a few * support: limited * * AIMS * - Provide convenient and efficient wrappers for reading lines, files, searching. * - Within these wrappers, account bytes and lines read. * It is explicitly not an aim to be an all-encompassing interface, wrapping * everything provided by stdio.h. The type is not opaque and you are * encouraged to inspect its fp member. * - The open modes are inspected to infer some knowledge, * then passed on directly to fopen. * - File "-" is interpreted as either STDIN or STDOUT depending on the open mode. * * BUGS * - buffer framework is fully implemented: * mcxIOexpectNum and mcxIOexpectReal ignore buffer. * - Should incorporate more (f)error checking. * * TODO: * - document interfaces. * - document which routines corrupt the counts. * - make sure that buffer treats \0 bytes correctly. Should be * pretty close. * - buffered reads (problematic: mcxIOexpectNum and friends). * - design {reset,close} framework, esp related to usr member. * ? support for pipes */ #ifndef tingea_file_h #define tingea_file_h #include #include #include "ting.h" #include "types.h" /* The thing below seems a reasonable test for seekability. * Let's agree that the main thing is the encapsulation. * */ #define mcxFPisSeekable(fp) (!fseek(fp, 0, SEEK_CUR)) /* Possibly more stringent check: * int had_error = ferror(file); * long curpos = ftell(file); * bool seekable = (curpos != -1L && fseek(file, curpos, SEEK_SET) == 0); * if (!had_error) * clearerr(file); */ /* ************************************************************************** * * ** Implementation notes. * * * This is meant to be a lightweight layer for file operations. * It is so lightweight that the pivotal data structure is not hidden. * * Basic usage: * mcxIO* xf = mcxIOnew(somestr, "r"); * mcxIOopen(xf, EXIT_ON_FAIL); * * * Searching: * mcxIOfind(xf, pattern, ON_FAIL) * * * Reading lines: * mcxIOreadLine(xf, txt, mode) * modes (xor'ed bits): * MCX_READLINE_CHOMP * MCX_READLINE_SKIP_EMPTY * MCX_READLINE_PAR (read a paragraph) * MCX_READLINE_BSC (backslash continues line) * MCX_READLINE_DOT (single dot on single line ends paragraph) * Reading files: * mcxIOreadFile(xf, txt) * * * Reading bytes: * int c = mcxIOstep(xf) * mcxIOstepback(c, xf) * * These keep track of byte count, line count, and ofset within line. * * * Reset attributes for file name object - change name or mode. * mcxIOrenew(xf, name, mode) * * * There are some more small utility functions. * ************************************************************************** * * * * TODO: * much todo about everything. * * mcxIOdiscardLine * mcxIOskipSpace * Change to instance of sth more general. * */ #define mcxIOateof(xf) (xf->ateof) #define mcxIOstdio(xf) (xf->stdio) #define mcxIOlc(xf) ((long) ((xf->lc) + (xf->lo ? 1 : 0))) /* this also takes care of EOF * not preceded by a newline */ /* As long as you did not use mcxIOopen, feel free to do anything with the fn * member, especially right after mcxIOnew. */ typedef struct { mcxTing* fn ; char* mode ; FILE* fp ; dim lc /* line count */ ; dim lo /* line offset */ ; dim lo_ /* line offset backup, only valid when lo == 0 */ ; dim bc /* byte count */ ; int ateof ; int stdio ; mcxTing* buffer /* e.g. when tryCookie fails and unseekable stream */ ; dim buffer_consumed ; void* usr /* user object */ ; mcxstatus (*usr_reset)(void*) /* function to reset user object */ ; void (*usr_free)(void*) /* function to free user object */ ; } mcxIO ; /* * mcxIOrenew does *not* support callback for resetting the usr object */ mcxIO* mcxIOrenew ( mcxIO* xf , const char* name , const char* mode ) ; mcxIO* mcxIOnew ( const char* name , const char* mode ) ; mcxstatus mcxIOopen ( mcxIO* xf , mcxOnFail ON_FAIL ) ; mcxstatus mcxIOtestOpen ( mcxIO* xf , mcxOnFail ON_FAIL ) ; /* * mcxIOfree does *not* support callback for freeing the usr object */ void mcxIOfree ( mcxIO** xf ) ; void mcxIOfree_v ( void* xfpp ) ; void mcxIOrelease ( mcxIO* xf ) ; void mcxIOerr ( mcxIO* xf , const char *complainer , const char *complaint ) ; /* Currently, for stdin/stdout/stderr clearerr is issued if necessary. * This makes e.g. repeated reads from STDIN possible. * * usr_reset is called if present. */ mcxstatus mcxIOclose ( mcxIO *xf ) ; mcxstatus mcxIOreset ( mcxIO *xf ) ; mcxstatus mcxIOreadFile ( mcxIO *xf , mcxTing *fileTxt ) ; #define MCX_READLINE_DEFAULT 0 #define MCX_READLINE_CHOMP 1 #define MCX_READLINE_SKIP_EMPTY 2 #define MCX_READLINE_PAR 4 #define MCX_READLINE_BSC 8 #define MCX_READLINE_DOT 16 mcxstatus mcxIOreadLine ( mcxIO *xf , mcxTing *lineTxt , mcxbits flags ) ; ofs mcxIOappendChunk ( mcxIO *xf , mcxTing *dst , dim sz , mcxbits flags ) ; /* Returns the number of bytes that could be discarded. */ dim mcxIOdiscardLine ( mcxIO *xf ) ; /* Returns the number of bytes that could be discarded. * ONLY keeps the xf->bc counter up to date. */ dim mcxIOdiscard ( mcxIO *xf , dim amount ) ; /* OK to call this after mcxIOnew, before mcxIOopen */ mcxstatus mcxIOnewName ( mcxIO* xf , const char* newname ) ; /* OK to call this after mcxIOnew, before mcxIOopen */ mcxstatus mcxIOappendName ( mcxIO* xf , const char* suffix ) ; int mcxIOstep ( mcxIO* xf ) ; int mcxIOstepback ( int c , mcxIO* xf ) ; void mcxIOpos ( mcxIO* xf , FILE* channel ) ; void mcxIOlistParmodes ( void ) ; /* * Returns count of trailing characters in str not matching. */ int mcxIOexpect ( mcxIO* xf , const char* str , mcxOnFail ON_FAIL ) ; mcxstatus mcxIOexpectReal ( mcxIO* xf , double* dblp , mcxOnFail ON_FAIL ) ; mcxstatus mcxIOexpectNum ( mcxIO* xf , long* lngp , mcxOnFail ON_FAIL ) ; /* * Returns next non-white space char, * which is pushed back onto stream after reading. */ int mcxIOskipSpace ( mcxIO* xf ) ; /* * Purpose: find str in file. If str is found file pointer is set at the end * of match (fgetc or mcxIOstep would retrieve the next byte), otherwise, * the stream is at EOF. * * Internally this uses Boyer Moore Horspool (bmh) search. * It processes the stream with fgetc, so the input file need not be * seekable. This means that finding is relatively slow. * * An improvement would be to implement faster input munging for seekable * streams, (using reads of size pagesize) and then reposition the stream * after searching. * */ mcxstatus mcxIOfind ( mcxIO* xf , const char* str , mcxOnFail ON_FAIL ) ; /* * NOTE * When the cookie is not found this routine does * 1) It tries to fseek to the point of departure * 2) If that fails, it stores the bytes it could not rewind * in xfin->buffer * * + mcxIOstep * + mcxIOfind * + mcxIOskipSpace * + mcxIOexpect * + mcxIOreadLine * * will access this buffer, but certain other routines will not, e.g. * * - mcxIOreadFile * - mcxIOexpectNum * - mcxIOexpectReal * - all stdio routines (fread, fgetc) * * For all mcxIO routines this is an open bug. * */ mcxbool mcxIOtryCookie ( mcxIO* xfin , const unsigned char abcd[4] ) ; mcxbool mcxIOwriteCookie ( mcxIO* xfout , const unsigned char abcd[4] ) ; #endif cimfomfa-21-361/tingea/let.c000066400000000000000000001360471416241612100155760ustar00rootroot00000000000000/* (C) Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Stijn van Dongen * (C) Copyright 2008, 2009, 2010, 2011 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ /* * You probably don't want to look at this code - the reasons are explained * below. I like the beast though, especially the part that you can specify * callbacks to parse 'external' data. */ /* * TODO * catch integer overflow. * lots of ival / fval joint updates/dependencies. May need to check them all. * consider unsigned type. Perhaps implement signed with separate sign. * consider bit operators and unsigned type. * precision. */ #include #include #include #include #include "let.h" #include "ting.h" #include "ding.h" #include "alloc.h" #include "minmax.h" #include "err.h" #include "types.h" #include "ding.h" #include "compile.h" /* ************************************************************************** * * ** Implementation notes (a few). * * Features * All of C's operators in a revised precedence scheme, with exponentiation * added. The groups of logical operators, bitwise operators, comparison * operators have equal precedence internally (but changing this is a * matter of editing a single table). Unsigned integers are not supported * (so bitwise complement behaves funnily). Ternary operator behaves as * should; evaluates only one of its branches. Boolean logical operators * do shortcircuit. All mathematical functions from math.h and some * additional ones (e.g. abs, round, sign). Variables can be parsed and * evaluated using user-supplied functions. Currently, variables must be * recognizable by a special lead character. Todos * I may want to pass raam along to compute and flatten after all. * This brings back in the tokids, which are nice to have. * It also means that global callbacks can be localized. * * Right now, inf is not caught. isinf() seems not portable though :( * * getatoken could be equipped with more error handling facilities now that * user_parse is inserted. The current behaviour is that parsing control * is transfered to native parsing if user parsing does not succeed. This * can be used for overloading the special character, e.g. setting it to * '!' -> user parsing could require a !<..> sequence; if not found, '!' * would be seen as the negation operator. * * user_parse and user_eval need to be global in scope as long * as raam is not passed along in compute and flatten, * but that is actually not a problem (apart from reentrancy). * * Hashing of function names. * * Audit overflow, exceptions, long/double mixing. * * Should min(1,2.0) be 1 rather than 1.0 ? in that case, need special * behaviour for twoary max and min just like now for oneary abs. * * Make int to double overflow promotion a trmInit option. * * on STATUS_FAIL for parse, write error message in telraam. * * allow functions with empty arguments (e.g. rand()). * * add some of the funny stuff provided by fv, f? * * tn toktype is used both in lexing/parsing stage and in reduction stage. * not scalable. Future idea: * Implement an intermediate layer between parsing and evaluation. * E.g. convert the result of trmParse() to a stack. Done * Errors cascade back. For parse errors all memory seems to be reclaimed * (for all cases tried so far). * After parsing, no other errors should be possible I believe. * * made real type, which could be long double. Tis not however, * because long double math does not seem widespread and/or standard. * made num type, which could be long long. Tis not however, * because long long math seems to be C99 (not widespread etc). * * enabled user callbacks for variable and function interpolation. Integers/Floats * It is tracked which operations result in integers and which do * not. If integer overflow occurs the result is promoted to double. * The internal logic implementing this behaviour dictates that * as long as (flags & TN_ISINT) it must be true that fval ==~ ival. * TODO: make this customizable. * NOTE: doubles pbb can capture all 32-bit integers, but not so for * 64-bit integers. May make subtle difference. Apology * It's lame to write your own parser rather than lex and yacc but scriptor * wanted to do it one more time than zero. * * The result is pretty ad hoc and not generic, what it's got going for it * is that it works. Also, trmParse() is not that bad I believe, although * it is not very scalable either. compute() is the trickiest. Some * provisions were made to get short-circuiting and the ternary op working. * The same data structure is used for tokenization, parsing, and * evaluation. Ugly! Implementation notes * . Parse tree is implicitly stored as a linked list. * . Evaluation is done by compute/flatten; precedence and branching are done * during evaluation, rather than (partly) precomputed (which would much be * cleaner). precedence is done in flatten; branching in compute. * . tn's (token nodes) are used both by lexer, parser, and interpreter, * which is not the nicest way of doing it. * . Could push and convert all tokens to a stack (format), which would unify * operators and functions to some extent, and separate interpretation from * parsing and braching. Errors * Currently we have arithmetic error only. * TODO: * Overflow error -- but isinf does not seem portable :( Caveat * tnFree/tnDup should not be applied to a TOKEN_CLOSE node, dupwise * speaking. This is because compute currently has a sanity check for * pointer identity before and after its main loop. * * tricky spots, unfinished thoughts, future ideas, and omitted assertions * are marked with the sequence 'mq' (or even 'mqmq'), but not all of them. * Some reminders * routines that must be checked (malloc dependent) * tnDup * tnNewToken * tnPushToken * tnPushThis * routines that need be checked for other reason * tnUser * flatten * compute * getatom * getexpression * trmParse */ typedef double real; /* but we always use double arithmetic */ /* i.e. never use long double */ #ifdef LET99 typedef long long num; # define NUM_MIN LLONG_MIN /* this branch has not been tested! */ # define NUM_MAX LLONG_MAX /* and requires modifiation of trmEval */ #else typedef long num; # define NUM_MIN LONG_MIN # define NUM_MAX LONG_MAX #endif static int debug_g = 0; static int (*user_parse_g)(mcxTing* txt, int offset) = NULL; static mcxenum (*user_eval_g)(const char* token, long *ival, double *fval) = NULL; static char user_char_g = 0; typedef struct tn /* the lex/parse/interpret one stop-shop */ { mcxTing* token ; i32 toktype ; i32 optype ; i32 opid ; real fval ; num ival ; struct tn* prev ; struct tn* next ; i32 flags ; } tn; /* token node, or whatever */ struct telRaam { mcxTing *text ; mcxTing *token /* current token */ ; char* p ; mcxbool buffered /* should use buffer (pushed back token)? */ ; tn* node /* document symantics */ ; tn* start ; real fval ; num ival ; i32 flags ; i32 toktype ; i32 depth ; tn* stack /* when converting parsed expression to stack */ ; int stack_size ; } ; typedef enum { TOKEN_EXH = -1 , TOKEN_START = 0 /* special start symbol */ , TOKEN_UNIOP = 1 /* unary, 1 */ , TOKEN_BINOP = 2 /* binary, 2 */ , TOKEN_FUN = 69 /* can be fun, but I mean 6 = ( 9 = ) */ , TOKEN_TRIOP = 3333 /* ternary, let's stress the fact */ , TOKEN_TRICATCH = 6667 /* complement of a number wrt another number */ , TOKEN_CMP = 12321 /* hum, dunnow really */ , TOKEN_OR = 11 /* || */ , TOKEN_AND = 88 /* && */ , TOKEN_OPEN = 6 /* like fun, 6 = ( */ , TOKEN_CLOSE = 9 /* like fun, 9 = ) */ , TOKEN_COMMA = 13579 /* gaps */ , TOKEN_CONST = 31415 /* PI */ , TOKEN_USER = 981 /* G, variable */ } tokentype ; #define OP_UNI_NEG 1 << 0 /* - */ #define OP_UNI_NOT 1 << 1 /* ! */ #define OP_UNI_COMPL 1 << 2 /* ~ */ #define OP_EXP_EXP 1 << 3 /* ** */ #define OP_MUL_MUL 1 << 4 /* * */ #define OP_MUL_FRAC 1 << 5 /* / */ #define OP_MUL_DIV 1 << 6 /* // */ #define OP_MUL_MOD 1 << 7 /* % */ #define OP_ADD_ADD 1 << 8 /* + */ #define OP_ADD_SUB 1 << 9 /* - */ #define OP_BIT_LSHIFT 1 << 10 /* << */ #define OP_BIT_RSHIFT 1 << 11 /* >> */ #define OP_BIT_AND 1 << 12 /* & */ #define OP_BIT_OR 1 << 13 /* | */ #define OP_BIT_XOR 1 << 14 /* ^ */ #define OP_CMP_LT 1 << 15 /* < */ #define OP_CMP_LQ 1 << 16 /* <= */ #define OP_CMP_GQ 1 << 17 /* >= */ #define OP_CMP_GT 1 << 18 /* > */ #define OP_CMP_EQ 1 << 19 /* == */ #define OP_CMP_NE 1 << 20 /* != */ #define OP_TRI_START 1 << 21 /* ! */ #define OPTYPE_UNI (OP_UNI_NEG | OP_UNI_NOT | OP_UNI_COMPL) #define OPTYPE_EXP OP_EXP_EXP #define OPTYPE_MUL (OP_MUL_MUL | OP_MUL_FRAC | OP_MUL_DIV | OP_MUL_MOD) #define OPTYPE_ADD (OP_ADD_ADD | OP_ADD_SUB) #define OPTYPE_BIT (OP_BIT_LSHIFT | OP_BIT_RSHIFT \ | OP_BIT_AND | OP_BIT_OR | OP_BIT_XOR) #define OPTYPE_CMP (OP_CMP_LT | OP_CMP_LQ | OP_CMP_GT | OP_CMP_GQ \ | OP_CMP_EQ | OP_CMP_NE) #define OPTYPE_TRI OP_TRI_START typedef struct opHook { char* opname ; i32 opid ; i32 optype ; } opHook ; static double sign (double f ) { return f > 0 ? 1.0 : f < 0 ? -1.0 : 0.0 ; } static double letround (double f ) { return f > 0 ? floor(f+0.5) : ceil(f-0.5) ; } static double letlog2 (double f) { return f > 0 ? log(f) / log(2.0) : 0.0 ; } typedef struct fun1Hook { char* funname ; double (*funcd)(double a) ; i32 funflags ; } fun1Hook ; #define FUN_SPECIAL 1 #define FUN_INTRESULT 2 #define FUN_OVERLOADED 4 static double show_bits(double a) { return a; } static fun1Hook fun1HookDir[] = { { "sin", sin , 0 } , { "cos", cos , 0 } , { "tan", tan , 0 } , { "exp", exp , 0 } , { "log", log , 0 } , { "log10", log10 , 0 } , { "log2", letlog2 , 0 } , { "asin", asin , 0 } , { "acos", acos , 0 } , { "atan", atan , 0 } , { "sqrt", sqrt , 0 } , { "abs", fabs , FUN_SPECIAL } , { "floor", floor , FUN_INTRESULT } , { "ceil", ceil , FUN_INTRESULT } , { "round", letround , FUN_INTRESULT } , { "int", letround , FUN_INTRESULT } , { "sign", sign , FUN_INTRESULT } , { "bits", show_bits , FUN_SPECIAL } , { NULL, NULL , 0 } } ; static double max ( double a, double b ) { return a > b ? a : b ; } static double min ( double a, double b ) { return a < b ? a : b ; } static num maxl ( num a, num b ) { return a > b ? a : b ; } static num minl ( num a, num b ) { return a < b ? a : b ; } typedef struct fun2Hook { char* funname ; double (*funcd)(double a, double b) ; num (*funcl)(num a, num b) ; i32 funflags ; } fun2Hook ; static fun2Hook fun2HookDir[] = { { "max", max , maxl, 0 } , { "min", min , minl, 0 } , { NULL, NULL , NULL, 0 } } ; /* mq if (tn_isint(lft) && tn_isint(rgt) && hook->funcl) */ static opHook opHookDir[] = { { "-", OP_UNI_NEG, OPTYPE_UNI } , { "!", OP_UNI_NOT, OPTYPE_UNI } , { "~", OP_UNI_COMPL, OPTYPE_UNI } , { "**", OP_EXP_EXP, OPTYPE_EXP } , { "*", OP_MUL_MUL, OPTYPE_MUL } , { "/", OP_MUL_FRAC, OPTYPE_MUL } , { "//", OP_MUL_DIV, OPTYPE_MUL } , { "%", OP_MUL_MOD, OPTYPE_MUL } , { "+", OP_ADD_ADD, OPTYPE_ADD } , { "-", OP_ADD_SUB, OPTYPE_ADD } , { "<<", OP_BIT_LSHIFT, OPTYPE_BIT } , { ">>", OP_BIT_RSHIFT, OPTYPE_BIT } , { "&", OP_BIT_AND, OPTYPE_BIT } , { "|", OP_BIT_OR, OPTYPE_BIT } , { "^", OP_BIT_XOR, OPTYPE_BIT } , { "<", OP_CMP_LT, OPTYPE_CMP } , { "<=", OP_CMP_LQ, OPTYPE_CMP } , { ">=", OP_CMP_GQ, OPTYPE_CMP } , { ">", OP_CMP_GT, OPTYPE_CMP } , { "==", OP_CMP_EQ, OPTYPE_CMP } , { "!=", OP_CMP_NE, OPTYPE_CMP } , { "?", OP_TRI_START, OPTYPE_TRI } , { NULL, 0, 0, } } ; enum { EXPECT_ANY = 1 , EXPECT_ATOM = 2 } ; #define TN_ISINT 1 /* tn token node, object used everywhere */ #define TN_NOINT 2 #define TN_ISNAN 4 #define TN_ISINF 8 #define tn_isint(a) (a->flags & TN_ISINT) mcxbool trmIsNan ( int flags ) { return flags & TN_ISNAN ; } mcxbool trmError ( int flags ) { return flags & (TN_ISNAN | TN_ISINF) ; } mcxbool trmIsInf ( int flags ) { return flags & TN_ISINF ; } mcxbool trmIsNum ( int flags ) { return flags & TN_ISINT ; } mcxbool trmIsReal ( int flags ) { return !(flags & (TN_ISINT | TN_ISNAN | TN_ISINF)) ; } static mcxstatus getexpression ( telRaam *raam ) ; static mcxstatus getatom ( telRaam* raam ) ; static void dump ( tn* node , i32 times , const char* msg ) ; void trmDump ( telRaam* raam , const char* msg ) { dump(raam->start, 0, msg) ; } static tn* tnNewToken ( const char* token , i32 toktype , real fval , num ival ) { tn* node = mcxAlloc(sizeof(tn), RETURN_ON_FAIL) ; if (!node) return NULL ; if (!(node->token = mcxTingNew(token ? token : "_<>_"))) { mcxFree(node) ; return NULL ; } node->toktype = toktype ; node->optype = 0 ; node->opid = 0 ; node->ival = ival ; node->fval = fval ; node->next = NULL ; node->prev = NULL ; node->flags = 0 ; if (debug_g) dump(node, 1, "new node") ; return node ; } static tn* tnDup ( tn* this , const char* str ) { tn* new = tnNewToken ( str , this->toktype , this->fval , this->ival ) ; if (!new) return NULL ; new->optype = this->optype ; new->next = this->next ; new->prev = this->prev ; new->flags = this->flags ; return new ; } static mcxstatus tnFree ( tn* lft , tn* rgt ) { tn* cur = lft, *next ; while (cur) { mcxTingFree(&(cur->token)) ; if (debug_g) fprintf(stderr, "___ [telraam] freeing node <%p>\n", (void*) cur) ; if (cur == rgt) { mcxFree(cur) ; break ; } if (cur->next && cur->next->prev != cur) { mcxErr("tnFree", "free encountered spaghetti") ; return STATUS_FAIL ; } next = cur->next ; mcxFree(cur) ; cur = next ; } return STATUS_OK ; } static void tnLink2 ( tn* one , tn* two ) { if (one) one->next = two ; if (two) two->prev = one ; } static void tnLink3 ( tn* one , tn* two , tn* three ) { if (one) one->next = two ; if (three) three->prev = two ; two->prev = one ; two->next = three ; } static mcxstatus tnPushToken ( telRaam* raam ) { i32 toktype = raam->toktype ; tn* new = tnNewToken(raam->token->str, toktype, 0.0, 0) ; if (!new) return STATUS_FAIL ; if (toktype == TOKEN_CONST) new->fval = raam->fval , new->ival = raam->ival , new->flags = raam->flags ; else if ( toktype == TOKEN_BINOP || toktype == TOKEN_UNIOP ) { opHook* oh = raam->toktype == TOKEN_BINOP ? opHookDir+3 : opHookDir+0 /* bigg phat ugly hack */ /* (need to overcome '-' uni/bin ambiguity */ ; while (oh->opname) { if (!strcmp(oh->opname, raam->token->str)) { new->optype = oh->optype ; new->opid = oh->opid ; break ; } oh++ ; } if (!oh->opname) { mcxErr("tnPushToken", "no such operator: <%s>", raam->token->str) ; tnFree(new, NULL) ; return STATUS_FAIL ; } } else if (raam->toktype == TOKEN_FUN) { /* mq: move name resolution to here ? mm, needs arity */ ; } tnLink3(raam->node, new, NULL) ; raam->node = new ; return STATUS_OK ; } static mcxstatus tnPushThis ( telRaam* raam , const char* token , i32 toktype ) { tn* new = tnNewToken(token, toktype, 0.0, 0) ; if (!new) return STATUS_FAIL ; tnLink3(raam->node, new, NULL) ; raam->node = new ; return STATUS_OK ; } void trmDebug ( void ) { debug_g = 1 ; } telRaam* trmInit ( const char* str ) { telRaam* raam= mcxAlloc(sizeof(telRaam), RETURN_ON_FAIL) ; if (!raam) return NULL ; raam->text = mcxTingNew(str) ; raam->token = mcxTingEmpty(NULL, 30) ; raam->p = raam->text->str ; raam->buffered = FALSE ; raam->node = tnNewToken("_start_", TOKEN_START, 0.0, 0) ; raam->start = raam->node ; raam->fval = 0.0 ; raam->ival = 0 ; raam->flags = 0 ; raam->depth = 1 ; raam->toktype= 0 ; raam->stack = NULL ; if (!raam->text || !raam->token || !raam->node) mcxFree(raam) , raam = NULL ; return raam ; } mcxstatus trmExit ( telRaam* raam ) { if (tnFree(raam->start, raam->node)) return STATUS_FAIL ; mcxTingFree(&(raam->text)) ; mcxTingFree(&(raam->token)) ; mcxFree(raam) ; return STATUS_OK ; } static void untoken ( telRaam* raam ) { raam->buffered = TRUE ; } static void dump ( tn* node , i32 times , const char* msg ) { tn* prev = NULL ; printf("______ %s\n", msg ? msg : "dumping dumping dumping") ; printf ("%8s" "%10s" "%10s" "%10s" "%12s" "%10s" "%6s\n" ,"toktype","optype","opclass","token","fval","ival","flags" ) ; while (node) { printf ("%8d" "%10d" "%10d" "%10s" "%12.4f""%10ld""%6d\n" , node->toktype , node->opid , node->optype , node->token ? node->token->str : "<>" , node->fval , (long) node->ival , node->flags ) ; prev = node ; node = node->next ; if (node && (node->prev->next != node || node->prev != prev)) fprintf ( stderr , "_____ [telraam] PANICK incorrect linking" " <%p> n<%p> np<%p> npn<%p>\n" , (void*) prev , (void*) node , (void*) node->prev , (void*) node->prev->next ) ; if (!--times) break ; } } static int getatoken ( telRaam* raam , i32 mode ) { char* p = raam->p ; i32 toktype = 0 ; int len ; while (isspace((unsigned char) *p)) p++ ; raam->p = p ; if (!*p) { mcxTingWrite(raam->token, "EOF") ; return TOKEN_EXH ; } else if ( mode == EXPECT_ATOM && ( *p == '-' || *p == '!' || *p == '~' ) ) { toktype = TOKEN_UNIOP ; p = p+1 ; } else if (*p == ':') { toktype = TOKEN_TRICATCH ; p = p+1 ; } else if (*p == '&' && *(p+1) == '&') { toktype = TOKEN_AND ; p = p+2 ; } else if (*p == '|' && *(p+1) == '|') { toktype = TOKEN_OR ; p = p+2 ; } else if (*p == '?') { toktype = TOKEN_TRIOP ; p = p+1 ; } else if (*p == ',') { toktype = TOKEN_COMMA ; p = p+1 ; } else if (isdigit((unsigned char) *p)) { int l ; double f ; sscanf(p, "%lf%n", &f, &l) /* mq need error checking */ ; toktype = TOKEN_CONST ; raam->fval = f ; raam->ival = 0 ; if (raam->fval < NUM_MIN || raam->fval > NUM_MAX) raam->flags = TN_NOINT ; else { raam->flags = mcxStrChrAint(p, isdigit, l) ? 0 : TN_ISINT ; raam->ival = f > 0 ? f + 0.5 : f - 0.5 ; } p = p+l ; } else if (isalpha((unsigned char) *p) || *p == '_') { char* q = p ; while(isalpha((unsigned char) *q) || *q == '_' || isdigit((unsigned char) *q)) q++ ; p = q ; toktype = TOKEN_FUN ; } else if (*p == '(' || *p == ')') { toktype = *p == '(' ? TOKEN_OPEN : TOKEN_CLOSE ; p = p+1 ; } else if ( user_char_g == *p && (len = user_parse_g(raam->text, p-raam->text->str)) > 0 ) /* ^truncintok */ { p += len ; toktype = TOKEN_USER ; } else { char* q = p ; while (*q == *p || *q == '=') /* hack */ q++ ; toktype = TOKEN_BINOP ; p = q ; } mcxTingNWrite(raam->token, raam->p, (dim) (p-raam->p)) ; raam->p = p ; return toktype ; } static i32 gettoken ( telRaam* raam , i32 mode ) { if (raam->buffered) raam->buffered = FALSE ; else raam->toktype = getatoken(raam, mode) ; return raam->toktype ; } static tn* findop ( tn* end ) { tn* node = end->prev, *max = NULL ; while (node->toktype != TOKEN_OPEN) { if ( node->toktype == TOKEN_UNIOP || node->toktype == TOKEN_BINOP || node->toktype == TOKEN_TRIOP ) { if ( !max || node->optype <= max->optype ) max = node ; } node = node->prev ; } return max ; } static tn* finduser ( tn* start ) { tn* node = start->next ; while (node->toktype != TOKEN_CLOSE) { if (node->toktype == TOKEN_USER) return node ; node = node->next ; } return NULL ; } static mcxstatus tnUser ( tn* usr ) { mcxenum stat = user_eval_g(usr->token->str, &usr->ival, &usr->fval) ; if (stat == TRM_ISNUM) { usr->flags = TN_ISINT ; usr->fval = usr->ival ; } else if (stat == TRM_ISREAL) usr->flags = 0 ; else if (stat == TRM_ISNAN) { usr->flags = TN_ISNAN ; return STATUS_FAIL ; } else if (stat == TRM_FAIL) { usr->flags = TN_ISNAN ; return STATUS_FAIL ; } usr->toktype = TOKEN_CONST ; return STATUS_OK ; } /* * Flattens a bunch of leafs interspersed with operators. * Leaves received start and corresponding end alone. */ static mcxstatus flatten ( tn* start , tn* end ) { tn* new, *op, *usr ; real fval = 0.0 ; num ival = 0 ; const char* me = "flatten" ; if ( start->toktype != TOKEN_OPEN || end->toktype != TOKEN_CLOSE ) { mcxErr ( me , "wrong toktype - ids (%p, %p)" , (void*) start, (void*) end ) ; dump(start, 0, NULL) ; return STATUS_FAIL ; } new = start->next ; while ((usr = finduser(start))) { if (tnUser(usr)) return STATUS_FAIL ; } while ((op = findop(end))) { tn* lft = op->prev ; tn* rgt = op->next /* ugly in case of UNIOP */ ; int err = 0 ; i32 flags = 0 ; if (op->toktype == TOKEN_UNIOP) { real frgt = rgt->fval ; num irgt = rgt->ival ; switch(op->opid) { case OP_UNI_NOT : ival = ( tn_isint(rgt) ? ( irgt ? 0 : 1 ) : ( frgt ? 0 : 1 ) ) ; fval = ival ; flags |= TN_ISINT ; break ; case OP_UNI_NEG : fval = -frgt ; ival = -irgt ; break ; case OP_UNI_COMPL : ival = ~irgt ; fval = ival ; flags |= TN_ISINT ; break ; default : err = 1 ; } lft = op ; flags |= tn_isint(rgt) /* mq fval=ival assignment ugly, need overflow check as well :) */ ; } else if (op->toktype == TOKEN_BINOP) { real flft = lft->fval ; real frgt = rgt->fval ; num ilft = lft->ival ; num irgt = rgt->ival ; if (op->opid & OPTYPE_BIT) { if (!tn_isint(lft)) ilft = lft->fval /* fixordocme: why the reassign? */ ; if (!tn_isint(rgt)) irgt = rgt->fval /* fixordocme: why the reassign? */ ; if (!tn_isint(rgt) || !tn_isint(lft)) mcxErr ( "let" , "[flatten][bitop %s] forcing real operands to number" , op->token->str ) ; } if (lft->toktype != TOKEN_CONST || rgt->toktype != TOKEN_CONST) { mcxErr(me, "this bifoo is not the right foo") ; dump(start, 0, NULL) ; return STATUS_FAIL ; } switch(op->opid) { case OP_MUL_MUL : fval = flft * frgt ; ival = ilft * irgt ; break ; case OP_EXP_EXP : if (flft < 0 && !(rgt->flags & TN_ISINT)) fval = 0.0 , flags |= TN_ISNAN ; else fval = pow(flft,frgt) ; ival = letround(fval) ; break ; case OP_ADD_ADD : fval = flft + frgt ; ival = ilft + irgt ; break ; case OP_MUL_FRAC : fval = frgt ? (flft / frgt) : 0.0 ; ival = irgt ? (ilft / irgt) : 0 ; if (tn_isint(lft) && tn_isint(rgt) && ival * irgt == ilft) flags |= TN_ISINT ; else flags |= TN_NOINT ; if (!frgt) flags |= TN_ISNAN ; break ; case OP_MUL_DIV : fval = frgt ? floor(flft/frgt) : 0.0 ; ival = irgt ? (ilft / irgt) : 0 ; if (!frgt) flags |= TN_ISNAN ; break ; case OP_MUL_MOD : fval = frgt ? frgt * (flft/frgt-floor(flft/frgt)) : 0.0 ; ival = irgt ? (ilft % irgt) : 0.0 ; if (!frgt) flags |= TN_ISNAN ; break ; case OP_ADD_SUB : fval = flft - frgt ; ival = ilft - irgt ; break ; case OP_CMP_LT : ival = tn_isint(lft) && tn_isint(rgt) ? ( ilft < irgt ? 1 : 0 ) : ( flft < frgt ? 1 : 0 ) ; flags |= TN_ISINT ; break ; case OP_CMP_LQ : ival = tn_isint(lft) && tn_isint(rgt) ? ( ilft <= irgt ? 1 : 0 ) : ( flft <= frgt ? 1 : 0 ) ; flags |= TN_ISINT ; break ; case OP_CMP_GQ : ival = tn_isint(lft) && tn_isint(rgt) ? ( ilft >= irgt ? 1 : 0 ) : ( flft >= frgt ? 1 : 0 ) ; flags |= TN_ISINT ; break ; case OP_CMP_GT : ival = tn_isint(lft) && tn_isint(rgt) ? ( ilft > irgt ? 1 : 0 ) : ( flft > frgt ? 1 : 0 ) ; flags |= TN_ISINT ; break ; case OP_CMP_EQ : ival = tn_isint(lft) && tn_isint(rgt) ? ( ilft == irgt ? 1 : 0 ) : ( flft == frgt ? 1 : 0 ) ; flags |= TN_ISINT ; break ; case OP_CMP_NE : ival = tn_isint(lft) && tn_isint(rgt) ? ( ilft != irgt ? 1 : 0 ) : ( flft != frgt ? 1 : 0 ) ; flags |= TN_ISINT ; break ; case OP_BIT_LSHIFT : ival = ilft << irgt ; flags |= TN_ISINT ; break ; case OP_BIT_RSHIFT : ival = ilft >> irgt ; flags |= TN_ISINT ; break ; case OP_BIT_AND : ival = ilft & irgt ; flags |= TN_ISINT ; break ; case OP_BIT_OR : ival = ilft | irgt ; flags |= TN_ISINT ; break ; case OP_BIT_XOR : ival = ilft ^ irgt ; flags |= TN_ISINT ; break ; default : err = 1 ; } /* this rule implements implicit behaviour with overruling: * two integers result in an integer unless overruled * with the TN_NOINT attribute. */ if (!(flags & TN_NOINT)) flags |= tn_isint(lft) & tn_isint(rgt) /* next we check whether overflow occurred. If so, discard the * integer attribute. This depends on i) fval follows ival as * long as the integer attribute is set and ii) in that pursuit, * fval is computed to be similar to ival. */ ; if ((fval > NUM_MAX || fval < NUM_MIN) && (flags & TN_ISINT)) flags ^= TN_ISINT /* make fval follow ival, otherwise, give ival special * value. *Never* should float->int conversion happen * in this code; it should be user-enforced. * Setting ival to 0 may help show any such behaviour as a bug. */ ; if (flags & TN_ISINT) fval = ival ; else ival = 0 ; } else { mcxErr(me, "panicking at toktype <%ld>", (long) op->toktype) ; return STATUS_FAIL ; } if (err) { mcxErr ( me , "op <%s> id <%ld> class <%ld> not yet supported" , op->token->str , (long) op->opid , (long) op->optype ) ; return STATUS_FAIL ; } if (flags & TN_ISNAN) { mcxErr(me, "arithmetic exception for op <%s>", op->token->str) ; return STATUS_FAIL ; } if (!(new = tnNewToken("_eval_", TOKEN_CONST, fval, ival))) return STATUS_FAIL ; new->flags = flags /* mq need overflow check, nan check etc */ ; tnLink3(lft->prev, new, rgt->next) ; if (tnFree(lft, rgt)) return STATUS_FAIL ; } return STATUS_OK ; } static fun1Hook* getfun1id ( tn* start ) { fun1Hook *fh = fun1HookDir+0 ; while (fh->funname && strcmp(fh->funname, start->token->str)) fh++ ; return fh->funname ? fh : NULL ; } static fun2Hook* getfun2id ( tn* start ) { fun2Hook *fh = fun2HookDir+0 ; while (fh->funname && strcmp(fh->funname, start->token->str)) fh++ ; return fh->funname ? fh : NULL ; } static tn* funcx ( tn* start , tn* end ) { tn *new, *arg = end->prev ; real fval = 0.0 ; num ival = 0 ; i32 flags = 0 ; int n_args = arg->toktype == TOKEN_CONST ; int err = 0 ; const char* me = "funcx" ; const char* fn = "_init_" ; if ( start->toktype != TOKEN_FUN || start->next->toktype != TOKEN_OPEN || end->toktype != TOKEN_CLOSE ) { mcxErr(me, "wrong toktype - ids (%p, %p)", (void*) start, (void*) end) ; dump(start, 0, NULL) ; return NULL ; } while ( arg->toktype == TOKEN_CONST && arg->prev->toktype == TOKEN_COMMA ) arg = arg->prev->prev , n_args++ ; if (arg->prev != start->next) { mcxErr(me, "this function foo is not the right foo") ; dump(start, 0, NULL) ; return NULL ; } if (n_args == 1) { tn* op1 = arg ; fun1Hook* fh = getfun1id(start) ; if (fh) { fn = fh->funname ; if (fh->funflags & FUN_SPECIAL) { if (!strcmp(fn, "abs")) { if (tn_isint(op1)) { ival = op1->ival > 0 ? op1->ival : -op1->ival ; flags |= TN_ISINT ; } else fval = op1->fval > 0 ? op1->fval : -op1->fval ; } else if (!strcmp(fn, "bits")) { if (tn_isint(op1)) { ival = op1->ival ; flags |= TN_ISINT /* mq show the damn bits */ ; } else fval = op1->fval /* mq show the damn bits */ ; } else err = 1 ; } else { fval = (fh->funcd)(op1->fval) ; if ( fh->funflags & FUN_INTRESULT && fval <= NUM_MAX && fval >= NUM_MIN ) { flags |= TN_ISINT ; ival = (num) fval > 0 ? fval+0.5 : fval - 0.5 ; } } } else err = 1 ; } else if (n_args == 2) { tn* op1 = arg, *op2 = op1->next->next ; fun2Hook* fh = getfun2id(start) ; if (fh) { fn = fh->funname ; if (tn_isint(op1) && tn_isint(op2) && fh->funcl) { ival = (fh->funcl)(op1->ival, op2->ival) ; flags |= TN_ISINT ; } else fval = (fh->funcd)(op1->fval, op2->fval) ; } else err = 1 ; } else err = 1 ; if (err) { mcxErr ( me , "<%s> [%d] not supported" , start->token->str , n_args ) ; return NULL ; } else { if (flags & TN_ISINT) /* fixme. recent addition. document/design fval/ival coupling */ fval = ival ; else ival = 0 ; if (!(new = tnNewToken(fn, TOKEN_CONST, fval, ival))) return NULL ; new->flags = flags ; } if (debug_g) dump(new, 1, "funcx") ; return new ; } static tn* match ( tn* start ) { int depth = 1 ; if (start->toktype != TOKEN_OPEN) { mcxErr("match", "node <%p> has wrong toktype", (void*) start) ; return NULL ; } while (start->next) { start = start->next ; if (start->toktype == TOKEN_OPEN) depth++ ; else if (start->toktype == TOKEN_CLOSE) { depth-- ; if (!depth) break ; } } return depth ? NULL : start ; } /* * must leave received start and corresponding end alone */ static mcxstatus compute ( tn* start ) { tn* ptr, *new, *end ; const char* me = "compute" ; if (start->toktype != TOKEN_OPEN) { mcxErr(me, "node <%p> has wrong toktype", (void*) start) ; return(STATUS_FAIL) ; } if (!(end = match(start))) { mcxErr(me, "node <%p> has no match", (void*) start) ; return(STATUS_FAIL) ; } ptr = start->next ; while (ptr) /* ok by the naming police? */ { tn* eosc, *val ; if (ptr->toktype == TOKEN_FUN) { if (compute(ptr->next)) return STATUS_FAIL /* now:: LPT op CM [op CM]* RPT */ ; eosc = match(ptr->next) ; if (!eosc || !(val = funcx(ptr, eosc))) return STATUS_FAIL /* now:: fun LPT val RPT */ ; tnLink3(ptr->prev, val, eosc->next) ; if (tnFree(ptr, eosc)) return STATUS_FAIL ; ptr = val->next ; } else if (ptr->toktype == TOKEN_OPEN) { if (compute(ptr)) return STATUS_FAIL ; if (!(eosc = match(ptr))) /* should check singularity */ return STATUS_FAIL ; if (!(val = tnDup(eosc->prev, "_scope_"))) return STATUS_FAIL ; tnLink3(ptr->prev, val, eosc->next) ; if (tnFree(ptr, eosc)) return STATUS_FAIL ; ptr = val->next ; } /* should check presence TRICATCH */ else if (ptr->toktype == TOKEN_TRIOP) { tn* br1 = ptr->next, *br2, *eobr1, *eobr2 /* branches */ ; if (!(eobr1 = match(br1))) return STATUS_FAIL ; if (!(br2 = eobr1->next->next)) return STATUS_FAIL ; eobr2 = match(br2) ; if (ptr->prev->fval) /* mqmq! logic by fval */ { if (compute(br1)) return STATUS_FAIL ; if (!(new = tnDup(br1->next, "triop1"))) return STATUS_FAIL ; tnLink3(ptr->prev->prev, new, eobr2->next) ; if (tnFree(ptr->prev, eobr2)) return STATUS_FAIL ; } else { if (compute(br2)) return STATUS_FAIL ; if (!(new = tnDup(br2->next, "triop2"))) return STATUS_FAIL ; tnLink3(ptr->prev->prev, new, eobr2->next) ; if (tnFree(ptr->prev, eobr2)) return STATUS_FAIL ; } ptr = new->next ; } else if (ptr->toktype == TOKEN_AND) /* now:: val AND LPT any RPT */ { tn* pivot = ptr->prev, *clause=ptr->next, *after ; if (pivot->fval) { if (compute(clause)) return STATUS_FAIL /* should check singularity of result */ /* lpt val rpt ? */ ; after = clause->next->next->next /* oops, ugly dugly */ ; pivot->fval = clause->next->fval /* mqmq! logic by fval */ ; if (tnFree(pivot->next, after->prev)) return STATUS_FAIL ; tnLink2(pivot, after) ; ptr = after ; } else { tn* eoclause = match(clause) ; tn* any = eoclause ? eoclause->next : NULL ; if (!eoclause || tnFree(pivot->next, eoclause)) return STATUS_FAIL ; tnLink2(pivot, any) ; ptr = any ; } pivot->ival = pivot->fval ? 1 : 0 ; pivot->flags |= TN_ISINT ; } else if (ptr->toktype == TOKEN_OR) { tn* pivot = ptr->prev, *clause=ptr->next, *after ; if (pivot->fval) { tn* eoclause = match(clause) ; tn* any = eoclause ? eoclause->next : NULL ; if (!eoclause || tnFree(pivot->next, eoclause)) return STATUS_FAIL ; tnLink2(pivot, any) ; ptr = any ; } else { if (compute(clause)) return STATUS_FAIL /* should check singularity of result */ ; after = clause->next->next->next /* oops, ugly dugly */ ; pivot->fval = clause->next->fval /* mqmq! logic by fval */ ; if (tnFree(pivot->next, after->prev)) return STATUS_FAIL ; tnLink2(pivot, after) ; ptr = after ; } pivot->ival = pivot->fval ? 1 : 0 ; pivot->flags |= TN_ISINT ; } else if (ptr->toktype == TOKEN_CLOSE) break ; else ptr = ptr->next ; } /* NOTE: by design we should always have ptr != NULL * that makes the clause to the while (ptr) { } loop * above a bit dodgy. */ if (ptr != end || ptr->toktype != TOKEN_CLOSE) { mcxErr(me, "ptr does not close") ; dump(ptr->prev, 0, NULL) ; return STATUS_FAIL ; } if (flatten(start, ptr)) return STATUS_FAIL ; return STATUS_OK ; } static mcxstatus getatom ( telRaam* raam ) { i32 toktype = gettoken(raam, EXPECT_ATOM) ; const char* me = "getatom" ; if (toktype < 0) { mcxErr(me, "unexpected token <%s>", raam->token->str) ; return STATUS_FAIL ; } ; if (toktype == TOKEN_UNIOP) { if (tnPushToken(raam)) return STATUS_FAIL ; if (getatom(raam)) return STATUS_FAIL ; } else if (toktype == TOKEN_OPEN) { if (getexpression(raam)) return STATUS_FAIL ; if ((toktype = gettoken(raam, EXPECT_ANY)) != TOKEN_CLOSE) { mcxErr(me, "no close (token <%ld>)", (long) toktype) ; return STATUS_FAIL ; } if (raam->depth < 0) { mcxErr(me, "spurious rpth (atom I)") ; return STATUS_FAIL ; } } else if (toktype == TOKEN_FUN) { if (tnPushToken(raam)) return STATUS_FAIL ; if (tnPushThis(raam, "_open_", TOKEN_OPEN)) return STATUS_FAIL ; if ((toktype = gettoken(raam, EXPECT_ANY)) != TOKEN_OPEN) { mcxErr(me, "expect '(' after function symbol") ; return STATUS_FAIL ; } while(1) { if (getexpression(raam)) return STATUS_FAIL ; if (gettoken(raam, EXPECT_ANY) == TOKEN_COMMA) { if (tnPushToken(raam)) return STATUS_FAIL ; } else { untoken(raam) ; break ; } } if ((toktype = gettoken(raam, EXPECT_ANY)) != TOKEN_CLOSE) { mcxErr(me, "expect ')' closing function symbol") ; return STATUS_FAIL ; } if (tnPushThis(raam, "_close_", TOKEN_CLOSE)) return STATUS_FAIL ; } else if (toktype == TOKEN_CONST) { if (tnPushToken(raam)) return STATUS_FAIL ; } else if (toktype == TOKEN_CLOSE) { mcxErr(me, "empty group not allowed") ; return STATUS_FAIL ; } else if (toktype == TOKEN_USER) { if (tnPushToken(raam)) return STATUS_FAIL ; } else { mcxErr(me, "unexpected token <%s> (atom)", raam->token->str) ; return STATUS_FAIL ; } return STATUS_OK ; } static mcxstatus getexpression ( telRaam* raam ) { i32 toktype ; const char* me = "getexpression" ; raam->depth++ ; if (tnPushThis(raam, "_open_", TOKEN_OPEN)) return STATUS_FAIL ; while (1) { if (getatom(raam)) return STATUS_FAIL ; toktype = gettoken(raam, EXPECT_ANY) ; if (toktype == TOKEN_BINOP) { if (tnPushToken(raam)) return STATUS_FAIL ; } else if (toktype == TOKEN_AND) { if (tnPushThis(raam, "_close_", TOKEN_CLOSE)) return STATUS_FAIL ; if (tnPushToken(raam)) return STATUS_FAIL ; if (tnPushThis(raam, "_open_", TOKEN_OPEN)) return STATUS_FAIL ; } else if (toktype == TOKEN_OR) { if (tnPushThis(raam, "_close_", TOKEN_CLOSE)) return STATUS_FAIL ; if (tnPushToken(raam)) return STATUS_FAIL ; if (tnPushThis(raam, "_open_", TOKEN_OPEN)) return STATUS_FAIL ; } else if (toktype == TOKEN_TRIOP) { if (tnPushThis(raam, "_close_", TOKEN_CLOSE)) return STATUS_FAIL ; if (tnPushToken(raam)) return STATUS_FAIL ; if (tnPushThis(raam, "_open_", TOKEN_OPEN)) return STATUS_FAIL ; if (getexpression(raam)) return STATUS_FAIL ; if (tnPushThis(raam, "_close_", TOKEN_CLOSE)) return STATUS_FAIL ; toktype = gettoken(raam, EXPECT_ANY) ; if (toktype != TOKEN_TRICATCH) { mcxErr ( me , "unexpected token <%s> (expression)" , raam->token->str ) ; return STATUS_FAIL ; } if (tnPushToken(raam)) return STATUS_FAIL ; if (tnPushThis(raam, "_open_", TOKEN_OPEN)) return STATUS_FAIL ; } else if ( toktype == TOKEN_COMMA || toktype == TOKEN_CLOSE || toktype == TOKEN_EXH || toktype == TOKEN_TRICATCH ) { untoken(raam) ; break ; } else { mcxErr ( me , "unexpected token <%s> <%ld> (expression)" , raam->token->str , (long) toktype ) ; return STATUS_FAIL ; } } if (tnPushThis(raam, "_close_", TOKEN_CLOSE)) return STATUS_FAIL ; raam->depth-- ; return STATUS_OK ; } mcxstatus trmParse ( telRaam* raam ) { if (tnPushThis(raam, "_open_", TOKEN_OPEN)) return STATUS_FAIL ; if (getexpression(raam)) return STATUS_FAIL ; if (tnPushThis(raam, "_close_", TOKEN_CLOSE)) return STATUS_FAIL ; if (gettoken(raam, EXPECT_ANY) != TOKEN_EXH) { mcxErr("trmParse", "spurious token <%s>", raam->token->str) ; return STATUS_FAIL ; } return STATUS_OK ; } void trmRegister ( telRaam* raam cpl__unused , int (user_parse)(mcxTing* txt, int offset) , mcxenum (user_eval)(const char* token, long *ival, double *fval) , char user_char ) { user_parse_g = user_parse ; user_eval_g = user_eval ; user_char_g = user_char ; } int trmEval ( telRaam* raam , long* lp , double* fp ) { tn* result ; mcxstatus stat = compute(raam->start->next) ; result = stat ? NULL : (raam->start->next->next) ; if (result) { *lp = result->ival ; *fp = result->fval ; return result->flags ; } return -1 ; } static int trmStack ( telRaam* raam ) { tn* result ; mcxstatus stat = compute(raam->start->next) ; return stat ; } cimfomfa-21-361/tingea/let.h000066400000000000000000000024201416241612100155660ustar00rootroot00000000000000/* (C) Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Stijn van Dongen * (C) Copyright 2008, 2009, 2010, 2011 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_let #define tingea_let #include "types.h" #include "ting.h" #define TRM_FAIL 0 #define TRM_ISNUM 1 #define TRM_ISREAL 2 #define TRM_ISINF 3 #define TRM_ISNAN 4 typedef struct telRaam telRaam; telRaam* trmInit ( const char* str ) ; mcxstatus trmExit ( telRaam* raam ) ; mcxstatus trmParse ( telRaam* raam ) ; int trmEval ( telRaam* raam , long* lp , double* fp ) ; void trmRegister ( telRaam* raam , int (user_parse)(mcxTing* txt, int offset) , mcxenum (user_eval)(const char* token, long *ival, double *fval) , char user_char ) ; mcxbool trmError ( int flags ) ; mcxbool trmIsReal ( int flags ) ; mcxbool trmIsNum ( int flags ) ; mcxbool trmIsNan ( int flags ) ; mcxbool trmIsInf ( int flags ) ; void trmDump ( telRaam* raam , const char* msg ) ; void trmDebug ( void ) ; #endif cimfomfa-21-361/tingea/list.c000066400000000000000000000111031416241612100157460ustar00rootroot00000000000000/* (C) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include "list.h" #include "alloc.h" #include "gralloc.h" #include "compile.h" #define DEBUG 0 /* TODO. very funny interface. in flux. * * ! allow null argument for linkdelete. * * ! * little support for corruption checking. * is the spawn thing a good idea ? * ! * interface with list object, or not? * not requires hidden list pointer everywhere (have that now). * perhaps supply separate interface with list handle .. ?] * ! * how to unify FLink, BLink, and link (forward/backward/bidi) * optify hidden list pointer, next xor prev pointer. * * - Add triple sanity checks for user supplied data (?) * - implement val freeing. * - with deleting, should warn if no handle remains .. * and can check grim count. */ /* Note. * We very much do not want to define (as previously thought) next and prev * as const pointers (with the goal of keeping chain consistency up * to this interface). * This interface provides some convenience interfaces, but * the integrity and life-cycle of the chains built with the links * is entirely up to the caller. So tie-rap away with them links. * * So we do not keep track of list characteristics, * e.g. first, last, count. That would be something for a higher layer. */ typedef struct { mcxGrim* grim ; } mcx_list ; typedef struct lsptr { mcx_list* ls ; } lsptr ; #define mcx_list_find(lk) ((lsptr*)((void*)((char*) lk - sizeof(lsptr))))->ls static void mcx_link_init ( mcxLink* lk , void* val ) { lk->next = NULL ; lk->prev = NULL ; lk->val = val ; } static mcxLink* mcx_list_shift ( mcx_list* ls , void* val ) { void* mem ; mcxLink* lk ; if (!(mem = mcxGrimGet(ls->grim))) return NULL ; lk = (void*) ((char*) mem + sizeof(lsptr)) ; ((lsptr*) mem)->ls = ls ; mcx_link_init(lk, val) ; return lk ; } mcxLink* mcxListSource ( dim capacity_start , mcxbits options ) { mcx_list* ls ; if (!(ls = mcxAlloc(sizeof(mcx_list), RETURN_ON_FAIL))) return NULL #if DEBUG ; fprintf (stderr, "new list ptr <%p> capacity <%ld>\n", (void*) ls, (long) capacity_start) #endif ; if (! (ls->grim = mcxGrimNew(sizeof(lsptr) + sizeof(mcxLink), capacity_start, options) ) ) return NULL ; return mcx_list_shift(ls, NULL) ; } mcxLink* mcxLinkSpawn ( mcxLink* lk , void* val ) { mcx_list* ls = mcx_list_find(lk) ; return mcx_list_shift(ls, val) ; } void mcxLinkClose ( mcxLink* left , mcxLink* right ) { if (left) left->next = right ; if (right) right->prev = left ; } mcxLink* mcxLinkBefore ( mcxLink* next , void* val ) { mcx_list* ls = mcx_list_find(next) ; mcxLink* new = mcx_list_shift(ls, val) ; if (!new) return NULL ; new->next = next ; new->prev = next->prev ; next->prev = new ; if (new->prev) new->prev->next = new ; return new ; } mcxLink* mcxLinkAfter ( mcxLink* prev , void* val ) { mcx_list* ls = mcx_list_find(prev) ; mcxLink* new #if DEBUG ; fprintf(stderr, "list ptr <%p>\n", (void*) ls) #endif ; new = mcx_list_shift(ls, val) ; if (!new) return NULL ; new->prev = prev ; new->next = prev->next ; prev->next = new ; if (new->next) new->next->prev = new ; return new ; } void mcxLinkRemove ( mcxLink* lk ) { mcx_list* ls = mcx_list_find(lk) ; mcxGrimLet(ls->grim, ((char*) lk) - sizeof(lsptr)) ; } mcxLink* mcxLinkDelete ( mcxLink* lk ) { mcx_list* ls = mcx_list_find(lk) ; mcxLink* prev = lk->prev ; mcxLink* next = lk->next ; if (prev) prev->next = next ; if (next) next->prev = prev ; mcxGrimLet(ls->grim, ((char*) lk) - sizeof(lsptr)) ; return lk ; } mcxGrim* mcxLinkGrim ( mcxLink* lk ) { mcx_list* ls = mcx_list_find(lk) ; return ls->grim ; } void mcxListFree ( mcxLink** lkp , void freeval(void* valpp) cpl__unused /* (yourtype1** valpp) */ ) { if (*lkp) { mcx_list* ls = mcx_list_find(*lkp) ; mcxGrimFree(&(ls->grim)) ; mcxFree(ls) ; *lkp = NULL ; } ; } #undef DEBUG cimfomfa-21-361/tingea/list.h000066400000000000000000000064101416241612100157600ustar00rootroot00000000000000/* (C) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_list_h #define tingea_list_h #include "gralloc.h" #include "types.h" /* TODO: * - linkDelete linkRemove semantics interface documentation. * - make prev xor next link optional. * - make hidden pointer optional. * - provide interface that uses list struct. * - convenience interface for tying two chains together. * - list-to-array interface. */ /* * History. * The data structure used is similar to that by Jan van der Steen's pool.c * code, which used to be part of this library. So kudos to Jan. The * present implementation, which is a bit different, was not directly copied * nor modified. It descended from a botched linked list implementation * having it's own buffered storage. Only at that time I realized that the * right solution for lists and hashes is to have a private pool of gridmem, * rather than deriving it from a global pool (so that we still can defer * thread-safety to malloc). Right? * The present implementation was then derived from the botched linked list * and sanitized afterwards. The linked list.c is still slightly botched. */ /* Description * This provides a doubly linked list/link interface with buffered storage * (invisible to the user). The current interface operates entirely via * links, the commanding structure is hidden. Other interface types may * arise later. * * You can create a number of chains drawing memory from the same pool. * * It only provides basic link insertions and deletions as a convenience * interface, and does not maintain consistency checks, neither on links, * nor on storage. */ typedef struct mcxLink { struct mcxLink* next ; struct mcxLink* prev ; void* val ; } mcxLink ; /* Options: * same as for mcxGrimNew */ mcxLink* mcxListSource ( dim capacity_start , mcxbits options ) ; /* * This removes all links that have the same parent link as lk. [huh?] * BEWARE freeval doesn't do anything yet */ void mcxListFree ( mcxLink** lk , void freeval(void* valpp) /* (yourtype1** valpp) */ ) ; /* Creates new chain, that can later be tied to other chains. */ mcxLink* mcxLinkSpawn ( mcxLink* lk , void* val ) ; /* * This inspects prev and next and links them if possible. * * You can use the val pointer, immediately after deleting. * That makes it unsafe in threads (but you need locking anyway). * The feature is used in the hash library. */ mcxLink* mcxLinkDelete ( mcxLink* lk ) ; /* * This just deallocates the link. */ void mcxLinkRemove ( mcxLink* lk ) ; mcxLink* mcxLinkAfter ( mcxLink* prev , void* val ) ; mcxLink* mcxLinkBefore ( mcxLink* prev , void* val ) ; void mcxLinkClose ( mcxLink* left , mcxLink* right ) ; /* * Get the grim that serves this list */ mcxGrim* mcxLinkGrim ( mcxLink* lk ) ; #endif cimfomfa-21-361/tingea/minmax.h000066400000000000000000000043351416241612100163020ustar00rootroot00000000000000/* (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef minmax_h #define minmax_h #include "compile.h" #if MCX_GNUC_OK && TINGEA__TYPED_MINMAX /* these buggers do not nest, which I dislike */ # define MCX_MAX(x,y) \ ( { const typeof(x) _x = x; \ const typeof(y) _y = y; \ (void) (&_x == &_y); \ _x > _y ? _x : _y; \ } ) # define MCX_MIN(x,y) \ ( { const typeof(x) _x = x; \ const typeof(y) _y = y; \ (void) (&_x == &_y); \ _x < _y ? _x : _y; \ } ) #else /* The usual brain-damaged min and max, which do nest though. */ # define MCX_MAX(a,b) ((a)>(b) ? (a) : (b)) # define MCX_MIN(a,b) ((a)<(b) ? (a) : (b)) #endif #define ABS(x) ((x) > 0 ? (x) : (x) < 0 ? (-(x)) : 0) /* The first version cannot be used recursively. * I don't like this at all I think, which is why I turned it off. */ #if 0 && MCX_GNUC_OK # define MCX_SIGN(a) \ __extension__ \ ( { typedef _ta = (a) \ ; _ta _a = (a) \ ; _a > 0 \ ? 1 \ : _a < 0 \ ? -1 \ : 0 \ ; } \ ) #else # define MCX_SIGN(a) \ ((a) > 0 ? 1 : !(a) ? 0 : -1) #endif #define MCX_RESTRICT(x,a,b) \ do { if (x < a) x = a; else if (x > b) x = b; } while (0) #endif cimfomfa-21-361/tingea/opt.c000066400000000000000000000536131416241612100156110ustar00rootroot00000000000000/* (C) Copyright 2002, 2003, 2004, 2005, 2006 Stijn van Dongen * (C) Copyright 2007, 2008, 2009, 2010 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ /* TODO * does display skip account for hidden options? */ #include #include #include #include #include "opt.h" #include "alloc.h" #include "types.h" #include "ding.h" #include "err.h" #include "equate.h" #include "minmax.h" #include "compile.h" static int strcmp_void ( const void* s1 , const void* s2 ) { return strcmp(s1, s2) ; } mcxHash* mcxOptHash ( mcxOptAnchor* opts , mcxHash* hash ) { mcxOptAnchor* anch = opts ? opts+0 : NULL ; hash = hash ? hash : mcxHashNew ( 100 , mcxStrHash , strcmp_void ) ; if (!hash) return NULL ; while (anch && anch->tag) { mcxKV* kv = mcxHashSearch(anch->tag, hash, MCX_DATUM_INSERT) ; if (!kv) { mcxHashFree(&hash, NULL, NULL) ; return NULL ; } if (kv->val) mcxErr ( "mcxOptHash" , "warning: option <%s> already present" , anch->tag ) ; kv->val = anch ; anch++ ; } return hash ; } void mcxOptHashFree ( mcxHash** hashpp ) { mcxHashFree(hashpp, NULL, NULL) ; } static void* mcxOptInit ( void* opt ) { mcxOption* option = opt ; option->anch = NULL ; option->val = NULL ; return option ; } mcxOptAnchor* mcxOptFind ( char* tag , mcxHash* hopts ) { mcxKV* kv = mcxHashSearch(tag, hopts, MCX_DATUM_FIND) ; return kv ? (mcxOptAnchor*) kv->val : NULL ; } static mcxOption* mcxOptParse__ ( mcxHash* opthash , char** argv , int argc , int prefix /* skip these */ , int suffix /* skip those too */ , int* n_elems_read , mcxstatus* status ) { char** argp = argv+prefix ; char** argl = argv+argc-suffix /* arg last */ ; mcxbool do_exhaust = n_elems_read ? TRUE : FALSE /* fixme: very ugly internal iface*/ ; mcxOption* opts = mcxNAlloc (argc+1, sizeof(mcxOption), mcxOptInit, RETURN_ON_FAIL) ; mcxOption* opt = opts ; if (!opts) { *status = MCX_OPT_STATUS_NOMEM ; return NULL ; } *status = MCX_OPT_STATUS_OK ; if (do_exhaust) *n_elems_read = 0 ; while (argp < argl) { char* arg = *argp ; const char* embedded_val = NULL ; mcxKV* kv = mcxHashSearch(arg, opthash, MCX_DATUM_FIND) ; mcxOptAnchor* anch = kv ? (mcxOptAnchor*) kv->val : NULL ; const char* eq = strchr(arg, '=') ; if (!kv && eq) { char argcpy[501] ; if (eq - arg < 500) { strncpy(argcpy, arg, (eq-arg)) ; argcpy[eq-arg] = '\0' ; if ( !strncmp(argcpy, "--", 2) && (kv = mcxHashSearch(argcpy+1, opthash, MCX_DATUM_FIND)) && (anch = (mcxOptAnchor*) kv->val) ) embedded_val = eq+1 ; else kv = NULL ; } else { /* fimxe do sth */ } } ; if (kv) { opt->anch = anch ; if (do_exhaust) (*n_elems_read)++ ; if (embedded_val) opt->val = embedded_val ; else if (anch->flags & MCX_OPT_HASARG) { argp++ ; if (argp >= argl) { mcxErr("mcxOptParse", "option <%s> takes value", anch->tag) ; *status = MCX_OPT_STATUS_NOARG ; break ; } opt->val = *argp /* mq note: shallow copy */ ; if (do_exhaust) (*n_elems_read)++ ; } } else { if (do_exhaust) break ; else { mcxErr("mcxOptParse", "unsupported option <%s>", arg) ; *status = MCX_OPT_STATUS_UNKNOWN ; break ; } } argp++ ; opt++ ; } if (*status) mcxOptFree(&opts) ; return opts ; } mcxOption* mcxOptExhaust ( mcxOptAnchor *anch , char **argv , int argc , int prefix /* skip these */ , int *n_elems_read , mcxstatus *status ) { mcxHash* opthash = mcxOptHash(anch, NULL) ; mcxOption* opts = mcxOptParse__ (opthash, argv, argc, prefix, 0, n_elems_read, status) ; mcxOptHashFree(&opthash) ; return opts ; } mcxOption* mcxOptParse ( mcxOptAnchor *anch , char **argv , int argc , int prefix /* skip these */ , int suffix /* skip those too */ , mcxstatus *status ) { mcxHash* opthash = mcxOptHash(anch, NULL) ; mcxOption* opts = mcxOptParse__(opthash, argv, argc, prefix, suffix, NULL, status) ; mcxOptHashFree(&opthash) ; return opts ; } mcxOption* mcxHOptExhaust ( mcxHash *opthash , char **argv , int argc , int prefix /* skip these */ , int *n_elems_read , mcxstatus *status ) { return mcxOptParse__ (opthash, argv, argc, prefix, 0, n_elems_read, status) ; } mcxOption* mcxHOptParse ( mcxHash *opthash , char **argv , int argc , int prefix /* skip these */ , int suffix /* skip those too */ , mcxstatus *status ) { return mcxOptParse__(opthash, argv, argc, prefix, suffix, NULL, status) ; } void mcxOptFree ( mcxOption** optpp ) { if (*optpp) mcxFree(*optpp) ; *optpp = NULL ; } void mcxUsage ( FILE* fp , const char* caller , const char** lines ) { int i = 0 ; while(lines[i]) { fprintf(fp, "%s\n", lines[i]) ; i++ ; } fprintf(fp, "[%s] Printed %d lines\n", caller, i+1) ; } static int (*rltFunctions[8])(const void* f1, const void* f2) = { intGt , intGq , fltGt, fltGq , intLt , intLq , fltLt, fltLq } ; int mcxOptPrintDigits = 5; const char* rltSigns[8] = { "(", "[", "(", "[" , ")", "]", ")", "]" } ; /* * todo: NULL lftbound argument & non-NULL lftRelate argument * idem for rgt */ static int checkBoundsUsage ( unsigned char type , void* var cpl__unused , int (*lftRlt) (const void*, const void*) , void* lftBound , int (*rgtRlt) (const void*, const void*) , void* rgtBound ) { int i ; const char* me = "checkBoundsUsage PBD" ; if (type != 'f' && type != 'i') { mcxErr(me, "unsupported checkbound type <%c>", type) ; return 1 ; } if ((lftRlt && !lftBound)||(!lftRlt && lftBound)) { mcxErr(me, "abusive lftRlt lftBound combination") ; return 1 ; } if ((rgtRlt && !rgtBound)||(!rgtRlt && rgtBound)) { mcxErr(me, "abusive rgtRlt rgtBound combination") ; return 1 ; } if (lftRlt) { for(i=0;i<4;i++) if (lftRlt == rltFunctions[i]) break ; if (i == 4) { mcxErr(me, "lftRlt should use gt or gq arg") ; return 1 ; } ; } if (rgtRlt) { for(i=4;i<8;i++) if (rgtRlt == rltFunctions[i]) break ; if (i==8) { mcxErr(me, "rgtRlt should use lt or lq arg") ; return 1 ; } ; } return 0 ; } /* returns * STATUS_OK for matching bounds * STATUS_FAIL for non-matching bounds * STATUS_CB_PBD for internal error. */ enum { STATUS_CB_PBD = STATUS_UNUSED + 1 } ; static mcxstatus checkBounds ( unsigned char type , void* var , int (*lftRlt) (const void*, const void*) , void* lftBound , int (*rgtRlt) (const void*, const void*) , void* rgtBound ) { int lftOk, rgtOk ; if (checkBoundsUsage(type, var, lftRlt, lftBound, rgtRlt, rgtBound)) { mcxErr("checkBounds PBD", "internal error -- cannot validate") ; return STATUS_CB_PBD ; } lftOk = !lftRlt || lftRlt(var, lftBound) ; rgtOk = !rgtRlt || rgtRlt(var, rgtBound) ; return (lftOk && rgtOk) ? STATUS_OK : STATUS_FAIL ; } static mcxTing* checkBoundsRange ( unsigned char type , void* var cpl__unused , int (*lftRlt) (const void*, const void*) , void* lftBound , int (*rgtRlt) (const void*, const void*) , void* rgtBound ) { mcxTing* textRange = mcxTingEmpty(NULL, 40) ; char* lftToken = (char *) "" ; int i ; if (!textRange) return NULL ; if (lftRlt) { for(i=0;i<4;i++) if (lftRlt == rltFunctions[i]) break ; if (i<4) lftToken = (char *) rltSigns[i] ; } else lftToken = (char *) "(" ; mcxTingPrint(textRange, "%s", lftToken) /* * This might fail due to mem shortage; * we ignore and simply keep plodding on with more mcxTingPrint-s * below. It's actually pretty inconceivable, since we alloced * 40 bytes - it depends on mcxOptPrintDigits. */ ; if (lftBound) { if (type == 'f') mcxTingPrintAfter (textRange, "%.*f", mcxOptPrintDigits, *((float*)lftBound)) ; else if (type == 'i') mcxTingPrintAfter(textRange, "%d", *((int*)lftBound)) ; } else mcxTingPrintAfter(textRange, "%s", "<-") ; mcxTingPrintAfter(textRange, "%s", ",") ; if (rgtBound) { if (type == 'f') mcxTingPrintAfter (textRange, "%.*f", mcxOptPrintDigits, *((float*)rgtBound)) ; else if (type == 'i') mcxTingPrintAfter(textRange, "%d", *((int*)rgtBound)) ; } else mcxTingPrintAfter(textRange, "%s", "->") ; if (rgtRlt) { for(i=4;i<8;i++) if (rgtRlt == rltFunctions[i]) break ; if (i<8) rgtToken = (char *) rltSigns[i] ; } else rgtToken = (char *) ")" ; mcxTingPrintAfter(textRange, "%s", rgtToken) ; return textRange ; } mcxbool mcxOptCheckBounds ( const char* caller , const char* flag , unsigned char type , void* var , int (*lftRlt) (const void*, const void*) , void* lftBound , int (*rgtRlt) (const void*, const void*) , void* rgtBound ) { mcxTing* textRange ; mcxstatus stat = checkBounds(type, var, lftRlt, lftBound, rgtRlt, rgtBound) ; if (stat == STATUS_CB_PBD) { mcxErr("mcxOptCheckBounds", "cannot validate option %s", flag) ; return FALSE ; } else if (stat == STATUS_FAIL) { if (! ( textRange = checkBoundsRange ( type , var , lftRlt , lftBound , rgtRlt , rgtBound ) ) ) return FALSE ; mcxErr ( caller , "%s argument to %s should be in range %s" , type == 'i' ? "integer" : type == 'f' ? "float" : "MICANS" , flag , textRange->str ) ; mcxTingFree(&textRange) ; return FALSE ; } return TRUE ; } static int mcxOptAnchorCmpId ( const void *a1 , const void *a2 ) { const mcxOptAnchor* A1 = a1 ; const mcxOptAnchor* A2 = a2 ; return A1->id < A2->id ? -1 : A1->id - A2->id ; } static int mcxOptAnchorCmpTag ( const void *a1 , const void *a2 ) { const mcxOptAnchor* A1 = a1 ; const mcxOptAnchor* A2 = a2 ; return A1->tag && A2->tag ? strcmp(A1->tag, A2->tag) : A1->tag ? -1 : 1 ; } void mcxOptAnchorSortByTag ( mcxOptAnchor *anchors , dim n_anchors ) { if (n_anchors) qsort(anchors, n_anchors, sizeof(mcxOptAnchor), mcxOptAnchorCmpTag) ; } void mcxOptAnchorSortById ( mcxOptAnchor *anchors , dim n_anchors ) { if (n_anchors) qsort(anchors, n_anchors, sizeof(mcxOptAnchor), mcxOptAnchorCmpId) ; } static void parse_descr ( const char* field , const char** descrp , const char** markp , int* mark_width ) { const char* m = strstr(field, "\tM") ; const char* n = m ? strstr(m+2, "\t") : NULL ; const char* d = strstr(field, "\tD") ; if (m && n) *mark_width = n - m - 2 /* truncintok */ , *markp = m + 2 ; else *markp = "" , *mark_width = 0 ; *descrp = d ? d + 2 : field ; } void mcxOptApropos ( FILE* fp , const char* me cpl__unused , const char* syntax , int width , mcxbits display , const mcxOptAnchor opt[] ) { const mcxOptAnchor *baseopt = opt ; mcxTing* scr = mcxTingEmpty(NULL, 100) ; int id_prev = -1 ; const char* descr_usage, *descr_mark ; int mark_width = 0, mark_width_max = 0 ; int mywidth = 0 ; if (syntax) fprintf(fp, "%s\n\n", syntax) ; for (opt = baseopt; opt->tag; opt++) { int thislen = strlen(opt->tag) /* truncintok */ ; if (opt->descr_arg) thislen += 1 + strlen(opt->descr_arg) /* truncintok */ ; if ( !(opt->flags & MCX_OPT_HIDDEN) || display & MCX_OPT_DISPLAY_HIDDEN ) mywidth = MCX_MAX(mywidth, thislen) ; if (opt->descr_usage) { parse_descr (opt->descr_usage, &descr_usage, &descr_mark, &mark_width) ; mark_width_max = MCX_MAX(mark_width_max, mark_width) ; } } if (!width) width = mywidth ; for (opt = baseopt; opt->tag; opt++) { const char* skip = "" ; const char* hidden = opt->flags & MCX_OPT_HIDDEN ? " ___" : "" ; if ( opt->flags & MCX_OPT_HIDDEN && !(display & MCX_OPT_DISPLAY_HIDDEN) ) { id_prev = opt->id ; continue ; } if (display & MCX_OPT_DISPLAY_SKIP && opt->id - id_prev > 1) skip = "\n" ; id_prev = opt->id ; if (opt->flags & MCX_OPT_HASARG && opt->descr_arg) mcxTingPrint ( scr , "%s%c%s" , opt->tag , ' ' , opt->descr_arg ) ; else mcxTingPrint(scr, "%s", opt->tag) ; fputs(skip, fp) ; if (!opt->descr_usage) { fprintf(fp, "%s\n", scr->str) ; continue ; } if (mark_width_max) { parse_descr (opt->descr_usage, &descr_usage, &descr_mark, &mark_width) ; fprintf(fp, "%-*s", width, scr->str) ; fprintf(fp, " %-*.*s ",(int) mark_width_max,mark_width, descr_mark) ; fprintf(fp, "%s%s\n", descr_usage, hidden) ; } else { fprintf(fp, "%-*s", width, scr->str) ; fprintf(fp, " %s%s\n", opt->descr_usage, hidden) ; } } } char** mcxOptParseString ( char* src , int* argc , unsigned char delim ) { dim srclen = strlen(src) ; dim n_delim = mcxStrCountChar(src, delim, srclen) ; dim n_args = 0 ; char** argv ; char *z = src + srclen ; char *p = src, *os ; *argc = 0 ; if (!srclen) return NULL ; if (!(argv = mcxAlloc(sizeof(char*) * (n_delim+1), RETURN_ON_FAIL))) return NULL ; while (p=z) break ; os = p ; if (!(p = strchr(os, delim))) p = z ; *p = '\0' ; argv[n_args++] = os ; p++ ; } *argc = n_args ; return argv ; } mcxbool mcxOptIsInfo ( const char* arg , mcxOptAnchor* options ) { mcxOptAnchor* opt ; for (opt = options; opt->tag; opt++) if (!strcmp(opt->tag, arg)) break ; return (opt->tag && opt->flags & MCX_OPT_INFO) ? TRUE : FALSE ; } mcxTing* mcxOptArgLine ( const char** argv , int argc , int quote ) { mcxTing* cl = mcxTingEmpty(NULL, 80) ; int i ; const char* ql = "*", *qr = "*" ; if (quote == '[') ql = "[", qr = "]" ; else if (quote == '{') ql = "{", qr = "}" ; else if (quote == '<') ql = "<", qr = ">" ; else if (quote == '(') ql = "(", qr = ")" ; else if (quote == '"') ql = "\"", qr = "\"" ; else if (quote == '\'') ql = "'", qr = "'" ; if (argc) mcxTingPrint(cl, "%s%s%s", ql, argv[0], qr) ; for (i=1;idisp_argc ; const char** argv = bundle->disp_argv ; const char* me = bundle->disp_name ; const char* syntax = bundle->disp_syntax ; mcxOptAnchor* dispatcher_options = bundle->disp_shared ; dim n_options= bundle->n_disp_shared ; mcxDispEntry* entry_dir= bundle->disp_table ; void (*report_version)(const char* me) = bundle->disp_version ; const char* mode_str ; mcxDispHook* hk = NULL ; mcxOption* opts, *opt ; int n_arg_read = 0 ; mcxstatus parseStatus = STATUS_FAIL ; mcxHash *clmOpts, *delgOpts, *mergedOpts ; mcxDispEntry* entry ; int help = argc <= 1 || !strcmp(argv[1], "-h") ? 1 : 0 ; int delg_id_max ; int a ; mcxOptAnchorSortById(dispatcher_options, n_options) ; clmOpts = mcxOptHash(dispatcher_options, NULL) ; delg_id_max = dispatcher_options[n_options-1].id ; if (help) { entry = entry_dir+0 ; fprintf(stdout, "%s\n\n", syntax) ; while(entry->id >= 0) { hk = entry->get_hk() ; if (!(hk->flags & MCX_DISP_HIDDEN)) fprintf(stdout, "%s %s\n", me, hk->syntax) ; entry++ ; } fprintf ( stdout , "\n%s help (invoke manual page for )\n" "help pages should be available for:" , me ) ; entry = entry_dir+0 ; while(entry->id >= 0) { hk = entry->get_hk() ; if (!(hk->flags & MCX_DISP_HIDDEN) && (hk->flags & MCX_DISP_MANUAL)) fprintf(stdout, " %s", hk->name) ; entry++ ; } fputc('\n', stdout) ; exit(0) ; } else if (argc > 1 && !strcmp(argv[1], "--version")) { report_version(me) ; exit(0) ; } else if (argc > 1 && !strcmp(argv[1], "help")) { mcxTing* minime = mcxTingNew(me) ; if (argc != 3) mcxDie ( 1 , me , "help mode requires single trailing mode argument, e.g. %s help %s" , me, (entry_dir+0)->get_hk()->name ) ; entry = entry_dir+0 /* todo unify all entry walking code */ ; while (entry->id >= 0) { hk = entry->get_hk() ; if (!strcmp(hk->name, argv[2])) { mcxTingPrintAfter(minime, "%s", hk->name) ; mcxErr(minime->str, "searching for manual pages using MANPATH variable") ; execlp("man", "man", minime->str, NULL) ; mcxErr(minime->str, "the 'man' program was not found") ; mcxDie(1, me, "make sure PATH is set correctly") ; } entry++ ; } if (entry->id < 0) mcxDie(1, me, "unknown mode <%s>", argv[2]) ; } /* todo emit warning to check for right version of manual page */ mode_str = argv[1] /* Find the mode in which we are invoked */ ; { const char* name ; entry = entry_dir+0 ; while (entry->id >= 0) { hk = entry->get_hk() ; name = hk->name ; if (!strcmp(name, mode_str)) break ; entry++ ; } if (entry->id < 0) mcxDie(1, me, "unknown mode <%s>", mode_str) ; } mcxOptAnchorSortById(hk->options, hk->n_options) /* caller screwed up: it's IDs should top the * largest ID in the shared options. */ ; if (hk->n_options && delg_id_max >= hk->options[0].id) mcxDie(1, me, "PBD option merge is pointless") ; delgOpts = mcxOptHash(hk->options, NULL) ; mergedOpts = mcxHashMerge(clmOpts, delgOpts, NULL, NULL) ; opts = mcxHOptExhaust (mergedOpts, (char**) argv, argc, 2, &n_arg_read, &parseStatus) ; a = 2 + n_arg_read /* fixme: we should be able to check n_at_most and n_at_least * right here, should we not? */ ; if (parseStatus != STATUS_OK) { mcxErr(me, "initialization failed") ; exit(1) ; } if (hk->init()) mcxDie(1, me, "initialization failed for <%s>", hk->name) ; for (opt=opts;opt->anch;opt++) { mcxOptAnchor* anch = opt->anch ; if (anch->id <= delg_id_max) { if (bundle->shared_handler(anch->id, opt->val, hk, bundle)) mcxDie(1, me, "dispatcher curtains") ; } else if (hk->arg_cb(anch->id, opt->val)) mcxDie(1, me, "dispatchee curtains") ; } /* do the checks below after parsing: * Parsing is needed to -h --help type flags * and other type of meta-enquiry options. */ if ( a + hk->n_at_least > argc || (hk->n_at_most >= 0 && a + hk->n_at_most < argc) ) { mcxTing* t = mcxTingPrint ( NULL , "mode %s needs %s %d trailing arguments" , mode_str , hk->n_at_least == hk->n_at_most ? "exactly" : "at least" , hk->n_at_least ) ; if (hk->n_at_most > hk->n_at_least) mcxTingPrintAfter(t, " and at most %d", hk->n_at_most) ; if (hk->n_at_most >= 0 && a + hk->n_at_most < argc) mcxTingPrintAfter(t, " (found %s)", argv[a]) ; mcxDie(1, me, "%s", t->str) ; } mcxOptFree(&opts) ; mcxOptHashFree(&clmOpts) ; mcxOptHashFree(&delgOpts) ; mcxOptHashFree(&mergedOpts) ; return hk->main(argc-a, argv+a) ; } cimfomfa-21-361/tingea/opt.h000066400000000000000000000207351416241612100156150ustar00rootroot00000000000000/* (C) Copyright 2002, 2003, 2004, 2005, 2006 Stijn van Dongen * (C) Copyright 2007, 2008, 2009, 2010 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ /* TODO * recode dispatch case 'no arguments supplied'. now ugly. */ #ifndef tingea_opt_h #define tingea_opt_h #include "types.h" #include "ting.h" #include "hash.h" /* ************************************************************************** * * ** Implementation notes (a few). * * This interface munges and parses text presented to it, and creates * arrays and optionally hashes from them. It does so by simply storing * pointers to the data presented to it, and does not copy anything at all. * * It is the callers job to make sure that the data scrutinized by this * interface stays constant during interface usage. * * Tentatively, this interface treats -I 3 and --I=3 as equivalent * syntax. It is possible to define -I and --I= as separate options. * (by defining -I with MCX_OPT_HASARG and --I with MCX_OPT_DEFAULT). * * TODO: * implement newline/indent magic in option descriptions. * * The prefix thing, is it necessary? caller could pass argv+prefix .. */ #define MCX_OPT_DEFAULT 0 /* -a, xyz */ #define MCX_OPT_HASARG 1 /* -a 10, xyz foo */ #define MCX_OPT_REQUIRED 2 #define MCX_OPT_INFO 4 #define MCX_OPT_HIDDEN 16 #define MCX_OPT_UNUSED 32 enum { MCX_OPT_STATUS_OK = 0 , MCX_OPT_STATUS_NOARG , MCX_OPT_STATUS_UNKNOWN , MCX_OPT_STATUS_NOMEM } ; /* struct mcxOptAnchor * * id * When using mcxOptApropos, if the option MCX_OPT_DISPLAY_SKIP is used, * an increment larger then one between successive ids (from the structs * in the array presented to mcxOptApropos) causes an additional newline * to be output before the option synopsis. * This enables the creation of paragraphs in a simple manner. * * descr_usage * By default, this just contains the description of what the option does * It is possible to specify a mark to be printed in front of that * description. This requires both the mark and the description * (which are joined in the same string) to be proceded by a special * sequence. For the mark this is "\tM" and for the description * this is "\tD". The description string should be last. A valid entry is * thus * "\tM!\tDset the resource scheme" * This will print the marker '!' inbetween the option tag and its * description. * * Presumably, the legend to such markers is explained by the caller. */ typedef struct mcxOptAnchor { char* tag /* '-foo' or '--expand-only' etc */ ; int flags /* MCX_OPT_HASARG etc */ ; int id /* ID */ ; char* descr_arg /* "" or "", NULL ok */ ; char* descr_usage /* NULL allowed */ ; } mcxOptAnchor ; void mcxOptAnchorSortByTag ( mcxOptAnchor *anchors , dim n_anchors ) ; void mcxOptAnchorSortById ( mcxOptAnchor *anchors , dim n_anchors ) ; /* * An array of these is returned by parse routines below. * An entry with .anch == NULL indicates end-of-array. */ typedef struct mcxOption { mcxOptAnchor* anch ; const char* val ; } mcxOption ; /* * these routines only use status MCX_OPT_NOARG. The interface * is not yet frozen. */ /* This tries to find as many arguments as it can, and reports the * number of array elements it skipped. */ mcxOption* mcxOptExhaust ( mcxOptAnchor* anch , char** argv , int argc , int prefix /* skip these */ , int* n_elems_read , mcxstatus* status ) ; /* This will never read past the last arguments (suffix of them). * It does currently not enforce that the number of arguments left * is exactly equal to suffix (fixme?). */ mcxOption* mcxOptParse ( mcxOptAnchor* anch , char** argv , int argc , int prefix /* skip these */ , int suffix /* skip those too */ , mcxstatus* status ) ; void mcxOptFree ( mcxOption** optpp ) ; mcxbool mcxOptIsInfo ( const char* arg , mcxOptAnchor* options ) ; #define MCX_OPT_DISPLAY_DEFAULT 0 #define MCX_OPT_DISPLAY_BREAK_HARD 1 << 4 /* break overly long lines */ #define MCX_OPT_DISPLAY_BREAK_SOFT 1 << 6 /* break overly long lines */ #define MCX_OPT_DISPLAY_CAPTION 1 << 10 /* break after option */ #define MCX_OPT_DISPLAY_PAR 1 << 12 /* ? useful ? paragraph mode */ #define MCX_OPT_DISPLAY_SKIP 1 << 14 /* display enum skips as pars */ #define MCX_OPT_DISPLAY_HIDDEN 1 << 16 /* do that */ void mcxOptApropos ( FILE* fp , const char* me /* unused currently */ , const char* syntax , int width , mcxbits display , const mcxOptAnchor opt[] ) ; /* The ones below are for spreading responsibility for parsing * argument over different modules. * See the mcl implementation for an example. */ mcxOption* mcxHOptExhaust ( mcxHash* opthash , char** argv , int argc , int prefix /* skip these */ , int* n_elems_read , mcxstatus* status ) ; mcxOption* mcxHOptParse ( mcxHash* opthash , char** argv , int argc , int prefix /* skip these */ , int suffix /* skip those too */ , mcxstatus* status ) ; /* * Creates a hash where the tag string is key, and the mcxOptAnchor is value. */ mcxHash* mcxOptHash ( mcxOptAnchor* opts , mcxHash* hash ) ; void mcxOptHashFree ( mcxHash** hashpp ) ; mcxOptAnchor* mcxOptFind ( char* tag , mcxHash* hopts ) ; void mcxUsage ( FILE* fp , const char* caller , const char** lines ) ; extern int mcxOptPrintDigits; mcxbool mcxOptCheckBounds ( const char* caller , const char* flag , unsigned char type , void* var , int (*lftRlt) (const void*, const void*) , void* lftBound , int (*rgtRlt) (const void*, const void*) , void* rgtBound ) ; /* TODO * provide escape mechanisms for delim; * e.g. mcx tilde, UNIX backslash, or SGML percent sign based. * -> smarter space-based separation. whitespace ? * * NOTE * Separates on spaces, which are replaced with '\0'. * src is modified ('\0' are written throughout). * the char* members 'char* argv[]' all point to within src. */ char** mcxOptParseString ( char* src , int* argc , unsigned char delim ) ; mcxTing* mcxOptArgLine ( const char** argv , int argc , int quote /* '[' or '"' */ ) ; /* * Severely undocumented stuff, but quite useful. * This is used to write a program that * - takes modes, e.g. 'clm dist' 'clm info' 'clm meet' * - has a set of shared options * - allows modes to have their own unique set of options * - Program and mode options are not separated by the mode, * but all are specified after the mode. * Look at htpp://micans.org/mcl/src/mcl-latest/src/shcl/clm.c * htpp://micans.org/mcl/src/mcl-latest/src/shmx/mcx.c * for two fully functioning examples. */ #define MCX_DISP_DEFAULT 0 #define MCX_DISP_HIDDEN 1 #define MCX_DISP_MANUAL 2 typedef struct { const char* name ; const char* syntax ; mcxOptAnchor* options ; int n_options ; mcxstatus (*arg_cb)(int optid, const char* val) ; mcxstatus (*init)( void ) ; mcxstatus (*main)(int argc, const char* argv[]) ; int n_at_least /* trailing arguments */ ; int n_at_most /* trailing arguments */ ; mcxbits flags ; } mcxDispHook ; typedef struct { int id ; mcxDispHook* (*get_hk)(void) ; } mcxDispEntry ; typedef struct mcx_disp_bundle { int disp_argc ; const char** disp_argv ; const char* disp_name ; const char* disp_syntax ; mcxOptAnchor* disp_shared ; dim n_disp_shared ; mcxstatus (*shared_handler)(int optid, const char* val, mcxDispHook*, struct mcx_disp_bundle*) ; void (*disp_version)(const char* me) ; mcxDispEntry* disp_table ; } mcxDispBundle ; int mcxDispatch ( mcxDispBundle* bundle ) ; #endif cimfomfa-21-361/tingea/rand.c000066400000000000000000000237201416241612100157270ustar00rootroot00000000000000/* (C) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * (C) Ziggurat method Copyright 2005 Jochen Voss. * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include #include #include #include #include "rand.h" #include "math.h" #include "types.h" unsigned long mcxSeed ( unsigned long i ) { pid_t p = getpid() ; pid_t pp = getppid() ; time_t t = time(NULL) ; unsigned long s = (p ^ p << 4 ^ p << 16 ^ p << 28) ^ (pp ^ pp << 8 ^ pp << 24) ^ (t ^ t << 12 ^ t << 20) ^ (i ^ i << 3 ^ i << 23 ^ i << 26) /* I have no solid evidence backing up the usefulness of the xors. * They won't increase entropy anyway of course. * Anyway, the xors do seem useful in order to spread input * bits out over the output space, as seen from some hashing * experiments. */ ; return s ; } /* Box-Muller transform */ double mcxNormalBoxMuller ( void ) { double a = 1.0 - (rand() * 1.0) / (RAND_MAX + 1.0) ; double b = 1.0 - (rand() * 1.0) / (RAND_MAX + 1.0) ; return sqrt( -2.0 * log(a)) * cos(2*3.14159265358979323846*b) ; } double mcxNormal ( void ) { return mcxNormalZiggurat() ; } double mcxNormalCut ( double radius , double stddev ) { dim d ; if (radius < 0) radius = -radius ; for (d=0;d<256;d++) { double r = stddev * mcxNormal() ; if (r >= -radius && r <= radius) return r ; } return 0.0 ; } double mcxNormalSample ( double radius , double stddev ) { int n_try = 0 ; double r = 2 * radius * (((1.0 * rand()) / RAND_MAX) - 0.5) ; while (n_try++ < 1000) { double n = exp( - (r * r) / (2 * stddev * stddev)) / (2.5066282746 * stddev) ; double p = (1.0 * rand()) / RAND_MAX ; if (n >= p) break ; r = 2 * radius * (((1.0 * rand()) / RAND_MAX) - 0.5) ; } return r ; } /* Ziggurat method * * Copyright (C) 2005 Jochen Voss. * * For details see the following article. * * George Marsaglia, Wai Wan Tsang * The Ziggurat Method for Generating Random Variables * Journal of Statistical Software, vol. 5 (2000), no. 8 * http://www.jstatsoft.org/v05/i08/ */ /* position of right-most step */ #define PARAM_R 3.44428647676 /* tabulated values for the heigt of the Ziggurat levels */ static const double ytab[128] = { 1.000000000000 , 0.963598623011 , 0.936280813353 , 0.913041104253 , 0.892278506696 , 0.873239356919 , 0.855496407634 , 0.838778928349 , 0.822902083699 , 0.807732738234 , 0.793171045519 , 0.779139726505 , 0.765577436082 , 0.752434456248 , 0.739669787677 , 0.727249120285 , 0.715143377413 , 0.703327646455 , 0.691780377035 , 0.680482768910 , 0.669418297233 , 0.658572339120 , 0.647931876189 , 0.637485254896 , 0.627221991450 , 0.617132611532 , 0.607208517467 , 0.597441877296 , 0.587825531465 , 0.578352913803 , 0.569017984198 , 0.559815170911 , 0.550739320877 , 0.541785656682 , 0.532949739145 , 0.524227434628 , 0.515614886373 , 0.507108489253 , 0.498704867478 , 0.490400854812 , 0.482193476986 , 0.474079936010 , 0.466057596125 , 0.458123971214 , 0.450276713467 , 0.442513603171 , 0.434832539473 , 0.427231532022 , 0.419708693379 , 0.412262232120 , 0.404890446548 , 0.397591718955 , 0.390364510382 , 0.383207355816 , 0.376118859788 , 0.369097692334 , 0.362142585282 , 0.355252328834 , 0.348425768415 , 0.341661801776 , 0.334959376311 , 0.328317486588 , 0.321735172063 , 0.315211514970 , 0.308745638367 , 0.302336704338 , 0.295983912320 , 0.289686497571 , 0.283443729739 , 0.277254911560 , 0.271119377649 , 0.265036493387 , 0.259005653912 , 0.253026283183 , 0.247097833139 , 0.241219782932 , 0.235391638239 , 0.229612930649 , 0.223883217122 , 0.218202079518 , 0.212569124201 , 0.206983981709 , 0.201446306496 , 0.195955776745 , 0.190512094256 , 0.185114984406 , 0.179764196185 , 0.174459502324 , 0.169200699492 , 0.163987608600 , 0.158820075195 , 0.153697969964 , 0.148621189348 , 0.143589656295 , 0.138603321143 , 0.133662162669 , 0.128766189309 , 0.123915440582 , 0.119109988745 , 0.114349940703 , 0.109635440230 , 0.104966670533 , 0.100343857232 , 0.0957672718266 , 0.0912372357329 , 0.0867541250127 , 0.082318375932 , 0.0779304915295 , 0.0735910494266 , 0.0693007111742 , 0.065060233529 , 0.0608704821745 , 0.0567324485840 , 0.0526472709800 , 0.0486162607163 , 0.0446409359769 , 0.0407230655415 , 0.0368647267386 , 0.0330683839378 , 0.0293369977411 , 0.0256741818288 , 0.0220844372634 , 0.0185735200577 , 0.0151490552854 , 0.0118216532614 , 0.00860719483079, 0.00553245272614, 0.00265435214565 } ; /* tabulated values for 2^24 times x[i]/x[i+1], * used to accept for U*x[i+1]<=x[i] * without any floating point operations */ static const unsigned long ktab[128] = { 0 , 12590644 , 14272653 , 14988939 , 15384584 , 15635009 , 15807561 , 15933577 , 16029594 , 16105155 , 16166147 , 16216399 , 16258508 , 16294295 , 16325078 , 16351831 , 16375291 , 16396026 , 16414479 , 16431002 , 16445880 , 16459343 , 16471578 , 16482744 , 16492970 , 16502368 , 16511031 , 16519039 , 16526459 , 16533352 , 16539769 , 16545755 , 16551348 , 16556584 , 16561493 , 16566101 , 16570433 , 16574511 , 16578353 , 16581977 , 16585398 , 16588629 , 16591685 , 16594575 , 16597311 , 16599901 , 16602354 , 16604679 , 16606881 , 16608968 , 16610945 , 16612818 , 16614592 , 16616272 , 16617861 , 16619363 , 16620782 , 16622121 , 16623383 , 16624570 , 16625685 , 16626730 , 16627708 , 16628619 , 16629465 , 16630248 , 16630969 , 16631628 , 16632228 , 16632768 , 16633248 , 16633671 , 16634034 , 16634340 , 16634586 , 16634774 , 16634903 , 16634972 , 16634980 , 16634926 , 16634810 , 16634628 , 16634381 , 16634066 , 16633680 , 16633222 , 16632688 , 16632075 , 16631380 , 16630598 , 16629726 , 16628757 , 16627686 , 16626507 , 16625212 , 16623794 , 16622243 , 16620548 , 16618698 , 16616679 , 16614476 , 16612071 , 16609444 , 16606571 , 16603425 , 16599973 , 16596178 , 16591995 , 16587369 , 16582237 , 16576520 , 16570120 , 16562917 , 16554758 , 16545450 , 16534739 , 16522287 , 16507638 , 16490152 , 16468907 , 16442518 , 16408804 , 16364095 , 16301683 , 16207738 , 16047994 , 15704248 , 15472926 } ; /* tabulated values of 2^{-24}*x[i] */ static const double wtab[128] = { 1.62318314817e-08 , 2.16291505214e-08 , 2.54246305087e-08, 2.84579525938e-08 , 3.10340022482e-08 , 3.33011726243e-08 , 3.53439060345e-08, 3.72152672658e-08 , 3.89509895720e-08 , 4.05763964764e-08 , 4.21101548915e-08, 4.35664624904e-08 , 4.49563968336e-08 , 4.62887864029e-08 , 4.75707945735e-08, 4.88083237257e-08 , 5.00063025384e-08 , 5.11688950428e-08 , 5.22996558616e-08, 5.34016475624e-08 , 5.44775307871e-08 , 5.55296344581e-08 , 5.65600111659e-08, 5.75704813695e-08 , 5.85626690412e-08 , 5.95380306862e-08 , 6.04978791776e-08, 6.14434034901e-08 , 6.23756851626e-08 , 6.32957121259e-08 , 6.42043903937e-08, 6.51025540077e-08 , 6.59909735447e-08 , 6.68703634341e-08 , 6.77413882848e-08, 6.86046683810e-08 , 6.94607844804e-08 , 7.03102820203e-08 , 7.11536748229e-08, 7.19914483720e-08 , 7.28240627230e-08 , 7.36519550992e-08 , 7.44755422158e-08, 7.52952223703e-08 , 7.61113773308e-08 , 7.69243740467e-08 , 7.77345662086e-08, 7.85422956743e-08 , 7.93478937793e-08 , 8.01516825471e-08 , 8.09539758128e-08, 8.17550802699e-08 , 8.25552964535e-08 , 8.33549196661e-08 , 8.41542408569e-08, 8.49535474601e-08 , 8.57531242006e-08 , 8.65532538723e-08 , 8.73542180955e-08, 8.81562980590e-08 , 8.89597752521e-08 , 8.97649321908e-08 , 9.05720531451e-08, 9.13814248700e-08 , 9.21933373471e-08 , 9.30080845407e-08 , 9.38259651738e-08, 9.46472835298e-08 , 9.54723502847e-08 , 9.63014833769e-08 , 9.71350089201e-08, 9.79732621669e-08 , 9.88165885297e-08 , 9.96653446693e-08 , 1.00519899658e-07, 1.01380636230e-07 , 1.02247952126e-07 , 1.03122261554e-07 , 1.04003996769e-07, 1.04893609795e-07 , 1.05791574313e-07 , 1.06698387725e-07 , 1.07614573423e-07, 1.08540683296e-07 , 1.09477300508e-07 , 1.10425042570e-07 , 1.11384564771e-07, 1.12356564007e-07 , 1.13341783071e-07 , 1.14341015475e-07 , 1.15355110887e-07, 1.16384981291e-07 , 1.17431607977e-07 , 1.18496049514e-07 , 1.19579450872e-07, 1.20683053909e-07 , 1.21808209468e-07 , 1.22956391410e-07 , 1.24129212952e-07, 1.25328445797e-07 , 1.26556042658e-07 , 1.27814163916e-07 , 1.29105209375e-07, 1.30431856341e-07 , 1.31797105598e-07 , 1.33204337360e-07 , 1.34657379914e-07, 1.36160594606e-07 , 1.37718982103e-07 , 1.39338316679e-07 , 1.41025317971e-07, 1.42787873535e-07 , 1.44635331499e-07 , 1.46578891730e-07 , 1.48632138436e-07, 1.50811780719e-07 , 1.53138707402e-07 , 1.55639532047e-07 , 1.58348931426e-07, 1.61313325908e-07 , 1.64596952856e-07 , 1.68292495203e-07 , 1.72541128694e-07, 1.77574279496e-07 , 1.83813550477e-07 , 1.92166040885e-07 , 2.05295471952e-07, 2.22600839893e-07 } ; double mcxNormalZiggurat ( void ) { unsigned long U, sign, i, j ; double x = 0.0, y ; while (1) { U = rand() ; i = U & 0x0000007F /* 7 bit to choose the step */ ; sign = U & 0x00000080 /* 1 bit for the sign */ ; j = rand() & 0x00FFFFFF /* 24 bit for the x-value */ ; x = j*wtab[i] ; if (j < ktab[i]) break ; if (i<127) { double y0, y1 ; y0 = ytab[i] ; y1 = ytab[i+1] ; y = y1+(y0-y1) * mcxUniform0 ; } else { x = PARAM_R - log(mcxUniform1)/PARAM_R ; y = exp(-PARAM_R*(x-0.5*PARAM_R)) * mcxUniform0 ; } if (y < exp(-0.5*x*x)) break ; } return sign ? x : -x ; } cimfomfa-21-361/tingea/rand.h000066400000000000000000000022611416241612100157310ustar00rootroot00000000000000/* (C) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_rand_h #define tingea_rand_h #include #define MCX_RAND_MAX RAND_MAX #define mcxUniform0 ((1.0 * rand()) / ((double) RAND_MAX + 1.0)) #define mcxUniform1 (1.0 - ((1.0 * rand()) / ((double) RAND_MAX + 1.0))) /* This is for weak seeding, to obtain fresh seeds which will definitely * *not* be suitable for cryptographic needs */ unsigned long mcxSeed ( unsigned long seedlet ) ; double mcxNormal ( void ) ; double mcxNormalCut ( double radius , double stddev ) ; double mcxNormalZiggurat ( void ) ; double mcxNormalBoxMuller ( void ) ; /* Generate numbers in the interval [-outer, outer] according * to the normal distribution with standard deviation sigma. * Use e.g. outer = 2.0 sigma = 0.5 */ double mcxNormalSample ( double radius , double stddev ) ; #endif cimfomfa-21-361/tingea/ting.c000066400000000000000000000466741416241612100157610ustar00rootroot00000000000000/* (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include #include #include #include #include "../config.h" #include "ting.h" #include "ding.h" #include "minmax.h" #include "alloc.h" #include "array.h" #include "hash.h" #include "types.h" #include "err.h" #include "tr.h" void mcxTingRelease ( void* tingv ) { if (tingv && ((mcxTing*)tingv)->str) mcxFree(((mcxTing*)tingv)->str) ; } void mcxTingFree ( mcxTing **tingpp ) { mcxTing* ting = *tingpp ; if (ting) { if (ting->str) mcxFree(ting->str) ; mcxFree(ting) ; *tingpp = NULL ; } } void mcxTingFree_v ( void *tingpp ) { mcxTingFree((mcxTing**) tingpp) ; } #if 0 void mcxTingAbandon ( void *tingpp ) { mcxTing* ting = *((mcxTing**) tingpp) ; mcxFree(ting) ; } #endif mcxTing* mcxTingShrink ( mcxTing* ting , ofs offset ) { if (offset < 0) offset = ting->len + offset /* fixme conversion? */ ; if (offset < 0 || (dim) offset > ting->len) { mcxErr ( "mcxTingShrink" , "funny offset <%lu> newlen <%ld> combo" , (ulong) ting->len , (long) offset ) ; return ting ; } else { *(ting->str+offset) = '\0' ; ting->len = offset; ; } return ting ; } mcxTing* mcxTingEnsure ( mcxTing* ting , dim len ) { if (!ting && !(ting = (mcxTing*) mcxTingInit(NULL))) return NULL ; if (len <= ting->mxl) ; else { char* t = mcxRealloc(ting->str, len+1, RETURN_ON_FAIL) ; if (!t) return NULL ; ting->str = t ; ting->mxl = len ; if (1) *(ting->str+ting->mxl) = '\0' /* there should be no need to do this; * and for large allocations this may fail. */ ; } return ting ; } #ifndef HAVE_VA_COPY #define HAVE_VA_COPY 1 #endif /* todo nul hardening */ static mcxTing* mcx_ting_print ( mcxTing* dst , const char* fmt , va_list *args ) #define PRINT_BUF_SIZE 512 { char buf[PRINT_BUF_SIZE], *src ; mcxTing* txtbuf = NULL ; dim m = PRINT_BUF_SIZE ; int npf /* Perhaps hook this #definery with configure options that * benefit from autoconf machinery. */ #if HAVE_VA_COPY ; va_list args2 ; va_copy(args2, *args) ; npf = vsnprintf(buf, PRINT_BUF_SIZE, fmt, args2) ; va_end(args2) #else ; npf = vsnprintf(buf, PRINT_BUF_SIZE, fmt, *args) #endif /* from reading standards it seems that npf >= PRINT_BUF_SIZE * should be sufficient. However, alpha OSF1 provides * a counterexample. And from reading standard annotations * it seems that vsnprintf is widely ill-implemented */ ; if (npf < 0 || npf >= PRINT_BUF_SIZE - 1) { m = (npf >= 0 && npf >= PRINT_BUF_SIZE - 1) ? ((dim) npf) + 1 : 2 * m /* Suppose m is set to npf+1. Then mcxTingEmpty will malloc npf+2 * bytes and vnsprintf is given m+1=npf+2 as size argument, * which is > PRINT_BUF_SIZE. */ ; while (1) { if (!(txtbuf = mcxTingEmpty(txtbuf, m))) { mcxTingFree(&txtbuf) ; return NULL ; } #if HAVE_VA_COPY va_copy(args2, *args) ; npf = vsnprintf(txtbuf->str, m+1, fmt, args2) ; va_end(args2) #else ; npf = vsnprintf(txtbuf->str, m+1, fmt, *args) #endif /* Only the npf < 0 case is expected below. * The other check is defensive coding. We gave * vsnprintf m+1 as size argument, so the check is * against one less than that (alpha OSF1 example). */ ; if (npf < 0 || (dim) npf >= m) m *= 2 ; else break ; } src = txtbuf->str ; } else src = buf ; dst = mcxTingWrite(dst, src) ; mcxTingFree(&txtbuf) ; return dst ; } mcxTing* mcxTingPrintSplice ( mcxTing* dst , ofs offset , ofs delete , const char* fmt , ... ) { va_list args ; mcxTing *infix = NULL ; va_start(args, fmt) ; infix = mcx_ting_print(NULL, fmt, &args) ; va_end(args) ; if (!infix) return NULL ; if (!dst) return infix ; if ( mcxTingSplice(dst, infix->str, offset, delete, infix->len) != STATUS_OK ) { mcxTingFree(&infix) ; return NULL ; } mcxTingFree(&infix) ; return dst ; } mcxTing* mcxTingPrint ( mcxTing* dst , const char* fmt , ... ) { va_list args ; va_start(args, fmt) ; dst = mcx_ting_print(dst, fmt, &args) ; va_end(args) ; return dst ; } mcxTing* mcxTingPrintAfter ( mcxTing* dst , const char* fmt , ... ) { va_list args ; mcxTing *affix = NULL ; va_start(args, fmt) ; affix = mcx_ting_print(affix, fmt, &args) ; va_end(args) ; if (!dst) return affix ; if (!affix) /* presumably malloc failure */ return NULL ; if (!mcxTingAppend(dst, affix->str)) { mcxTingFree(&affix) ; return NULL ; } mcxTingFree(&affix) ; return dst ; } static const char* roman[40] = { "" , "i" , "ii", "iii", "iv" , "v" , "vi", "vii", "viii", "ix" , "" , "x" , "xx", "xxx", "xl" , "l" , "lx", "lxx", "lxxx", "xc" , "" , "c" , "cc", "ccc", "cd" , "d" , "dc", "dcc", "dccc", "cm" , "" , "m" , "mm", "mmm", "mmmm", "" , "" , "", "", "" } ; mcxTing* mcxTingRoman ( mcxTing* dst , long a , mcxbool ucase ) { long i, x, c, m ; char* p ; if (a >= 5000 || a <= 0) return mcxTingWrite(dst, "-") ; i = a % 10 ; a /= 10 ; x = a % 10 ; a /= 10 ; c = a % 10 ; a /= 10 ; m = a ; dst = mcxTingPrint ( dst , "%s%s%s%s" , roman[30+m] , roman[20+c] , roman[10+x] , roman[ 0+i] ) ; if (dst && ucase) for (p=dst->str;pstr+dst->len;p++) *p += 'A' - 'a' ; return dst ; } mcxTing* mcxTingDouble ( mcxTing* dst , double x , int decimals ) { char num[500] ; char* p ; int len = snprintf(num, 500, "%.*f", decimals, x) ; if (decimals < 0) { mcxErr("mcxTingDouble PBD", "negative decimals arg") ; decimals = 6 ; } if (len < 0 || len >= 500) return mcxTingWrite(dst, "[]") ; p = num+len-1 /* GNU libcx bug workaround */ /* it returns 2 for length of 'inf' */ ; if (decimals && strcmp(num, "inf")) { while (*p == '0') p-- ; if (*p == '.') *++p = '0' ; *++p = '\0' ; } return mcxTingWrite(dst, num) ; } mcxTing* mcxTingInteger ( mcxTing* dst , long x ) { char num[128] ; int len = snprintf(num, 128, "%ld", x) ; if (len < 0 || len >= 128) return mcxTingWrite(dst, "[]") ; return mcxTingWrite(dst, num) ; } void* mcxTingInit ( void * tingv ) { mcxTing *ting = tingv ; if (!ting) { if (!(ting = mcxAlloc(sizeof(mcxTing), RETURN_ON_FAIL))) return NULL ; } if (!(ting->str = (char*) mcxAlloc(sizeof(char), RETURN_ON_FAIL))) return NULL ; *(ting->str+0) = '\0' ; ting->len = 0 ; ting->mxl = 0 ; return ting ; } /* * Take string into an existing ting or into a new ting */ mcxTing* mcxTingInstantiate ( mcxTing* ting , const char* string ) /* strnotice strlen */ { dim length = string ? strlen(string) : 0 /* ensure handles ting==NULL and/or length==0 cases */ ; if (!(ting = mcxTingEnsure(ting, length))) return NULL /* strnotice strncpy */ ; if (string) { strncpy(ting->str, string, length) ; *(ting->str+length) = '\0' ; } ting->len = length ; return ting ; } int mcxTingRevCmp ( const void* t1 , const void* t2 ) { return (strcmp(((mcxTing*)t2)->str, ((mcxTing*)t1)->str)) ; } int mcxTingCmp ( const void* t1 , const void* t2 ) { return (strcmp(((mcxTing*)t1)->str, ((mcxTing*)t2)->str)) ; } int mcxTingPCmp ( const void* t1 , const void* t2 ) { return (strcmp(((mcxTing**)t1)[0]->str, ((mcxTing**)t2)[0]->str)) ; } int mcxTingPRevCmp ( const void* t1 , const void* t2 ) { return (strcmp(((mcxTing**)t2)[0]->str, ((mcxTing**)t1)[0]->str)) ; } int mcxPKeyTingCmp ( const void* k1 , const void* k2 ) { return strcmp ( ((mcxTing*) ((mcxKV**)k1)[0]->key)->str , ((mcxTing*) ((mcxKV**)k2)[0]->key)->str ) ; } int mcxPKeyTingRevCmp ( const void* k1 , const void* k2 ) { return strcmp ( ((mcxTing*) ((mcxKV**)k2)[0]->key)->str , ((mcxTing*) ((mcxKV**)k1)[0]->key)->str ) ; } mcxstatus mcxTingSplice ( mcxTing* ting , const char* pstr , ofs offset , ofs n_delete , dim n_copy ) { dim newlen ; if (!ting) { mcxErr("mcxTingSplice PBD", "void ting argument") ; return STATUS_FAIL ; } /* offset -1 denotes appending at the end, * offset -2 denotes inserting at the last-but-one position. * etc */ if (offset < 0) { if ((dim) -offset > ting->len + 1) offset = 0 ; else offset = ting->len + offset + 1 ; } else if ((dim) offset > ting->len) offset = ting->len ; if (n_delete == TING_INS_CENTER) { n_delete = MCX_MIN(ting->len, n_copy) ; offset = (ting->len - n_delete) / 2 /* n_delete <= ting->len */ ; } else if (n_delete == TING_INS_OVERWRITE) n_delete = MCX_MIN(ting->len - offset, n_copy) /* offset <= ting->len */ ; else if (n_delete == TING_INS_OVERRUN || n_delete < 0) n_delete = ting->len - offset /* offset <= ting->len */ ; else if (n_delete < 0) { mcxErr ( "mcxTingSplice PBD" , "unsupported delete mode %ld" , (long) n_delete ) ; return STATUS_FAIL ; } else if ((dim) (offset + n_delete) > ting->len) n_delete = ting->len - offset ; if (ting->len + n_copy < (dim) n_delete) /* now spurious? */ { mcxErr("mcxTingSplice PBD", "arguments result in negative length") ; return STATUS_FAIL ; } /* * essential: mcxSplice does not know to allocate room for '\0' */ newlen = ting->len - n_delete + n_copy ; if (!mcxTingEnsure(ting, newlen)) return STATUS_FAIL ; if ( mcxSplice ( &(ting->str) , pstr , sizeof(char) , &(ting->len) , &(ting->mxl) , offset , (dim) n_delete , n_copy ) != STATUS_OK ) return STATUS_FAIL /* * essential: mcxSplice might have realloced, so has to be done afterwards. */ ; *(ting->str+newlen) = '\0' ; if (ting->len != newlen) { mcxErr("mcxTingSplice panic", "mcxSplice gives unexpected result") ; return STATUS_FAIL ; } return STATUS_OK ; } mcxTing* mcxTingNew ( const char* str ) { return mcxTingInstantiate(NULL, str) ; } mcxTing* mcxTingNNew ( const char* str , dim sz ) { mcxTing* ting = mcxTingEnsure(NULL, sz) ; if (!ting) return NULL /* strnotice memcpy */ ; if (str && sz) memcpy(ting->str, str, sz) ; *(ting->str+sz) = '\0' ; ting->len = sz ; return ting ; } mcxTing* mcxTingEmpty ( mcxTing* ting , dim len ) { if (!(ting = mcxTingEnsure(ting, len))) return NULL ; *(ting->str+0) = '\0' , ting->len = 0 ; return ting ; } mcxTing* mcxTingWrite ( mcxTing* ting , const char* str ) { return mcxTingInstantiate(ting, str) ; } mcxTing* mcxTingNWrite ( mcxTing* ting , const char* str , dim sz ) { if (!(ting = mcxTingEnsure(ting, sz))) return NULL /* strnotice strncpy */ ; memcpy(ting->str, str, sz) ; *(ting->str+sz) = '\0' ; ting->len = sz ; return ting ; } char* mcxTingSubStr ( const mcxTing* ting , ofs offset , ofs length ) { char* str ; if (offset < 0 || (dim) offset > ting->len) offset = ting->len ; if (length < 0 || (dim) (offset+length) > ting->len) length = ting->len - offset ; if (!(str = mcxAlloc((dim) (length+1), RETURN_ON_FAIL))) return NULL ; if (length) memcpy(str, ting->str+offset, (dim) length) ; *(str+length) = '\0' ; return str ; } mcxTing* mcxTingify ( char* str ) { mcxTing* ting = mcxAlloc(sizeof(mcxTing), RETURN_ON_FAIL) ; ting->str = str /* strnotice strlen; ? tingify2 */ ; ting->len = strlen(str) ; return ting ; } char* mcxTinguish ( mcxTing* ting ) { char* str = ting->str ; mcxFree(ting) ; return str ; } char* mcxTingStr ( const mcxTing* ting ) { ofs slen = ting->len ; return mcxTingSubStr(ting, 0, slen) ; } mcxTing* mcxTingAppend ( mcxTing* ting , const char* str ) { if (!ting) return mcxTingNew(str) /* strnotice strlen */ ; if ( mcxTingSplice ( ting , str , -1 /* splice offset */ , 0 /* delete nothing */ , str? strlen(str) : 0 /* string length */ ) != STATUS_OK ) return NULL ; return ting ; } mcxTing* mcxTingKAppend ( mcxTing* ting , const char* str , dim sz ) { dim len = strlen(str) ; if (!ting && !sz) return mcxTingEmpty(NULL, 0) ; if (!sz) return ting ; while (sz-- > 0) /* careful with unsignedness */ if (!(ting = mcxTingNAppend(ting, str, len))) return NULL ; return ting ; } mcxTing* mcxTingNAppend ( mcxTing* ting , const char* str , dim sz ) { if (!ting) return mcxTingNWrite(NULL, str, sz) ; if ( mcxTingSplice ( ting , str , -1 /* splice offset */ , 0 /* delete nothing */ , sz ) != STATUS_OK ) return NULL ; return ting ; } mcxTing* mcxTingInsert ( mcxTing* ting , const char* str , ofs offset ) { if (!ting) return mcxTingNew(str) /* strnotice strlen */ ; if ( mcxTingSplice ( ting , str , offset /* splice offset */ , 0 /* delete nothing */ , str ? strlen(str) : 0 /* string length */ ) != STATUS_OK ) return NULL ; return ting ; } mcxTing* mcxTingNInsert ( mcxTing* ting , const char* str , ofs offset , dim length ) { if (!ting) return mcxTingNWrite(NULL, str, length) ; if ( mcxTingSplice ( ting , str , offset /* splice offset */ , 0 /* delete nothing */ , length /* length of str */ ) != STATUS_OK ) return NULL ; return ting ; } mcxTing* mcxTingDelete ( mcxTing* ting , ofs offset , dim width ) { ofs swidth = width ; if (!ting) return NULL ; if ( mcxTingSplice ( ting , NULL , offset /* splice offset */ , swidth /* delete width */ , 0 /* string length */ ) != STATUS_OK ) return NULL ; return ting ; } u32 mcxTingDJBhash ( const void* ting ) { return(mcxBJhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingBDBhash ( const void* ting ) { return(mcxBDBhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingBJhash ( const void* ting ) { return(mcxBJhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingCThash ( const void* ting ) { return(mcxCThash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingDPhash ( const void* ting ) { return(mcxDPhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingGEhash ( const void* ting ) { return(mcxGEhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingOAThash ( const void* ting ) { return(mcxOAThash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingELFhash ( const void* ting ) { return(mcxELFhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingFNVhash ( const void* ting ) { return(mcxFNVhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 (*mcxTingHFieByName(const char* id))(const void* ting) { if (!strcmp(id, "dp")) return mcxTingDPhash ; else if (!strcmp(id, "bj")) return mcxTingBJhash ; else if (!strcmp(id, "elf")) return mcxTingELFhash ; else if (!strcmp(id, "djb")) return mcxTingDJBhash ; else if (!strcmp(id, "bdb")) return mcxTingBDBhash ; else if (!strcmp(id, "ge")) return mcxTingGEhash ; else if (!strcmp(id, "oat")) return mcxTingOAThash ; else if (!strcmp(id, "svd")) return mcxTingSvDhash ; else if (!strcmp(id, "svd2")) return mcxTingSvD2hash ; else if (!strcmp(id, "svd1")) return mcxTingSvD1hash ; else if (!strcmp(id, "ct")) return mcxTingCThash ; else if (!strcmp(id, "fnv")) return mcxTingFNVhash ; else return NULL ; } u32 mcxTingSvDhash ( const void* ting ) { return(mcxSvDhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingSvD2hash ( const void* ting ) { return(mcxSvD2hash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingSvD1hash ( const void* ting ) { return(mcxSvD1hash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } u32 mcxTingHash ( const void* ting ) { return(mcxDPhash(((mcxTing*) ting)->str, ((mcxTing*) ting)->len)) ; } /* Fails only for memory reason */ mcxstatus mcxTingTackc ( mcxTing* ting , unsigned char c ) { if (!ting || !mcxTingEnsure(ting, ting->len+1)) return STATUS_FAIL ; ting->str[ting->len] = c ; ting->str[ting->len+1] = '\0' ; ting->len += 1 ; return STATUS_OK ; } /* Fails if last char is not the same as c */ mcxstatus mcxTingTickc ( mcxTing* ting , unsigned char c ) { if (!ting || !ting->len) return STATUS_FAIL ; if ((unsigned char) ting->str[ting->len-1] == c) { mcxTingShrink(ting, -1) ; return STATUS_OK ; } return STATUS_FAIL ; } cimfomfa-21-361/tingea/ting.h000066400000000000000000000272751416241612100157620ustar00rootroot00000000000000/* (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_ting #define tingea_ting #include "types.h" typedef struct { char *str ; dim len ; dim mxl ; } mcxTing ; /* ************************************************************************** * * ** Implementation notes (a few). * * Synopsis * This little module provides an objectified C-string compatible interface * to strings. * Some philosophy * Do not mind the overhead of 2*sizeof(int) bytes per ting. * If you have humongous amounts of small strings, use C-strings. Optionally * you can do the needed char manipulation in a ting used as scratch-space * using the ting interface, then create a normal string once you are done. * Use mcxTinguish to avoid copying if needed. * Feel free to use the str member with routines from * or perhaps from ding.h. Just remember to treat it as a const object * when doing so. * Applications * Zoem is the macro processor that processes the zoem language. It is very * string-heavy and its string operations are entirely based on the ting * module. * Caveat * Nearly all routines return a NULL pointer to indicate malloc failure. * Data structure * str: array of chars * * len: length of string in str (excluding '\0') * *(str+len) == '\0' * * mxl: current allocated number of writable char's (excluding '\0') * Allocated amount is mxl+1 * *(str+mxl) == '\0' - but don't count on that. * Notes * mcxTingEnsure is the only routine allowed to fiddle with mxl. * (apart from mcxTingInit which sets it to zero). * * Future idea * mcxTingFinalize, (realloc to length) * * Routines marked `!' will NOT accept ting==NULL argument. * Routines marked `#' should not be called other than by ting routines * * _ #Init _ * / \ * Ensure <--- #Instantiate * / \ \ * Empty !Splice New,Write,Print,PrintAfter * NWrite | * | * Append,Insert,Delete,PrintSplice * TODO * the library should be able to deal with embedded \0's. Really. */ /* ************************************************************************** * * ** Various instantiation routines. */ /* Accepts NULL argument. * void arguments so that it can be used * as callback. * * Should ordinarily *not* be used, unless * you want to initialize a ting allocated * on the frame stack. */ void* mcxTingInit ( void* ting ) ; /* Accepts NULL argument. * Should ordinarily *not* be used. */ mcxTing* mcxTingInstantiate ( mcxTing* dst_ting , const char* str ) ; /* Accepts NULL argument. Does not affect * ting->str. used for preallocing, e.g. to * prepare for successive calls of Append. (see * also Empty). */ mcxTing* mcxTingEnsure ( mcxTing* ting , dim length ) ; /* Accepts NULL argument. The string part is * set to the empty string. * Can be used for preallocing. */ mcxTing* mcxTingEmpty ( mcxTing* ting , dim length ) ; /* ************************************************************************** * * ** Some freeing routines. */ /* Free members and shell struct * You pass the address of a variable, * loosely speaking. */ void mcxTingFree ( mcxTing **tingpp ) ; /* Free members and shell struct * Use with callbacks, e.g. * for freeing hash with tings in one go. */ void mcxTingFree_v ( void *tingpp ) ; /* Free members * Use for freeing array of ting; * e.g. as callback in mcxNFree. */ void mcxTingRelease ( void *ting ) ; /* ************************************************************************** * * ** A bunch of user-land creation routines. */ /* accepts NULL argument, maps to empty string. */ mcxTing* mcxTingNew ( const char* str ) ; /* accepts NULL argument, maps to empty string. */ mcxTing* mcxTingNNew ( const char* str , dim n ) ; /* accepts NULL argument. */ mcxTing* mcxTingWrite ( mcxTing* ting , const char* str ) ; /* accepts NULL argument. */ mcxTing* mcxTingNWrite ( mcxTing* ting , const char* str , dim n ) ; /* usurps argument. */ mcxTing* mcxTingify ( char* str ) ; /* destroys argument, returns str member. */ char* mcxTinguish ( mcxTing* ting ) ; /* ************************************************************************** * * ** Appending, inserting, deleting, shrinking. * Some can be used as creation routine (e.g. append). */ #define TING_INS_CENTER -3 #define TING_INS_OVERRUN -4 #define TING_INS_OVERWRITE -5 /* * The offset argument can be negative, for subscripting from the end. * * The n_delete argument can be nonnegative, or one of * TING_INS_CENTER center, (try to) overwrite without changing length. * TING_INS_OVERRUN overwrite till the end. * TING_INS_OVERWRITE (try to) overwrite without changing length. * * The n_copy argument is not magical like the previous two. * */ /* does NOT accept NULL argument. */ mcxstatus mcxTingSplice ( mcxTing* ting , const char* pstr , ofs d_offset /* negative offset refers to end */ , ofs n_delete /* special modes as documented above */ , dim n_copy ) ; /* accepts NULL argument. */ mcxTing* mcxTingInsert ( mcxTing* ting , const char* str , ofs offset ) ; /* accepts NULL argument. */ mcxTing* mcxTingNInsert ( mcxTing* ting , const char* str , ofs offset /* of ting->str */ , dim length /* of str */ ) ; /* accepts NULL argument. */ mcxTing* mcxTingAppend ( mcxTing* ting , const char* str ) ; /* accepts NULL argument. */ mcxTing* mcxTingKAppend ( mcxTing* ting , const char* str , dim n ) ; /* accepts NULL argument. */ mcxTing* mcxTingNAppend ( mcxTing* ting , const char* str , dim n ) ; /* accepts NULL argument. */ mcxTing* mcxTingDelete ( mcxTing* ting , ofs offset , dim width ) ; /* accepts NULL argument. */ mcxTing* mcxTingShrink ( mcxTing* ting , ofs length ) ; /* Fails only for memory reason */ mcxstatus mcxTingTackc ( mcxTing* ting , unsigned char c ) ; /* Fails if last char is not the same as c */ mcxstatus mcxTingTickc ( mcxTing* ting , unsigned char c ) ; /* ************************************************************************** * * ** A bunch of printf like routines. */ /* Accepts NULL argument. */ mcxTing* mcxTingPrint ( mcxTing* ting , const char* fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; /* Accepts NULL argument. */ mcxTing* mcxTingPrintAfter ( mcxTing* dst , const char* fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; /* Accepts NULL argument. * same offset and delete interface as * mcxTingSplice. */ mcxTing* mcxTingPrintSplice ( mcxTing* dst , ofs offset , ofs n_delete /* count of chars to delete, special modes */ , const char* fmt , ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 4, 5))) #endif ; /* ************************************************************************** * * ** Miscellaneous. */ char* mcxTingStr ( const mcxTing* ting ) ; char* mcxTingSubStr ( const mcxTing* ting , ofs offset , ofs length /* use -1 to indicate remainder of string */ ) ; /* accepts NULL argument. */ mcxTing* mcxTingRoman ( mcxTing* dst , long x , mcxbool ucase ) ; /* accepts NULL argument. */ mcxTing* mcxTingInteger ( mcxTing* dst , long x ) ; /* accepts NULL argument. */ mcxTing* mcxTingDouble ( mcxTing* dst , double x , int decimals ) ; /* ************************************************************************** * * ** Comparing. */ /* compare two mcxTing* pointers */ int mcxTingCmp ( const void* t1 , const void* t2 ) ; /* compare two mcxTing* pointers */ int mcxTingRevCmp ( const void* t1 , const void* t2 ) ; /* compare two mcxTing** pointers */ int mcxTingPCmp ( const void* t1 , const void* t2 ) ; /* compare two mcxTing** pointers */ int mcxTingPRevCmp ( const void* t1 , const void* t2 ) ; /* compare two mcxKV** pointers by key as mcxTing* */ int mcxPKeyTingCmp ( const void* k1 , const void* k2 ) ; /* compare two mcxKV** pointers by key as mcxTing* */ int mcxPKeyTingRevCmp ( const void* k1 , const void* k2 ) ; /* ************************************************************************** * * ** Hashing. */ u32 (*mcxTingHFieByName(const char* id))(const void* ting) ; u32 mcxTingELFhash ( const void* ting ) ; u32 mcxTingHash ( const void* ting ) ; u32 mcxTingBJhash ( const void* ting ) ; u32 mcxTingCThash ( const void* ting ) ; u32 mcxTingDPhash ( const void* ting ) ; u32 mcxTingBDBhash ( const void* ting ) ; u32 mcxTingGEhash ( const void* ting ) ; u32 mcxTingOAThash ( const void* ting ) ; u32 mcxTingFNVhash ( const void* ting ) ; u32 mcxTingSvDhash ( const void* ting ) ; u32 mcxTingSvD2hash ( const void* ting ) ; u32 mcxTingSvD1hash ( const void* ting ) ; u32 mcxTingDJBhash ( const void* ting ) ; #endif cimfomfa-21-361/tingea/tok.c000066400000000000000000000153171416241612100156030ustar00rootroot00000000000000/* (C) Copyright 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ /* TODO allow empty args () */ #include #include #include #include "tok.h" #include "types.h" #include "ting.h" #include "ding.h" #include "err.h" #include "alloc.h" #include "compile.h" #ifndef DEBUG # define DEBUG 0 #else # define DEBUG_DEFINED #endif char* mcxTokSkip ( const char* offset , int (*fbool)(int c) , ofs len ) { return mcxStrChrAint(offset, fbool, len) ; } /* * Accounts for nesting. * Will do '}', ')', ']', '>', assuming one of several conventions. * Does not handle string arguments with embedded delimiters, e.g. "foo) bar" */ mcxstatus mcxTokMatch ( const char* str_search , char** endptr , mcxbits mode , ofs len /* considered if >= 0 */ ) { const char* offset= str_search ; unsigned char c = *offset ; mcxstatus status = STATUS_OK ; mcxTing* stack ; const char* z ; *endptr = NULL ; if (len < 0) len = strlen(offset) ; z = offset + len ; switch(c) { case '{' : case '(' : case '[' : break ; default : mcxErr("mcxTokMatch", "not my coal of char <%c>", (int) c) ; return STATUS_FAIL ; } if (!(stack = mcxTingEmpty(NULL, 80))) return STATUS_FAIL ; do { unsigned char m = '\0' ; c = *offset ; switch(c) { case '{' : case '(' : case '[' : status = mcxTingTackc(stack, c) ; break ; case ')' : m = '(' ; break ; case '}' : m = '{' ; break ; case ']' : m = '[' ; break ; } if (m) status = mcxTingTickc(stack, m) ; if (status) break ; if (!stack->len) break ; offset++ ; } while (offset < z) ; if (stack->len) status = STATUS_FAIL ; else if (!status) *endptr = (char* )offset ; if (status) mcxErr ( "mcxTokMatch" , "stacklen <%lu>, offset <%ld>, char <%c>" , (ulong) stack->len , (long) (offset - str_search) , (int) *offset ) ; mcxTingFree(&stack) ; return status ; } mcxstatus mcxTokFind ( const char* offset , char* tok /* Only tok[0] considered for now! */ , char** pos , mcxbits mode cpl__unused , ofs len /* considered if >= 0 */ ) { mcxstatus status = STATUS_OK ; const char* x = offset, *z ; char *y = NULL ; if (len < 0) len = strlen(offset) ; z = offset + len ; *pos = NULL ; while (x < z) { if (*x == tok[0]) break ; switch(*x) { case '(' : case '{' : case '[' : if (!(status = mcxTokMatch(x, &y, 0, z-x))) x = y+1 ; break ; default : x++ ; break ; } if (status) break ; } if (!status) { *pos = (char*) x ; return *x == tok[0] ? STATUS_OK : STATUS_DONE ; } return STATUS_FAIL ; } void mcxTokFuncFree ( mcxTokFunc* tf ) { mcxTingFree(&(tf->key)) ; mcxListFree(&(tf->args), mcxTingFree_v) ; } mcxstatus mcxTokExpectFunc ( mcxTokFunc* tf , const char* str , dim str_len , char** z_pp , int n_min , int n_max , int *n_args ) { const char* me = "mcxTokExpectFunc" ; const char *z = str + str_len ; char *x = mcxTokSkip(str, isspace, str_len) /* signed issue */ ; char *y ; mcxTing* key = mcxTingEmpty(NULL, 20) ; mcxTing* args = mcxTingEmpty(NULL, 40) ; mcxstatus status = STATUS_FAIL ; mcxLink* src = NULL ; int ct = 0 ; *z_pp = NULL ; tf->key = NULL ; tf->args = NULL ; if (n_args) *n_args = 0 ; do { if (!x) { mcxErr(me, "no identifier at EOS") ; break ; } y = mcxStrChrAint(x, isalpha, z-x) ; if (y==x) { mcxErr(me, "expect identifier: <%s>", x) ; break ; } if (!y) { mcxErr(me, "lost identifier: <%s>", x) ; break ; } mcxTingNWrite(key, x, y-x) ; x = mcxTokSkip(y, isspace, z-y) ; if (!x || *x != '(') { mcxErr(me, "expect parenthesis: <%s>", x ? x : "EOS") ; break ; } if (mcxTokMatch(x, &y, 0, z-x)) { mcxErr(me, "error parsing <%s>", x) ; break ; } mcxTingNWrite(args, x+1, y-x-1) ; if (!(src = mcxTokArgs(args->str, args->len, &ct, tf->opts))) break ; if ( ( n_min >= 0 && ct < n_min ) || ( n_max >= 0 && ct > n_max ) ) { mcxErr ( me , "for key <%s>, arg count %d conflicts min/max %d/%d" , key->str , ct, n_min, n_max ) ; break ; } *z_pp = y+1 ; status = STATUS_OK ; } while (0) ; mcxTingFree(&args) ; if (status) { mcxTingFree(&key) ; mcxListFree(&src, mcxTingFree_v) ; } else { tf->key = key ; tf->args = src ; if (n_args) *n_args = ct ; } return status ; } mcxLink* mcxTokArgs ( const char* str , long str_len , int* n_args , mcxbits opts ) { mcxLink* src = mcxListSource(8, MCX_GRIM_ARITHMETIC) ; mcxLink* lk = src ; const char* x = str ; char* y = NULL ; const char* z = str + str_len ; mcxTing* arg = NULL ; int ct = 0 ; mcxstatus status = STATUS_FAIL ; while ((status = mcxTokFind(x, ",", &y, 0, z-x)) == STATUS_OK || y) { const char* l = x, *r = y ; if (opts & MCX_TOK_DEL_WS) { l = mcxStrChrAint(x, isspace, y-x) ; r = mcxStrRChrAint(x, isspace, y-x) ; if (l && r && l<=r) r++ ; else r = l = x ; } arg = mcxTingNNew(l, r-l) #if DEBUG ;fprintf(stderr, "adding <%s> [%d/ /%s]\n", arg->str, status, y) #endif ; lk = mcxLinkAfter(lk, arg) ; x = y+1 ; ct++ ; if (status) break ; } if (!y) { mcxErr("mcxTokArgs", "error occurred") ; mcxListFree(&src, mcxTingFree_v) ; return NULL ; } *n_args = ct ; return src ; } #ifndef DEBUG_DEFINED # undef DEBUG #else # undef DEBUG_DEFINED #endif cimfomfa-21-361/tingea/tok.h000066400000000000000000000052061416241612100156040ustar00rootroot00000000000000/* (C) Copyright 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef tingea_tok #define tingea_tok #include #include "inttypes.h" #include "types.h" #include "list.h" #include "ting.h" /* This is a first sketchy attempt at some parse/tokenize routines. * The scope is not very well defined yet. Should it do basic constructs * only, or aim for more power, possibly aided by callbacks, and * god forbid, a state description? * * TODO * quoted strings not yet implemented! * SGML not yet implemented! * * unify with mcxIOExpect, possibly stuff from ding.h * wide chars? */ #define MCX_TOK_MODE_UNIX 1 /* Unix escapes, including esc newlines */ #define MCX_TOK_MODE_QUOTED 2 /* Quotes delimit tokens, hide brackets */ #define MCX_TOK_MODE_PLAIN 4 #define MCX_TOK_MODE_SGML 8 /* &code; other? */ #define MCX_TOK_DEL_WS 16 /* only delimiting whitespace */ /* Returns first character not matching fbool, NULL if none. */ char* mcxTokSkip ( const char* offset , int (*fbool)(int c) , ofs len ) ; /* * Accounts for nesting. * Will do '}', ')', ']', '>', assuming one of several conventions. */ mcxstatus mcxTokMatch ( const char* offset , char** end , mcxbits mode , ofs len /* considered if >= 0 */ ) ; /* * Find some token, skipping over expressions. * Either *pos == NULL and retval == STATUS_FAIL * or *pos != NULL and retval == STATUS_OK * or *pos != NULL and retval == STATUS_DONE */ mcxstatus mcxTokFind ( const char* offset , char* tok /* Only tok[0] considered for now! */ , char** pos , mcxbits mode , ofs len /* considered if >= 0 */ ) ; /* fixme. - document; - add free routine. - then perhaps optify. */ mcxLink* mcxTokArgs ( const char* str , long str_len , int* n_args , mcxbits opts ) ; typedef struct { mcxTing* key ; mcxLink* args ; mcxbits opts ; } mcxTokFunc ; void mcxTokFuncFree ( mcxTokFunc* tf ) ; mcxstatus mcxTokExpectFunc ( mcxTokFunc* tf , const char* str , dim str_len , char** z , int n_min , int n_max , int *n_args ) ; #endif cimfomfa-21-361/tingea/tr.c000066400000000000000000000564201416241612100154330ustar00rootroot00000000000000/* (C) Copyright 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ /* TODO * - xtr_get_token does not check repeat pointer. crashable? * - something that translates \012 to the byte value. * - write regression test. * - More error codes * - Have a magic repeat operator that does not stop on boundaries. * - Do sane things to implicit \0 (e.g. as result of complement) and * characters outside ascii range. * - [*a*256] leads to count 0. * # tr a-z A-C[*#*]X-Z will not (now nor ever) lookahead * - what about alpha tr(1) capabilities? * 6. In the POSIX locale, to translate all ASCII characters that are not * specified, enter: * tr -c '[ -~]' '[A-_]' newfile */ /* NOTE - only room for 256 classes including sentinels C_CLASSSTART C_CLASSEND - during tlt phase delete and squash bits are ignored and not respected */ /* randomly located documentation of intermediate and final tbl formats * * css class start sentinel * ces class end sentinel * rps repeat sentinel * rss range start sentinel * res range end sentinel * * Class: * css | class , i1, i2, i3, .. , ces | class * where i1 etc are to be mapped * * Repeat: * rss | value, count * * Range * rss | _ , i, i+1, i+2, i+3, .. , res | _ * * Final tbl format: value stored in lower 8 bits. * Higher bits may contain MCX_TR_TRANSLATE, MCX_TR_DELETE MCX_TR_SQUASH */ #include #include #include #include #include "tr.h" #include "ting.h" #include "types.h" #include "ding.h" #include "err.h" const char* X_REPEAT_UNEXPECTED = "repeat unexpected"; const char* X_REPEAT_SYNTAX = "repeat syntax"; const char* X_CLASS_UNKNOWN = "class unknown"; const char* X_CLASS_UNEXPECTED = "class unexpected"; const char* X_OCTAL_RANGE = "octal range"; const char* X_OCTAL_SYNTAX = "octal syntax"; const char* X_HEX_RANGE = "hex range"; const char* X_HEX_SYNTAX = "hex syntax"; const char* X_RANGE_INVERTED = "inverted range"; const char* mcx_tr_err = NULL; mcxbool mcx_tr_debug = FALSE; #define MAX_SPEC_INDEX 511 #define error_break break #define UC(c) ((unsigned char) *(c)) static const char* us = "tr"; enum { C_CLASSSTART = 1u , C_ALNUM , C_ALPHA , C_CNTRL , C_DIGIT , C_GRAPH , C_LOWER , C_PRINT , C_PUNCT , C_SPACE , C_UPPER , C_XDIGIT , C_CLASSEND /* 13 */ , C_RANGESTART , C_RANGEEND , C_REPEAT /* next token encodes repeat (stops on boundary)*/ , C_FLOOD /* next token encodeѕ flood (floods all) */ , C_EOF } ; #define ISCLASS(cl) ((cl) > C_CLASSSTART && (cl) < C_CLASSEND) #define ISREPEAT(cl) ((cl) == C_REPEAT || (cl) == C_FLOOD) #define ISUCHARRANGE(i) \ ( (i) >= 0 && (i) < 256 ) #define ISBOUNDARY(cl) \ ( (cl) == C_CLASSSTART || (cl) == C_CLASSEND \ || (cl) == C_RANGESTART || (cl) == C_RANGEEND ) #define ISSTART(cl) \ ( (cl) == C_CLASSSTART || (cl) == C_RANGESTART ) #define ISEND(cl) \ ( (cl) == C_CLASSEND || (cl) == C_RANGEEND ) #define ISUPPERSTART(tok) \ ( tok == ((C_CLASSSTART << 8) | C_UPPER) ) #define ISLOWERSTART(tok) \ ( tok == ((C_CLASSSTART << 8) | C_LOWER) ) int (*isit[13])(int c) = { NULL /* so C_CLASSVAL - C_CLASSSTART gives an index */ , isalnum , isalpha , iscntrl , isdigit , isgraph , islower , isprint , ispunct , isspace , isupper , isxdigit } ; mcxTing* mcxTRsplash ( mcxTR* tr , mcxbits bits ) { int i,j ; u32* tbl = tr->tlt ; mcxTing* splash = mcxTingEmpty(NULL, 256) ; for (i=1,j=0;i<256;i++) /* NOTE: \000 excluded */ { u32 tok = tbl[i] ; u32 meta = tok >> 8 ; if ( ((bits & MCX_TR_SOURCE) && (meta & MCX_TR_TRANSLATE)) || ((bits & MCX_TR_SOURCE_C) && ! (meta & MCX_TR_TRANSLATE)) || ((bits & MCX_TR_SQUASH) && (meta & MCX_TR_SQUASH)) || ((bits & MCX_TR_SQUASH_C) && ! (meta & MCX_TR_SQUASH)) || ((bits & MCX_TR_DELETE) && (meta & MCX_TR_DELETE)) || ((bits & MCX_TR_DELETE_C) && ! (meta & MCX_TR_DELETE)) ) splash->str[j++] = i ; } splash->str[j] = '\0' ; return splash ; } ofs mcxTRtranslate ( char* src , mcxTR* tr ) { dim i,j ; int prev = INT_MAX /* only relevant for squash case */ ; dim len = strlen(src) ; u32* tbl = tr->tlt ; for (i=0,j=0;i> 8) & MCX_TR_TRANSLATE ? idxmap : idx ; if ((tbl[val] >> 8) & MCX_TR_DELETE) continue ; if (!((tbl[val] >> 8) & MCX_TR_SQUASH) || val != prev) { *(src+j++) = (char) val ; prev = val ; } } *(src+j) = '\0' ; return (ofs) j ; } ofs mcxTingTranslate ( mcxTing* src , mcxTR* tr ) { src->len = mcxTRtranslate(src->str, tr) ; return src->len ; } /* fixme conceivably mcxTRtranslate could return -1 as * error condition. hum ho. */ ofs mcxTingTr ( mcxTing* txt , const char* src , const char* dst , const char* set_delete , const char* set_squash , mcxbits modes ) { mcxTR tr ; if (mcxTRloadTable(&tr, src, dst, set_delete, set_squash, modes)) return -1 ; txt->len = mcxTRtranslate(txt->str, &tr) ; return txt->len ; } static const char* xtr_get_token ( const char *p , const char *z , u8* classp , u8* valuep , int *repeat ) #define MCX_HEX(c) ( (c>='0' && c<='9') ? c-'0'\ : (c>='a' && c<='f') ? c-'a'+10\ : (c>='A' && c<='F') ? c-'A'+10\ : 0\ ) { int c = UC(p), d = 0, np = 0 ; mcxstatus status = STATUS_FAIL ; i32 value = 0, class = 0 /* need to be able to check overflow */ ; const char* me = "xtr_" "get_token" ; mcxbool class_ok = classp ? TRUE : FALSE ; if (classp) *classp = 0 ; if (valuep) *valuep = 0 ; if (repeat) *repeat = -1 ; while (1) { if (p >= z) break /*************************************************************************/ ; if (c == '\\') { if (p+1 >= z) error_break ; d = UC(p+1) ; if (strchr("0123", d)) { if ( p+3 >=z || !isdigit(UC(p+2)) || !isdigit(UC(p+3)) /* fixme 009 */ ) { mcx_tr_err = X_OCTAL_SYNTAX ; error_break ; } value = 64*(d-'0') + 8*(UC(p+2)-'0') + (UC(p+3)-'0') ; if (value > 0377) { mcx_tr_err = X_OCTAL_RANGE ; error_break ; } np = 4 ; } else if (d == 'x') { if ( p+3 >= z || !isxdigit(UC(p+2)) || !isxdigit(UC(p+3)) ) { mcx_tr_err = X_HEX_SYNTAX ; error_break ; } value = 16 * MCX_HEX(UC(p+2)) + MCX_HEX(UC(p+3)) ; np = 4 ; } else if (strchr("\\abfnrtv", d)) { np = 2 ; switch(d) { case 'a' : value = 07 ; break ; case 'b' : value = 010 ; break ; case 'f' : value = 014 ; break ; case 'n' : value = 012 ; break ; case 'r' : value = 015 ; break ; case 't' : value = 011 ; break ; case 'v' : value = 013 ; break ; case '\\': value = 0134; break ; default : value = '?' ; break /* impossible */ ; } } else { value= d ; np = 2 ; } } /* case '\\' */ /*************************************************************************/ else if (c == '[') { if (!class_ok) /* fixme: could just accept '[' */ { mcx_tr_err = X_CLASS_UNEXPECTED ; error_break ; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ else if (p+1 < z && UC(p+1) == ':') { if (!strncmp(p+2, "alpha:]", 7)) class = C_ALPHA, np = 4+ 5 ; else if (!strncmp(p+2, "alnum:]", 7)) class = C_ALNUM, np = 4+ 5 ; else if (!strncmp(p+2, "digit:]", 7)) class = C_DIGIT, np = 4+ 5 ; else if (!strncmp(p+2, "cntrl:]", 7)) class = C_CNTRL, np = 4+ 5 ; else if (!strncmp(p+2, "graph:]", 7)) class = C_GRAPH, np = 4+ 5 ; else if (!strncmp(p+2, "lower:]", 7)) class = C_LOWER, np = 4+ 5 ; else if (!strncmp(p+2, "print:]", 7)) class = C_PRINT, np = 4+ 5 ; else if (!strncmp(p+2, "punct:]", 7)) class = C_PUNCT, np = 4+ 5 ; else if (!strncmp(p+2, "space:]", 7)) class = C_SPACE, np = 4+ 5 ; else if (!strncmp(p+2, "upper:]", 7)) class = C_UPPER, np = 4+ 5 ; else if (!strncmp(p+2, "xdigit:]", 8)) class = C_XDIGIT, np = 4+ 6 ; else { mcx_tr_err = X_CLASS_UNKNOWN ; break ; } } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ else if (p+1 < z && UC(p+1) == '*') { int num = 0 ; u8 value2 = 0 ; const char* q = NULL ; if (p+2 >= z) { mcx_tr_err = X_REPEAT_SYNTAX ; error_break ; } if (!(q = xtr_get_token(p+2, z, NULL, &value2, NULL))) error_break ; if (UC(q) == '*' && UC(q+1) == ']') class = C_FLOOD ; else if ( (UC(q) == '#' && UC(q+1) == ']') || (UC(q) == '*') ) class = C_REPEAT ; else { mcx_tr_err = X_REPEAT_SYNTAX ; error_break ; } if (UC(q+1) == ']') { *repeat = 0 ; q++ ; } else { if (sscanf(q+1, "%d]", &num) != 1) break ; if (!(q = strchr(q, ']'))) break ; if (num < 0 || num > 256) break ; *repeat = num ; if (!num) class = C_FLOOD ; } /* q[0] should be ']' now */ value = value2 ; np = (q+1) - p /* truncintok */ ; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ else break ; } /*************************************************************************/ else { value = c ; np = 1 ; } status = STATUS_OK ; break ; } if (status) { mcxErr(me, "error at char (%c)", UC(p)) ; return NULL ; } if (mcx_tr_debug) fprintf(stdout, "xtr_get_token (%d | %d)\n", (int) value, (int) class) ; if (classp) *classp = class ; if (valuep) *valuep = value ; return p + np ; } char* mcxStrEscapedValue ( const char* p , const char* z , int *value ) { u8 val = p[0] ; const char* q = NULL ; if (val != '\\') { *value = val ; return (char*) (p+1) ; } if (!(q = xtr_get_token(p, z, NULL, &val, NULL))) return NULL ; *value = val ; return (char*) q ; } /* Sets either * value to something in the range 0-255 and length * to something >= 1 * or * value to one of the constants C_ALPHA etc and length to 0. * * Returns the next parsable character or NULL for failure. */ static const char* xtr_get_set ( const char *p , const char *z , u8 *classp , u8 *valuep , int *countp ) { const char* q = xtr_get_token(p, z, classp, valuep, countp) ; if (!q) return NULL ; if (!*classp && *q == '-') { u8 range_top = 0 ; q = xtr_get_token(q+1, z, NULL, &range_top, NULL) ; if (!q) return NULL ; if (range_top < *valuep) { mcx_tr_err = X_RANGE_INVERTED ; return NULL ; } *countp = range_top - *valuep + 1 ; } else if (!*classp) *countp = 1 /* else it is a repeat class or .. */ ; return q ; } static void mcx_tr_enc_dump ( u32* enc , const char* tag ) { int i = 0 ; fprintf(stdout, "(dumping %s\n", tag) ; while (i> 8 ; int val = enc[i] & 0377 ; fprintf(stdout, "%6d%6d%6d\n", i, meta, val) ; if (meta == C_EOF) break ; i++ ; } fprintf(stdout, ")\n") ; } static mcxstatus xtr_get_spec ( const char* spec , u32* tbl /* size MAX_SPEC_INDEX+1 */ , mcxbool repeat_ok /* doubles as true for dst, false for src, ugly! */ ) { const char* p = spec ; const char* z = spec + strlen(spec) ; int offset=0, i=0 ; mcxstatus status = STATUS_FAIL ; while (1) { u8 value = 0 ; u8 class = 0 ; int count = -1 ; status = STATUS_OK ; if (p >= z) break ; status = STATUS_FAIL /* space for 1 token; check anything longer. * (reserve space for EOF token) */ ; if (offset >= MAX_SPEC_INDEX) break ; if (!(p = xtr_get_set(p, z, &class, &value, &count))) break ; if (ISREPEAT(class) && count >= 0) { if (!repeat_ok) { mcx_tr_err = X_REPEAT_UNEXPECTED ; break ; } tbl[offset++] = (class << 8) | value ; if (offset >= MAX_SPEC_INDEX) break ; tbl[offset++] = count & 0377 ; } else if (ISCLASS(class)) { int (*innit)(int) = isit[class - C_CLASSSTART] ; tbl[offset++] = (C_CLASSSTART << 8 ) | class ; for (i=0;i<256;i++) { if (innit(i)) { if (offset >= MAX_SPEC_INDEX) break ; tbl[offset++] = i ; } } if (i != 256) break ; if (offset >= MAX_SPEC_INDEX) break ; tbl[offset++] = (C_CLASSEND << 8) | class ; } else if (count > 1) { tbl[offset++] = (C_RANGESTART << 8) ; for (i=value;i= MAX_SPEC_INDEX) break ; tbl[offset++] = i ; } if (i != value+count) break ; if (offset >= MAX_SPEC_INDEX) break ; tbl[offset++] = C_RANGEEND << 8 ; } else tbl[offset++] = value ; status = STATUS_OK ; } tbl[offset++] = C_EOF << 8 ; if (status || p!=z) { mcxErr(us, "error!") ; return STATUS_FAIL ; } return STATUS_OK ; } static mcxstatus mcx_tr_encode_boolean ( mcxTR* tr , u32* enc , mcxbits bit ) { int i ; for (i=0;i> 8 ; int value = enc[i] & 0377 ; if (class == C_EOF) break ; if (class) continue ; tr->tlt[value] |= bit << 8 ; } return STATUS_OK ; } static mcxstatus mcx_tr_translate_encode ( mcxTR* tr , u32* srcenc , u32* dstenc ) { int X = -1, Y = -1 ; int s = 0, d = 0 ; int star_count = 0 ; mcxbool star_fill = FALSE , flood_fill = FALSE , src_end = FALSE , dst_end = FALSE , to_lower = FALSE , to_upper = FALSE , src_class_end = FALSE ; while (1) { u32 src_tok = 0 ; u32 src_cls = 0 ; u32 src_val = 0 ; u32 dst_tok = 0 ; u32 dst_cls = 0 ; u32 dst_val = 0 ; src_class_end = FALSE ; if (s >= MAX_SPEC_INDEX || d >= MAX_SPEC_INDEX) { mcxErr(us, "panic off the rails") ; break ; } if (X >= 0 && Y >= 0) { tr->tlt[X] = Y | (MCX_TR_TRANSLATE << 8) ;if (mcx_tr_debug) fprintf(stdout, "map %d to %d\n", X, Y) ; X = -1 ; if (star_count) star_count-- ; if (!star_count && !star_fill && !flood_fill) Y = -1 ; } else if (s || d) mcxErr(us, "fimbly feeling") /* skip ends, unset star_fill if necessary */ ; src_tok = srcenc[s++] ; src_cls = src_tok >> 8 ; src_val = src_tok & 0377 /* consider both * tring -x 'abcdef[:digit:]' -y '[*_#][*##]' (magic ends with f) * tring -x '[:digit:]abcdef' -y '[*##][*_#]' (magic ends before a) */ ; if (ISBOUNDARY(src_cls)) star_fill = FALSE ; if (ISEND(src_cls)) src_tok = srcenc[s++] , src_cls = src_tok >> 8 , src_val = src_tok & 0377 , src_class_end = TRUE ; if (!star_count && !star_fill && !flood_fill) { dst_tok = dstenc[d++] ; dst_cls = dst_tok >> 8 ; dst_val = dst_tok & 0377 ; if (ISEND(dst_cls)) dst_tok = dstenc[d++] , dst_cls = dst_tok >> 8 , dst_val = dst_tok & 0377 ; } ;if (mcx_tr_debug) fprintf(stdout, "have %3d %3d %3d %3d\n", (int) src_cls, (int) src_val, (int) dst_cls, (int) dst_val); /* check class/range conditions. */ if (ISLOWERSTART(src_tok) && ISUPPERSTART(dst_tok)) to_upper = TRUE ; else if (ISUPPERSTART(src_tok) && ISLOWERSTART(dst_tok)) to_lower = TRUE ; else if ((to_upper || to_lower) && src_class_end) to_lower = FALSE , to_upper = FALSE /* check repeat */ ; if (ISREPEAT(dst_cls)) { Y = dst_val ; star_count = dstenc[d++] ; if (dst_cls == C_FLOOD) flood_fill = TRUE ; else if (!star_count) star_fill = TRUE ;if (mcx_tr_debug) fprintf(stdout, "star count/fill/flood %d %d %d\n", star_count, star_fill, flood_fill) ; } ;if (mcx_tr_debug && (to_upper || to_lower)) fprintf(stdout, "case mapping\n") ; if (!star_count && !star_fill && !flood_fill) { if (ISSTART(dst_cls)) Y = dstenc[d++] ; else Y = dst_val ; } if (ISSTART(src_cls)) X = srcenc[s++] ; else X = src_val ; if (!ISUCHARRANGE(X) || !ISUCHARRANGE(Y)) mcxErr(us, "panic %d %d", X, Y) , X = 0 , Y = 0 ; if (to_lower) { if (!isupper(X)) { mcxErr(us, "panic %d not lower", X) ; X = 0, Y = 0 ; } else Y = tolower(X) ; } else if (to_upper) { if (!islower(X)) { mcxErr(us, "panic %d not upper", X) ; X = 0, Y = 0 ; } else Y = toupper(X) ; } src_end = src_cls == C_EOF ; dst_end = dst_cls == C_EOF ; if (src_end || dst_end) break ; } if (!src_end) mcxErr(us, "trailing fluff in src") ; if (!dst_end && !((star_fill || flood_fill) && dstenc[d] >> 8 == C_EOF)) mcxErr(us, "trailing fluff in dst") ; return STATUS_OK /* specs parsed alright, just ignore spurious stuff */ ; } static void mcx_tr_complement ( u32* enc ) { u32 tmp[256] ; int i = 0 ; int j = 0 ; int delta = 1 ; for (i=0;i<256;i++) tmp[i] = 0 ; for (i=0;i<=MAX_SPEC_INDEX;i+=delta) { int class = enc[i] >> 8 ; int value = enc[i] & 0377 ; if (ISREPEAT(class)) { delta = 2 ; mcxErr(us, "value taken but repeat ignored in complement") ; tmp[value] = 1 ; continue ; } else if (ISBOUNDARY(class)) /* nada */ ; else tmp[value] = 1 ; delta = 1 ; } for (i=0;i<256;i++) if (!tmp[i]) enc[j++] = i ; enc[j++] = C_EOF << 8 ; while (j<=MAX_SPEC_INDEX) enc[j++] = C_EOF << 8 ; } /* * the enc arrays use stop and end tokens for ranges and classes. both are * required to have more than 1 element. No more than MAX_SPEC_INDEX+1 * positions are allocated for either specification, which also cater for * start and end and EOF tokens - the +1 is for the EOF token. * * carryon */ static mcxstatus mcx_tr_encode ( mcxTR* tr , const char* src , const char* dst , const char* set_delete , const char* set_squash ) { u32 srcenc[MAX_SPEC_INDEX+1] ; u32 dstenc[MAX_SPEC_INDEX+1] ; int i ; if (src && dst) { for (i=0;i<=MAX_SPEC_INDEX;i++) srcenc[i] = 0 , dstenc[i] = 0 ; if (xtr_get_spec(src, srcenc, FALSE)) return STATUS_FAIL ; if (mcx_tr_debug) mcx_tr_enc_dump(srcenc, "source") ; if (tr->modes & MCX_TR_SOURCE_C) mcx_tr_complement(srcenc) ; if (xtr_get_spec(dst, dstenc, TRUE)) return STATUS_FAIL ; if (mcx_tr_debug) mcx_tr_enc_dump(dstenc, "destination") ; if (tr->modes & MCX_TR_DEST_C) mcx_tr_complement(dstenc) ; if (mcx_tr_translate_encode(tr, srcenc, dstenc)) return STATUS_FAIL ; } if (set_delete) { for (i=0;i<=MAX_SPEC_INDEX;i++) srcenc[i] = 0 ; if (xtr_get_spec(set_delete, srcenc, FALSE)) return STATUS_FAIL ; if (mcx_tr_debug) mcx_tr_enc_dump(srcenc, "delete") ; if (tr->modes & MCX_TR_DELETE_C) mcx_tr_complement(srcenc) ; mcx_tr_encode_boolean(tr, srcenc, MCX_TR_DELETE) ; } if (set_squash) { for (i=0;i<=MAX_SPEC_INDEX;i++) srcenc[i] = 0 ; if (xtr_get_spec(set_squash, srcenc, FALSE)) return STATUS_FAIL ; if (mcx_tr_debug) mcx_tr_enc_dump(srcenc, "squash") ; if (tr->modes & MCX_TR_SQUASH_C) mcx_tr_complement(srcenc) ; mcx_tr_encode_boolean(tr, srcenc, MCX_TR_SQUASH) ; } return STATUS_OK ; } mcxstatus mcxTRloadTable ( mcxTR* tr , const char* src , const char* dst , const char* set_delete , const char* set_squash , mcxbits modes ) { const char* me = "mcxTRloadTable" ; int i ; mcx_tr_err = NULL ; if (src && UC(src) == '^') src++ , modes |= MCX_TR_SOURCE_C ; if (dst && UC(dst) == '^') dst++ , modes |= MCX_TR_DEST_C ; if (src && dst) modes |= MCX_TR_TRANSLATE ; if (set_delete) { if (UC(set_delete) == '^') set_delete++ , modes |= MCX_TR_DELETE_C ; modes |= MCX_TR_DELETE ; } ; if (set_squash) { if (UC(set_squash) == '^') set_squash++ , modes |= MCX_TR_SQUASH_C ; modes |= MCX_TR_SQUASH ; } tr->modes = modes ; for (i=0;i<256;i++) tr->tlt[i] = 0 ; if (src && !dst) { mcxErr(me, "src requires dst") ; return STATUS_FAIL ; } return mcx_tr_encode(tr, src, dst, set_delete, set_squash) ; } cimfomfa-21-361/tingea/tr.h000066400000000000000000000103731416241612100154350ustar00rootroot00000000000000/* (C) Copyright 2005, 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea under * the terms of the GNU General Public License; either version 3 of the License * or (at your option) any later version. You should have received a copy of * the GPL along with tingea, in the file COPYING. */ #ifndef tingea_tr #define tingea_tr #include #include "ting.h" #include "types.h" #include "inttypes.h" /* * README * This interface is not POSIX compliant. It might evolve to * optionally be indeed. * However, given some of the braindeadliness of POSIX tr compliance, * I don't think the worlds needs another tr implementation. * My gripe is mainly about derailed syntax such as '[:alpha:0'. * It should go down in a ball of flames, not happily parse. * To be honest, I don't know for sure whether this is a POSIX * lack of requirement or an implementation choice. * * I did choose to follow most of the POSIX syntax. It is probably * a sign of weakness. * This interface should be able to do everything a POSIX interface can, * possibly more. * * - It allows separate specification of src, dst, del and squash sets. * - Provisionally we accept "^spec" to indicate complement, * for any of src dst del squash sets. * - It uses [*c*20] to denote repeats, rather than [c*20]. * rationale: do not slam door shut on new syntax. * - It does not recognize '[a-z]' ranges, only 'a-z'. * rationale: none. If ever, notation will be [-a-z] or similar. * - The magic repeat operator [*c#] stops on boundaries * rationale: I like it. * A boundary is introduced by stop/start of ranges and classes. * - The magic repeat operator [*c*] does not stop on boundaries. * - For now, the interface does 1) deletion, 2) translation, 3) squashing. * in the future it may provide a custom order of doing things. * * * Apart from the fact that you cannot have '\0' in C strings, everything * here should work for '\0' as well - specifically the mcxTrTable structure. * However, the current interface uses C strings for dst and src and C strings * for data. * * More documentation to follow. * */ extern const char* mcx_tr_err; extern mcxbool mcx_tr_debug; typedef struct { u32 tlt[256] ; mcxbits modes ; } mcxTR ; #define MCX_TR_DEFAULT 0 #define MCX_TR_TRANSLATE 1 << 1 #define MCX_TR_SOURCE 1 << 2 #define MCX_TR_DEST 1 << 3 #define MCX_TR_SQUASH 1 << 4 #define MCX_TR_DELETE 1 << 5 #define MCX_TR_SOURCE_C 1 << 6 #define MCX_TR_DEST_C 1 << 7 #define MCX_TR_DELETE_C 1 << 8 #define MCX_TR_SQUASH_C 1 << 9 #define MCX_TR_COMPLEMENT 1 << 10 mcxstatus mcxTRloadTable ( mcxTR* tr , const char* src , const char* dst , const char* set_delete , const char* set_squash , mcxbits modes ) ; /* returns new length of string. * fixme: document map/squash semantics. */ ofs mcxTRtranslate ( char* src , mcxTR* tr ) ; ofs mcxTingTranslate ( mcxTing* src , mcxTR* tr ) ; ofs mcxTingTr ( mcxTing* txt , const char* src , const char* dst , const char* set_delete , const char* set_squash , mcxbits flags ) ; /* Accepts e.g. \012 and sets *value to 10. * idem \xa0 and \n (\t, \r, \b etc) * Does *not* yet accept \0xa0 * * Returns next parsable character. * * This interface should be moved to ding. */ char* mcxStrEscapedValue ( const char* p , const char* z , int *value ) ; /* * returns a ting containing all the characters according to bits. * bits accept * MCX_TR_SOURCE * MCX_TR_SOURCE_C * MCX_TR_SQUASH * MCX_TR_SQUASH_C * MCX_TR_DELETE * MCX_TR_DELETE_C * * NOTE * MCX_TR_DEST * MCX_TR_DEST_C * are not yet implemented. * * NOTE DANGER SIGN * tr no longer contains information on complements that were * used in constructing it. * The complements that bits refer to is simply the information * present in tr. * So a source of "^a-z" given to mcxTRloadTable * and MCX_TR_SOURCE_C given to mcxTRsplash * result in a string containing all of a-z. */ mcxTing* mcxTRsplash ( mcxTR* tr , mcxbits bits ) ; #endif cimfomfa-21-361/tingea/types.c000066400000000000000000000007761416241612100161550ustar00rootroot00000000000000/* (C) Copyright 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #include "types.h" const char* mcx_status_list[] = { "OK" , "FAIL" , "DONE" , "IGNORE" , "NOMEM" , "ABORT" , "NEW" , "UNUSED" } ; cimfomfa-21-361/tingea/types.h000066400000000000000000000054301416241612100161520ustar00rootroot00000000000000/* (C) Copyright 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen * * This file is part of tingea. You can redistribute and/or modify tingea * under the terms of the GNU General Public License; either version 3 of the * License or (at your option) any later version. You should have received a * copy of the GPL along with tingea, in the file COPYING. */ #ifndef types_h #define types_h #include "inttypes.h" typedef unsigned long mcxbits ; typedef unsigned long mcxmode ; typedef unsigned long mcxenum ; /* mcxstatus defined below */ /* mcxbool defined below */ #define BIT_ON(var,bits) (var) |= (bits) #define BIT_OFF(var, bits) do { (var) |= (bits); (var) ^= (bits); } while (0) #define ALL_BITS_OFF 0 #define VOID_TO_UINT (unsigned) #define UINT_TO_VOID (void*) #define VOID_TO_ULONG (unsigned long) #define ULONG_TO_VOID (void*) #define NOTHING do { } while (0) /* ************************************************************************** * * ** Implementation notes (a few). * * * The intent is that routines that return mcxstatus can define their own * values, so one must check the interface of a given routine as to what kind * of symbolic values it may return. * * For example, the opt library defines MCX_OPT_OK, MCX_OPT_NOARG, and * MCX_OPT_UNKNOWN. * * The intent is also that the OK value is always defined as zero -- it's * not the zero that counts but the fact that all OK values (e.g. STATUS_OK, * MCX_OPT_OK etc) are equal. One should be able to count on this. * If multiple ok values are possible, use one of mcxenum, mcxbits, mcxmode. * */ typedef enum { STATUS_OK = 0 , STATUS_FAIL , STATUS_DONE /* for iterator type interfaces (e.g. readLine) */ , STATUS_IGNORE /* for iterator type interfaces (line parser) */ , STATUS_NOMEM , STATUS_ABORT /* e.g. user response */ , STATUS_NEW /* for cache type interfaces */ , STATUS_UNUSED /* use this as lower bound for new statuses */ } mcxstatus ; extern const char* mcx_status_list[]; #define MCXSTATUS(status) \ ( status <= STATUS_UNUSED \ ? mcx_status_list[status] \ : "NO_such_status!" \ ) #ifndef FALSE typedef enum { FALSE = 0 , TRUE = 1 } mcxbool ; #else typedef int mcxbool ; #endif typedef enum { RETURN_ON_FAIL = 1960 , EXIT_ON_FAIL , SLEEP_ON_FAIL , ENQUIRE_ON_FAIL /* user sets TINGEA_MEM_DO to e.g. exit or retry */ } mcxOnFail ; #define MCX_DATUM_THREADING 1 #define MCX_DATUM_FIND 2 #define MCX_DATUM_INSERT 4 #define MCX_DATUM_DELETE 8 #endif